FeatureNearest[{elem1,elem2,…},x]
計算された特徴空間で x が最も近い elemiのリストを与える.
FeatureNearest[{elem1v1,elem2v2,…},x]
x が最も近い elemiに対応する viを与える.
FeatureNearest[{elem1,elem2,…}{v1,v2,…},x]
同じ結果を与える.
FeatureNearest[{elem1,elem2,…}prop,x]
x が最も近い elemiの特性 prop を与える.
FeatureNearest[data,{x1,x2,…}]
事実上{FeatureNearest[data,x1],FeatureNearest[data,x2],…}を与える.
FeatureNearest[data,x,n]
x に 最も近い n 個の elemiを与える.
FeatureNearest[data]
異なる x に繰り返し適用可能なNearestFunction[…]を生成する.
FeatureNearest
FeatureNearest[{elem1,elem2,…},x]
計算された特徴空間で x が最も近い elemiのリストを与える.
FeatureNearest[{elem1v1,elem2v2,…},x]
x が最も近い elemiに対応する viを与える.
FeatureNearest[{elem1,elem2,…}{v1,v2,…},x]
同じ結果を与える.
FeatureNearest[{elem1,elem2,…}prop,x]
x が最も近い elemiの特性 prop を与える.
FeatureNearest[data,{x1,x2,…}]
事実上{FeatureNearest[data,x1],FeatureNearest[data,x2],…}を与える.
FeatureNearest[data,x,n]
x に 最も近い n 個の elemiを与える.
FeatureNearest[data]
異なる x に繰り返し適用可能なNearestFunction[…]を生成する.
詳細とオプション
- FeatureNearest は,テキスト,画像,音声,数値データを含む多様なデータ型に対して,自動的に計算された特徴空間における最近傍要素を見付ける.
- FeatureNearestは,数値,テキスト,サウンド,画像を含むさまざまなデータ型およびそれらの組合せに使うことができる.
- 各 elemiは,単一のデータ要素,データ要素のリスト,データ要素の連想またはDatasetオブジェクトでよい.FeatureNearest[data,…]の data はDatasetオブジェクトでよい.
- 次は,FeatureNearest[{elem1,elem2,…}prop,…]の prop の可能な形である.
-
"Element" 最も近いことが判明した elemi "Index" 最も近いことが判明した elemiの指標 i "Distance" 最も近い elemiまでの距離 {prop1,prop2,…} 複数の形式のリスト All 要素,指標,距離を与える連想 - 複数の要素が返されるときは,最も近いものが初めに返される.
- FeatureNearestは,通常,FeatureExtractで作成された空間でNearestを使うことに等しい.
- 次は使用可能なオプションである.
-
DistanceFunction Automatic 使用する距離測度 FeatureExtractor Identity どのように特徴を抽出するか FeatureTypes Automatic 入力データに仮定する特徴タイプ Method Automatic 使用するメソッド RandomSeeding 1234 どのような擬似乱数生成器のシードを内部的に使うべきか - RandomSeedingの可能な設定
-
Automatic 関数が呼び出されるたびに自動的にシードを変える Inherited 外部シードの乱数を使う seed 明示的な整数または文字列をシードとして使う - Methodの可能な設定には"Octree","KDtree","Scan"がある.
例題
すべて開く すべて閉じる例 (1)
FeatureNearestを使って最近近傍要素を見付ける関数を生成する:
nf = FeatureNearest[{{1.4, "A"}, {1.5, "A"}, {2.3, "B"}, {5.4, "B"}}]nf[{1.7, "A"}]FeatureNearest[{{1.4, "A"}, {1.5, "A"}, {2.3, "B"}, {5.4, "B"}}, {1.7, "A"}]スコープ (5)
テキストのリストについて最近近傍要素を見付ける関数を生成する:
nf = FeatureNearest[{"the cat is grey", "my cat is fast", "this dog is scary" , "the big dog"}]nf[{"what a cat", "this is not a dog"}]DateObjectのリストについて最近近傍要素を見付ける関数を訓練する:
nf = FeatureNearest[{DateObject[{2014, 5, 5}, TimeObject[{9, 53, 6.30158}]], DateObject[{2000, 1, 1}, TimeObject[{0, 0, 0.}]], DateObject[{2006, 12}], DateObject[{2007, 8, 23}, CalendarType -> "Gregorian"], DateObject[{2016, 4, 4}, TimeObject[{15, 59, 18.2738}, TimeZone -> -4.], TimeZone -> -4.]}]新たなDateObjectに最も近い要素を2つ求める:
nf[DateObject[{2003, 1, 2}], 2]nf["2nd of January 2003", 2]混合タイプのデータ集合について最近近傍要素を見付ける関数を訓練する:
nf = FeatureNearest[{{"the cat is grey", [image]}, {"my cat is fast", [image]}, {"this dog is scary", [image]}, {"the big dog", [image]}}]nf[{"the cat cat", [image]}]出力特性Allを使って最近近傍要素を見付ける関数を訓練する:
nf = FeatureNearest[{[image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image]} -> All]新たな例に最も近6つの要素を位置指標および距離とともに得る:
Dataset[nf[[image], 6]]FeatureNearest[{[image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image]}, [image], 3]オプション (4)
DistanceFunction (1)
距離関数EditDistanceを使ってテキストのリストについて最近近傍要素を見付ける関数を生成する:
nf = FeatureNearest[{"the cat is grey", "my cat is fast", "this dog is scary" , "the big dog"}, DistanceFunction -> EditDistance]nf[{"what a cat", "this is not a dog"}]距離関数が指定されている場合は,NearestとFeatureNearestは等しい:
nf2 = Nearest[{"the cat is grey", "my cat is fast", "this dog is scary" , "the big dog"}, DistanceFunction -> EditDistance]nf2[{"what a cat", "this is not a dog"}]FeatureExtractor (1)
FeatureExtractorを使ってデータの前処理を指定する最近近傍要素を見付ける関数を訓練する:
nf = FeatureNearest[{DateObject[{2014, 5, 5}, TimeObject[{9, 53, 6.30158}]], DateObject[{2000, 1, 1}, TimeObject[{0, 0, 0.}]], DateObject[{2006, 12}], DateObject[{2007, 8, 23}, CalendarType -> "Gregorian"], DateObject[{2016, 4, 4}, TimeObject[{15, 59, 18.2738}, TimeZone -> -4.], TimeZone -> -4.]}, FeatureExtractor -> AbsoluteTime]nf[DateObject[{2003, 1, 2}], 2]FeatureTypes (1)
FeatureTypesを使って"gender"は名義変数であると指定する最近近傍要素を見付ける関数を訓練する:
nf = FeatureNearest[{
<|"age" -> 32, "gender" -> 1|>,
<|"age" -> 41, "gender" -> 2|>,
<|"age" -> 17, "gender" -> 2|>,
<|"age" -> 11, "gender" -> 1|>},
FeatureTypes -> <|"gender" -> "Nominal"|>
]nf[<|"age" -> 20, "gender" -> 1|>]アプリケーション (2)
dataset = {[image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image]};FeatureNearestを使って最近近傍要素を見付ける関数を訓練する:
nf = FeatureNearest[dataset]nf[{[image], [image], [image]}]「Alice in Wonderland」(不思議の国のアリス)をロードする:
alice = ExampleData[{"Text", "AliceInWonderland"}];sentences = TextSentences[alice];nearestalice = FeatureNearest[sentences]nearestalice["Alice and the Rabbit"]nearestalice["Alice and the Queen"]nearestalice["Off her head"]nearestalice["The Hatter"]テキスト
Wolfram Research (2017), FeatureNearest, Wolfram言語関数, https://reference.wolfram.com/language/ref/FeatureNearest.html (2017年に更新).
CMS
Wolfram Language. 2017. "FeatureNearest." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2017. https://reference.wolfram.com/language/ref/FeatureNearest.html.
APA
Wolfram Language. (2017). FeatureNearest. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FeatureNearest.html
BibTeX
@misc{reference.wolfram_2026_featurenearest, author="Wolfram Research", title="{FeatureNearest}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/FeatureNearest.html}", note=[Accessed: 22-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_featurenearest, organization={Wolfram Research}, title={FeatureNearest}, year={2017}, url={https://reference.wolfram.com/language/ref/FeatureNearest.html}, note=[Accessed: 22-June-2026]}