FeatureExtraction[{example1,example2,…}]
与えられた例で訓練されたFeatureExtractorFunction[…]を生成する.
FeatureExtraction[examples,spec]
指定された特徴抽出法 spec を使う.
FeatureExtraction[examples,spec,props]
props で指定された特徴抽出特性を与える.
FeatureExtraction
FeatureExtraction[{example1,example2,…}]
与えられた例で訓練されたFeatureExtractorFunction[…]を生成する.
FeatureExtraction[examples,spec]
指定された特徴抽出法 spec を使う.
FeatureExtraction[examples,spec,props]
props で指定された特徴抽出特性を与える.
詳細とオプション
- FeatureExtractionは,一般に,生のデータを処理して(例えば機械学習アルゴリズムの訓練に)使用可能な特徴にする関数を定義するために使われる.
- FeatureExtractionは,数値,テキスト,サウンド,画像,グラフ,時系列,それらの組合せを含む数多くのデータ型に使うことができる.
- 次は,examples の可能な値である.
-
{example1,…} 訓練例のリスト Dataset[…] Datasetオブジェクト Tabular[…] Tabularオブジェクト None 訓練例はなし - 各 exampleiは,単一のデータ要素,データ要素のリスト,あるいはデータ要素の連想でよい.
- 次は,spec の可能な値である.
-
extractor 指定された抽出器法を使う partextractor 特定の例題部分に抽出器を適用する {part1extractor1,…} 特定の部分に対する抽出器を指定する - 使用可能な特徴抽出法 extractor には以下がある.
-
Automatic 自動抽出 Identity データを変更せずに与える "ConformedData" 一致する画像,色,日付等 "NumericVector" 任意のデータからの数値ベクトル "name" 名前付きの抽出器法 f 関数 f を各例に適用する {extractor1,extractor2,…} 一連の抽出器を交互に使う - 次は,part の可能な形式である.
-
All 各例題のすべての部分 i 各例題の i
番目の部分{i1,i2,…} 各例題の i1, i2, …番目の部分 "key" 各例題の指定されたキーを持つ部分 {"key1","key2",…} 各例題の名前"keyi"がある部分 - 明示的に部分を指定する場合は,特徴抽出の際に言及されていない部分は除去される.
- FeatureExtraction[examples]はFeatureExtraction[examples,Automatic]に等しいが,これは通常FeatureExtraction[examples,"NumericVector"]に等しい.
- "NumericVector"法は,通常,例題を数値ベクトルに変換し,欠落データを補完し,DimensionReductionを使って次元削減を行う.
- 特定のデータ型に固有の特徴抽出法は,そのデータ型と互換性のあるデータ要素にのみ適用される.その他のデータ要素は変更されずに返される.
- examples がNoneのときは,固有の特徴抽出器すべてが使えるわけではない.
- 固有の抽出器には以下がある.
- 数値データ
-
"DiscretizedVector" 離散化された数値データ "DimensionReducedVector" 次元を削減した数値ベクトル "MissingImputed" 欠落値が補完されたデータ "StandardizedVector" Standardizeで処理された数値データ - 名義データ
-
"IndicatorVector" インジケータベクトルで「ワンホットエンコード」された名義データ "IntegerVector" 整数で符号化された名義データ - テキスト
-
"LowerCasedText" 各文字が小文字のテキスト "SegmentedCharacters" 文字に分割されたテキスト "SegmentedWords" 単語に分割されたテキスト "SentenceVector" テキストからの意味ベクトル "TFIDF" 単語の出現頻度と逆文書頻度のベクトル "WordVectors" 英語テキストからの意味ベクトル列(英語のみ) - 画像
-
"FaceFeatures" ヒトの顔からの意味ベクトル "ImageFeatures" 画像からの意味ベクトル "PixelVector" 画像からの画素値のベクトル - 音声オブジェクト
-
"AudioFeatures" 音声オブジェクトからの意味ベクトル列 "AudioFeatureVector" 音声オブジェクトからの意味ベクトル "LPC" 音声線形予測係数 "MelSpectrogram" 対数周波数ビンの音声スペクトログラム "MFCC" 音声メル周波数ケプストラム係数ベクトル列 "SpeakerFeatures" 意味話者ベクトルの列 "SpeakerFeatureVector" 話者の意味ベクトル "Spectrogram" 音声スペクトログラム - 動画オブジェクト
-
"VideoFeatures" 動画オブジェクトからの意味ベクトルの列 "VideoFeatureVector" 動画オブジェクトからの意味ベクトル - グラフ
-
"GraphFeatures" グラフ特性を要約する数値ベクトル - 分子
-
"AtomPairs" 原子対と両者間の経路長からのブールベクトル "MoleculeExtendedConnectivity" 列挙された分子の部分グラフからのブールベクトル "MoleculeFeatures" 分子の特性を要約する数値ベクトル "MoleculeTopologicalFeatures" 円形の原子近傍からのブールベクトル - FeatureExtraction[examples,extractors,props]では,props は単一の特性あるいは特性のリストでよい.次は使用可能な特性である.
-
"ExtractorFunction" FeatureExtractorFunction[…](デフォルト) "ExtractedFeatures" 特徴抽出後の examples "ReconstructedData" 抽出と逆抽出後の examples "FeatureDistance" 抽出器から生成されたFeatureDistance[…] - "ExtractedFeatures"特性と"ReconstructedData"特性は,examples がNoneのときには使えない.
- "ReconstructedData"特性は,指定されたすべての extractor が可逆のときにしか計算できない.
- 使用可能なオプション
-
FeatureNames Automatic exampleiの要素に割り当てる名前 FeatureTypes Automatic exampleiの要素に仮定する特徴タイプ RandomSeeding 1234 どのような擬似乱数生成器のシードを内部的に使うべきか - RandomSeedingの可能な設定
-
Automatic 関数が呼び出されるたびに自動的にシードを変える Inherited 外部シードの乱数を使う seed 明示的な整数または文字列をシードとして使う
抽出器
特性
オプション
例題
すべて開く すべて閉じる例 (3)
単純なデータ集合についてFeatureExtractorFunctionを訓練する:
fe = FeatureExtraction[{{1.4, "A"}, {1.5, "A"}, {2.3, "B"}, {5.4, "B"}}]fe[{2.4, "A"}]fe[{{2.4, "A"}, {3.7, "B"}}]fe = FeatureExtraction[{[image], [image], [image], [image], [image], [image]}]fe[{[image], [image], [image], [image], [image], [image]}]fe = FeatureExtraction[{[image], [image], [image], [image], [image], [image]}, "ImageFeatures"]スコープ (32)
入力の形状 (9)
fe = FeatureExtraction[{"It was the best of times.", "A journey of a thousand miles begins with a single step.", "To be or not to be, that is the question."}]fe["A rose by any other name"]fe[{"A rose by any other name", "It was the worst of times"}]fe = FeatureExtraction[{{"It was the best of times.", "Charles Dickens"}, {"A journey of a thousand miles begins with a single step.", "Laozi (attrib.)"}, {"To be or not to be, that is the question.", "William Shakespere"}}]fe[{{"All the world’s a stage, and all the men and women merely players", "William Shakespere"}, {"Knowing others is intelligence; knowing yourself is true wisdom", "Laozi (attrib.)"}}]fe = FeatureExtraction[{{"the cat is grey", [image]}, {"my cat is fast", [image]}, {"this dog is scary", [image]}, {"the big dog", [image]}}]fe[{"the nice cat", [image]}]fe = FeatureExtraction[{<|"age" -> 32, "height" -> 160, "gender" -> "female"|>,
<|"height" -> 183, "age" -> 41, "gender" -> "female"|>,
<|"height" -> 123, "age" -> 30, "gender" -> "female"|>,
<|"height" -> 175, "age" -> 21, "gender" -> "male"|>,
<|"height" -> 150, "age" -> 11, "gender" -> "male"|>,
<|"age" -> 52, "height" -> 164, "gender" -> "female"|>}]fe[<|"age" -> 19, "height" -> 176, "gender" -> "male"|>]fe[{<|"age" -> 19, "height" -> 176, "gender" -> "male"|>, <|"age" -> 45, "height" -> 164, "gender" -> "female"|>}]FeatureExtraction[<|"age" -> {32, 41, 30, 21, 11, 52}, "height" -> {160, 183, 123, 175, 150, 164}, "gender" -> {"female", "female", "female", "male", "male", "female"}|>]Tabularで特徴抽出器を訓練する:
FeatureExtraction[Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["age" -> Association["ElementType" -> "Integer64"],
"height" -> Association["ElementType" -> "Integer64"],
"gender" -> Association["ElementType" -> "String"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{32, 41, 30, 21, 11, 52}, {}, None},
"ElementType" -> "Integer64"]], TabularColumn[Association[
"Data" -> {{160, 183, 123, 175, 150, 164}, {}, None}, "ElementType" -> "Integer64"]],
TabularColumn[Association["Data" -> {{3, {0, 6, 12, 18, 22, 26, 32},
"femalefemalefemalemalemalefemale"}, {}, None}, "ElementType" -> "String"]]}}]]]]]Datasetで特徴抽出器を訓練する:
FeatureExtraction[Dataset[{Association["age" -> 32, "height" -> 160, "gender" -> "female"],
Association["age" -> 41, "height" -> 183, "gender" -> "female"],
Association["age" -> 30, "height" -> 123, "gender" -> "female"],
Association["age" -> 21, "height" -> 175, "gender" -> "male"],
Association["age" -> 11, "height" -> 150, "gender" -> "male"],
Association["age" -> 52, "height" -> 164, "gender" -> "female"]}]]FeatureExtraction[{{1.4, Missing[], "A"}, {1.5, 50.2, "A"}, {Missing[], 42.3, "B"}, {5.4, 61.7, "B"}}]fe = FeatureExtraction[None, "WordVectors"]fe["hi there"]//Shallow抽出器の指定 (10)
単一のテキスト特徴に対して特徴抽出器"SentenceVector"を指定する:
fe = FeatureExtraction[{"the lizard is green"}, "SentenceVector"]fe[{"there is a large cat"}]//Short"StandardizedVector"法を使って特徴抽出器を訓練する:
fe = FeatureExtraction[{{1.4, 42.1}, {1.5, 50.2}, {4.2, 42.3}, {5.4, 61.7}}, "StandardizedVector"]features = fe[{6.4, 32.1}]この特徴抽出器は可逆なので,FeatureExtractorFunction特性の"OriginalData"を使って逆抽出が行える:
fe[features, "OriginalData"]"TFIDF"法を使い次に"DimensionReducedVector"法を使って,特徴抽出器をテキストについて訓練する:
fe = FeatureExtraction[{"the cat is grey", "my cat is fast", "this dog is scary", "the big dog"}, {"TFIDF", "DimensionReducedVector"}]fe[{"the cat is grey", "my cat is fast", "this dog is scary", "the big dog"}]テキストのみの"TFIDF"法を使って特徴抽出器をテキストと画像で訓練する:
fe = FeatureExtraction[{{"the cat is grey", [image]}, {"my cat is fast", [image]}, {"this dog is scary", [image]}, {"the big dog", [image]}}, "TFIDF"]fe[{"the nice cat", [image]}]fe = FeatureExtraction[{{"Glucose", Molecule["Glucose"]}, {"Water", Molecule["Water"]}, {"Acetic Acid", Molecule["Acetic Acid"]}}, {1 -> { "SentenceVector", "DimensionReducedVector"}, 2 -> "MoleculeFeatures"}]fe[{{"Sucrose", Molecule["Sucrose"]}}]2つの項目のリストは2つの特徴の単一の入力であると見なされる:
fe[{"Hydrochloric Acid", Molecule["Hydrochloric Acid"]}]2番目の名義変数のみに対して"IndicatorVector"法を使って特徴抽出器を訓練する:
fe = FeatureExtraction[{{"Yes", "A"}, {"No", "A"}, {"No", "B"}, {"Maybe", "B"}, {"No", "C"}}, 2 -> "IndicatorVector"]Normal@fe[{"Yes", "A"}]Identity抽出器法を使って最初の変数をコピーする:
fe = FeatureExtraction[{{"Yes", "A"}, {"No", "A"}, {"No", "B"}, {"Maybe", "B"}, {"No", "C"}}, {2 -> "IndicatorVector", 1 -> Identity}]fe[{"Yes", "A"}]fe = FeatureExtraction[{{"Yes", "A"}, {"No", "A"}, {"No", "B"}, {"Maybe", "B"}, {"No", "C"}}, {2 -> "IndicatorVector", 1 -> "IndicatorVector", 1 -> Identity}]fe[{"Yes", "A"}]fe = FeatureExtraction[Tabular[Association["RawSchema" -> Association["ColumnProperties" ->
Association["Name" -> Association["ElementType" -> "String"],
"Molecule" -> Association["ElementType" -> "InertExpression"]], "KeyColumns" -> None,
"Backend" -> "WolframKernel"], "Options" -> {},
"BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable",
{{TabularColumn[Association["Data" -> {{3, {0, 7, 12, 23}, "GlucoseWaterAcetic Acid"}, {},
None}, "ElementType" -> "String"]], TabularColumn[
Association["Data" -> {{Molecule[{"O", "C", "C", "O", "C", "O", "C", "O", "C", "O", "C",
"O", "H", "H", "H", "H", "H", "H", "H", "H", "H", "H", "H", "H"},
{Bond[{1, 2}, "Double"], Bond[{2, 3}, "Single"], Bond[{3, 4}, "Single"], Bond[{3, 5},
"Single"], Bond[{5, 6}, "Single"], Bond[{5, 7}, "Single"], Bond[{7, 8}, "Single"],
Bond[{7, 9}, "Single"], Bond[{9, 10}, "Single"], Bond[{9, 11}, "Single"], Bond[
{11, 12}, "Single"], Bond[{2, 13}, "Single"], Bond[{3, 14}, "Single"], Bond[
{4, 15}, "Single"], Bond[{5, 16}, "Single"], Bond[{6, 17}, "Single"], Bond[{7, 18},
"Single"], Bond[{8, 19}, "Single"], Bond[{9, 20}, "Single"], Bond[{10, 21},
"Single"], Bond[{11, 22}, "Single"], Bond[{11, 23}, "Single"], Bond[{12, 24},
"Single"]}, {StereochemistryElements -> {Association["StereoType" -> "Tetrahedral",
"ChiralCenter" -> 3, "Direction" -> "Counterclockwise"], Association[
"StereoType" -> "Tetrahedral", "ChiralCenter" -> 5, "Direction" -> "Clockwise"],
Association["StereoType" -> "Tetrahedral", "ChiralCenter" -> 7, "Direction" ->
"Counterclockwise"], Association["StereoType" -> "Tetrahedral",
"ChiralCenter" -> 9, "Direction" -> "Counterclockwise"]}}],
Molecule[{"O", "H", "H"}, {Bond[{1, 2}, "Single"], Bond[{1, 3}, "Single"]}, {}],
Molecule[{"C", "C", "O", "O", "H", "H", "H", "H"}, {Bond[{1, 2}, "Single"], Bond[
{2, 3}, "Double"], Bond[{2, 4}, "Single"], Bond[{1, 5}, "Single"], Bond[{1, 6},
"Single"], Bond[{1, 7}, "Single"], Bond[{4, 8}, "Single"]}, {}]}, {}, None},
"ElementType" -> "InertExpression", "CachedOriginalExpression" ->
{Molecule[{"O", "C", "C", "O", "C", "O", "C", "O", "C", "O", "C", "O", "H", "H", "H",
"H", "H", "H", "H", "H", "H", "H", "H", "H"}, {Bond[{1, 2}, "Double"],
Bond[{2, 3}, "Single"], Bond[{3, 4}, "Single"], Bond[{3, 5}, "Single"],
Bond[{5, 6}, "Single"], Bond[{5, 7}, "Single"], Bond[{7, 8}, "Single"],
Bond[{7, 9}, "Single"], Bond[{9, 10}, "Single"], Bond[{9, 11}, "Single"],
Bond[{11, 12}, "Single"], Bond[{2, 13}, "Single"], Bond[{3, 14}, "Single"],
Bond[{4, 15}, "Single"], Bond[{5, 16}, "Single"], Bond[{6, 17}, "Single"],
Bond[{7, 18}, "Single"], Bond[{8, 19}, "Single"], Bond[{9, 20}, "Single"],
Bond[{10, 21}, "Single"], Bond[{11, 22}, "Single"], Bond[{11, 23}, "Single"],
Bond[{12, 24}, "Single"]}, {StereochemistryElements -> {Association["StereoType" ->
"Tetrahedral", "ChiralCenter" -> 3, "Direction" -> "Counterclockwise"],
Association["StereoType" -> "Tetrahedral", "ChiralCenter" -> 5, "Direction" ->
"Clockwise"], Association["StereoType" -> "Tetrahedral", "ChiralCenter" -> 7,
"Direction" -> "Counterclockwise"], Association["StereoType" -> "Tetrahedral",
"ChiralCenter" -> 9, "Direction" -> "Counterclockwise"]}}],
Molecule[{"O", "H", "H"}, {Bond[{1, 2}, "Single"], Bond[{1, 3}, "Single"]}, {}],
Molecule[{"C", "C", "O", "O", "H", "H", "H", "H"}, {Bond[{1, 2}, "Single"],
Bond[{2, 3}, "Double"], Bond[{2, 4}, "Single"], Bond[{1, 5}, "Single"],
Bond[{1, 6}, "Single"], Bond[{1, 7}, "Single"], Bond[{4, 8}, "Single"]}, {}]}]]}}]]]], {"Name" -> { "SentenceVector", "DimensionReducedVector"}, "Molecule" -> "MoleculeFeatures"}]fe[<|"Name" -> "Hydrochloric Acid", "Molecule" -> Molecule["Hydrochloric Acid"]|>]特徴抽出器をリストに使うと,もともと指定されていたのと同じ順序が仮定される:
fe[{"Hydrochloric Acid", Molecule["Hydrochloric Acid"]}]data = {DateObject[{2014, 5, 5}, TimeObject[{9, 53, 6.30158}, TimeZone -> -5.], TimeZone -> -5.], DateObject[{2000, 1, 1}, TimeObject[{0, 0, 0.}, TimeZone -> -5.], TimeZone -> -5.], DateObject[{2006, 12}], DateObject[{2007, 8, 23}], DateObject[{2016, 4, 4}, TimeObject[{15, 59, 18.2738}, TimeZone -> -4.], TimeZone -> -4.]};fe = FeatureExtraction[data, {AbsoluteTime[#], #["Year"]}&]fe[data]"StandardizedVector"メソッドでカスタム抽出器を繋ぐ:
fe2 = FeatureExtraction[data, {{AbsoluteTime[#], #["Year"]}&, "StandardizedVector"}]fe2[data]FeatureExtraction[{[image], [image], [image], [image]}, {"ConformedData", "ImageFeatures"}]FeatureExtraction[{[image], [image], [image], [image]}, {"ImageFeatures", "DimensionReducedVector"}]特徴型 (10)
"SentenceVector"抽出器を訓練なしで使って,テキストデータの特徴抽出器を作成する:
fe = FeatureExtraction[None, "SentenceVector"]入力型は指定された抽出器から推定される.この特徴抽出器を例に対して使う:
fe[{"it is not a cat", "what a nice dog", "here is a dog again"}]//Short暗黙のテキストおよび画像の特徴がある例に対して特徴抽出器を使う:
fe = FeatureExtraction[None, {1 -> "SentenceVector", 2 -> "ImageFeatures"}]fe[{"the nice cat", [image]}]//ShortFeatureExtraction[{"the cat is grey", "my cat is fast", "this dog is scary", "the big dog"}]"IndicatorVector"法を使った名義変数についての特徴抽出器:
FeatureExtraction[{{"Yes", "A"}, {"No", "A"}, {"No", "B"}, {"Maybe", "B"}, {"No", "C"}}, "IndicatorVector"]特徴抽出器を訓練して,テキストから用語頻度・逆文書頻度(TF-IDF)ベクトルを計算する:
fe = FeatureExtraction[{"the cat is grey", "my cat is fast", "this dog is scary", "the big dog"}, "TFIDF"]訓練集合の用語頻度・逆文書頻度行列はSparseArrayで計算できる:
matrix = fe[{"the cat is grey", "my cat is fast", "this dog is scary", "the big dog"}]matrix//MatrixPlot"TFIDF"法はトークン化データ(名義上のバッグ)に使うこともできる:
FeatureExtraction[{{"the", "cat", "is", "grey"}, {"my" , "cat", "is", "fast"}, {"this", "dog", "is", "scary"}, {"the", "big", "dog"}}, "TFIDF", "ExtractedFeatures"]DateObjectのインスタンスのリストで特徴抽出器を訓練する:
fe = FeatureExtraction[{DateObject[{2014, 5, 5, 9, 53, 6.30158}, "Instant", "Gregorian", -6.], DateObject[{2000, 1, 1, 0, 0, 0.}, "Instant", "Gregorian", -6.], DateObject[{2006, 12}, "Month", "Gregorian", -6.], DateObject[{2007, 8, 23}, "Day", "Gregorian", -6.], DateObject[{2016, 4, 4, 15, 59, 18.2738}, "Instant", "Gregorian", -4.]}]新たなDateObjectのインスタンスから特徴を抽出する:
fe[DateObject[{2003, 1, 2}, "Day", "Gregorian", -6.]]fe["2nd of January 2003"]Graphのインスタンスのリストで特徴抽出器を訓練する:
fe = FeatureExtraction[{[image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image]}]fe[[image]]TimeSeriesのインスタンスのリストで特徴抽出器を訓練する:
FeatureExtraction[{TemporalData[TimeSeries, {{{0, 1, 0, 3, 0, 0, 0, 0, 2, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0,
0, 0, 0, 0, 0, 2, 0, 0, 36, 0, 6, 1, 2, 8, 6, 24, 20, 31, 68, 45, 140, 116, 65, 376, 322, 382,
516, 544, 767, 1133, 1788, 1360, 5886, 5412 ... tion[{2020, 1, 23, 0, 0, 0.}, {2020, 10, 5, 0, 0, 0.}, {1, "Day"}]},
1, {"Continuous", 1}, {"Discrete", 1}, 1, {DateFunction -> Automatic,
ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}, ValueDimensions -> 1}}, True,
12.2], TemporalData[TimeSeries, {{{0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 23, 2, 1, 3, 5, 4, 13, 6, 11, 9, 20, 11, 6,
23, 14, 38, 50, 86, 66, 103, 37, 121, 70, 1 ... {TemporalData`DateSpecification[{2020, 1, 23, 0, 0, 0.}, {2020, 10, 5, 0, 0, 0.}, {1, "Day"}]},
1, {"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}, ValueDimensions -> 1}}, True,
12.2], TemporalData[TimeSeries, {{{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 2, 0, 9, 0, 7, 5, 6, 7, 14, 99, 0, 11, 38,
121, 51, 249, 172, 228, 572, 331, 323, 307, ... TemporalData`DateSpecification[{2020, 1, 23, 0, 0, 0.},
{2020, 10, 5, 0, 0, 0.}, {1, "Day"}]}, 1, {"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}, ValueDimensions -> 1}}, True,
12.2], TemporalData[TimeSeries, {{{0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 9, 0, 4, 0, 3, 0, 8, 17, 14, 4, 27,
24, 33, 52, 54, 53, 61, 71, 57, 163, 182, 196 ... {TemporalData`DateSpecification[{2020, 1, 23, 0, 0, 0.}, {2020, 10, 5, 0, 0, 0.}, {1, "Day"}]},
1, {"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}, ValueDimensions -> 1}}, True,
12.2], TemporalData[TimeSeries, {{{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 6, 0, 4, 9, 12, 20, 11,
28, 9, 26, 68, 35, 46, 101, 92, 21, 48, 69 ... {TemporalData`DateSpecification[{2020, 1, 23, 0, 0, 0.}, {2020, 10, 5, 0, 0, 0.}, {1, "Day"}]},
1, {"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}, ValueDimensions -> 1}}, True,
12.2]}]Moleculeデータで特徴抽出器を訓練する:
FeatureExtraction[{Molecule["Sucrose"], Molecule["Pentane"]}]Audioのインスタンスのリストで特徴抽出器を訓練する:
FeatureExtraction[{Audio[Sound[Table[SoundNote[i, If[i == 12, 0.5, 0.1], "Violin"], {i, 0, 12}]]], Audio[Sound[Table[SoundNote[i, If[i == 12, 0.5, 0.1], "Trumpet"], {i, 0, 12}]]]}]情報 (3)
訓練済みのFeatureExtractorFunctionからInformationを取得する:
Information[FeatureExtractorFunction[Association["ExampleNumber" -> 4,
"Preprocessor" -> MachineLearning`MLProcessor["ToMLDataset",
Association["Input" -> Association["age" -> Association["Type" -> "Numerical"],
"gender" -> Association["Type" - ... ate" -> DateObject[{2025, 5, 2, 13, 0,
39.042795`8.344115878952366}, "Instant", "Gregorian", 2.], "ProcessorCount" -> 10,
"ProcessorType" -> "ARM64", "OperatingSystem" -> "MacOSX", "SystemWordLength" -> 64,
"Evaluations" -> {}]]]]Information[FeatureExtractorFunction[Association["ExampleNumber" -> 4,
"Preprocessor" -> MachineLearning`MLProcessor["ToMLDataset",
Association["Input" -> Association["age" -> Association["Type" -> "Numerical"],
"gender" -> Association["Type" - ... ate" -> DateObject[{2025, 5, 2, 13, 0,
39.042795`8.344115878952366}, "Instant", "Gregorian", 2.], "ProcessorCount" -> 10,
"ProcessorType" -> "ARM64", "OperatingSystem" -> "MacOSX", "SystemWordLength" -> 64,
"Evaluations" -> {}]]], "Properties"]Information[FeatureExtractorFunction[Association["ExampleNumber" -> 4,
"Preprocessor" -> MachineLearning`MLProcessor["ToMLDataset",
Association["Input" -> Association["age" -> Association["Type" -> "Numerical"],
"gender" -> Association["Type" - ... ate" -> DateObject[{2025, 5, 2, 13, 0,
39.042795`8.344115878952366}, "Instant", "Gregorian", 2.], "ProcessorCount" -> 10,
"ProcessorType" -> "ARM64", "OperatingSystem" -> "MacOSX", "SystemWordLength" -> 64,
"Evaluations" -> {}]]], {"InputTypes", "OutputTypes"}]オプション (4)
FeatureNames (2)
fe = FeatureExtraction[{{2.3, "male"}, {4.8, Missing[]}, {Missing[], "female"}, {5.2, "female"}}, FeatureNames -> {"age", "gender"}]fe[<|"age" -> 3.3, "gender" -> "male"|>]fe[{3.3, "male"}]FeatureNamesを使って名前を設定し,FeatureExtraction[examples,{spec1ext1,…}]でそれを参照する:
fe = FeatureExtraction[{{"A", "female"}, {"B", "female"}, {"C", "male"}, {"B", "male"}}, {"class" -> Identity, "gender" -> "IndicatorVector"}, FeatureNames -> {"class", "gender"}]fe[<|"gender" -> "female", "class" -> "B"|>]FeatureTypes (2)
"IndicatorVector"法で簡単なデータ集合について特徴抽出器を訓練する:
fe = FeatureExtraction[{{1, "A"}, {2, "A"}, {2, "B"}, {1, "B"}}, "IndicatorVector"]"IndicatorVector"法は名義的特徴に対してしか動作しないので,最初の特徴は名義的であると想定された.
FeatureTypesを使って最初の特徴が名義的であるという解釈を強制する:
fe = FeatureExtraction[{{1, "A"}, {2, "A"}, {2, "B"}, {1, "B"}}, "IndicatorVector", FeatureTypes -> <|1 -> "Numerical"|>]最初の特徴は数値として解釈された."IndicatorVector"法は名義的特長にしか動作しないので,最初の特徴は変更されない:
fe[{{1, "A"}, {2, "A"}, {2, "B"}, {1, "B"}}]訓練なしで特徴抽出器を作ると,特定の特徴器からの期待するデータ型が推測される:
fe = FeatureExtraction[None, "SentenceVector"]fe2 = FeatureExtraction[None, "SentenceVector", FeatureTypes -> {"first" -> "Numerical", "second" -> "Text"}]fe2[<|"first" -> 1, "second" -> "Good morning!"|>]//Shortアプリケーション (3)
画像検索 (1)
dataset = {[image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image]};fe = FeatureExtraction[dataset]このデータ集合の抽出された特徴についてNearestFunctionを生成する:
nf = Nearest[fe[dataset] -> Automatic]NearestFunctionを使ってデータ集合の最近画像を描画する関数を構築する:
nearestdog = dataset[[First@nf[fe[#]]]]&nearestdog[[image]]nearestdog[[image]]nearestdog[[image]]特徴抽出器関数は似すぎている画像ペアを削除することもできる:
features = # -> fe[#]& /@ dataset;First /@ DeleteDuplicates[features, CosineDistance[#1[[2]], #2[[2]]] < 1 &]テキスト検索 (1)
「Alice in Wonderland」(不思議の国のアリス)のテキストをロードする:
alice = ExampleData[{"Text", "AliceInWonderland"}];sentences = TextSentences[alice];fe = FeatureExtraction[sentences]文の特徴を使ってNearestFunctionを生成する:
nf = Nearest[fe[sentences] -> Automatic]NearestFunctionを使って「Alice in Wonderland」の最も近い文を表示する関数を構築する:
nearestalice = sentences[[First@nf[fe[#]]]]&nearestalice["Alice and the Rabbit"]nearestalice["The cat and the Queen"]nearestalice["Off her head"]インピュテーション(データ補完) (1)
ExampleDataから"MNIST"データ集合をロードし,画像を保存する:
digits = First /@ ExampleData[{"MachineLearning", "MNIST"}, "TestData"];RandomSample[digits, 10]画像を数値データに変換し,データ集合を訓練集合とテスト集合に分ける:
digits = Flatten[ImageData[#]]& /@ RandomSample[digits];trainingset = digits[[ ;; 9000]];
testset = digits[[9001 ;; ]];Dimensions[trainingset]"MissingImputed"法を使って特徴抽出器を作成する:
fe = FeatureExtraction[trainingset, "MissingImputed"]テスト集合ベクトルのいくつかの値をMissing[]で置換し,可視化する:
vector = RandomChoice[testset];toimage = Image[Partition[#, 28], ImageSize -> Tiny] &;vectormissing = vector;
vectormissing[[309 ;; 364]] = Missing[];
imagemissing = toimage[Replace[vectormissing, _Missing -> .5, {1}]]FeatureExtractorFunction[…]を使って欠落値を補完する:
imputedimage = toimage[fe[vectormissing]]{toimage[vector], imagemissing, imputedimage}特性と関係 (4)
fe = FeatureExtraction[<|"age" -> {32, 41, 30, 21, 11, 52}, "height" -> {160, 183, 123, 175, 150, 164}, "gender" -> {"female", "female", "female", "male", "male", "female"}|>]fe[<|"age" -> 19, "height" -> 176, "gender" -> "male"|>]fe[<|"age" -> 19, "height" -> 176, "gender" -> "male", "weight" -> 32|>]FeatureExtraction[…,"ExtractedFeatures"]はFeatureExtract[…]に等しい:
data = {"the cat is grey", "my cat is fast", "this dog is scary", "the big dog"};FeatureExtraction[data, "TFIDF", "ExtractedFeatures"] == FeatureExtract[data, "TFIDF"]"FeatureDistance"特性は,抽出器にFeatureDistanceを使うことに等しい:
fd1 = FeatureExtraction[{"the cat is grey", "my cat is fast", "this dog is scary", "the big dog"}, "TFIDF", "FeatureDistance"]まず,FeatureExtractorFunctionを計算する:
fe = FeatureExtraction[{"the cat is grey", "my cat is fast", "this dog is scary", "the big dog"}, "TFIDF"]fd2 = FeatureDistance[fe]fd1["the cat is grey", "the big dog"]fd2["the cat is grey", "the big dog"]特定の訓練データについてFeatureExtractorFunctionを作ると,その特徴を表す特徴空間が作られる:
fe = FeatureExtraction[{Molecule["Glucose"], Molecule["Sucrose"]}]異なる訓練データを使うとサイズが決まった特徴空間になることがある:
molecules = Molecule /@ EntityList[EntityClass["Chemical", "AminoAcids"]];
fe2 = FeatureExtraction[molecules]fe[Molecule["Water"]] === fe2[Molecule["Water"]]同じ項目をデータなしで作ると,同じ特徴空間で同じ結果を一貫して与える訓練されていない関数が生成される:
fe3 = FeatureExtraction[None, "MoleculeFeatures"]考えられる問題 (7)
feAutomatic = FeatureExtraction[{"C", "B", "C", "B", "A", "B", "B", "A", "B", "B", "A", "A"}, "IndicatorVector"]Information[feAutomatic, "FeatureNames"]関数適用時にカスタム名を使うと,特徴が見付からないというエラーになる:
feAutomatic[<|"Letter" -> "S"|>]feNamed = FeatureExtraction[{"C", "B", "C", "B", "A", "B", "B", "A", "B", "B", "A", "A"}, "IndicatorVector", FeatureNames -> "Letter"]FeatureExtractorFunctionの特徴名をチェックする:
Information[feNamed, "FeatureNames"]feNamed[<|"Letter" -> "S"|>]FeatureExtraction特性の"ReconstructedData"を使うと,抽出と再構築の後でデータが取得できる:
FeatureExtraction[{{1.4, 1.4, 5.4, 5.2}, {1.5, 1.5, 6.4, 5.2}, {1.2, 1.2, 6.2, 5.2}, {1.6, 1.6, 4.3, 5.2}}, "DimensionReducedVector", "ReconstructedData"]fe = FeatureExtraction[{{1.4, 1.4, 5.4, 5.2}, {1.5, 1.5, 6.4, 5.2}, {1.2, 1.2, 6.2, 5.2}, {1.6, 1.6, 4.3, 5.2}}, "DiscretizedVector", "ReconstructedData"]FeatureExtraction[{[image], [image], [image], [image]}, "ImageFeatures", "ReconstructedData"]特性"ReconstructedData"は訓練データなしでは使えない:
FeatureExtraction[None, "DimensionReducedVector", "ReconstructedData"]FeatureExtraction[None, "LowerCasedText"]FeatureExtraction[None, "StandardizedVector"]FeatureExtraction[None, "LowerCasedText", "FeatureDistance"]fe = FeatureExtraction[{"No", "No", "no", "no", "no", "no", "yes", "no", "Yes", "Yes"}, {"LowerCasedText", "IndicatorVector"}]入力型は"Text"なので,"IndicatorVector"抽出器は入力型を無視する:
fe["Yes"] == fe["yes"]同様に,入力を強制的に"Nominal"にすると"LowerCasedText"が無視されるようになる:
fe = FeatureExtraction[{"No", "No", "no", "no", "no", "no", "yes", "no", "Yes", "Yes"}, {"LowerCasedText", "IndicatorVector"}, FeatureTypes -> "Nominal"]fe["Yes"]データフリーのコンテキストで作用するためには,"ConformedData"抽出器は追加的な情報を必要とする:
FeatureExtraction[None, "ConformedData"]FeatureTypesを明示的に指定する:
FeatureExtraction[None, "ConformedData", FeatureTypes -> "Image"]特徴型は,後続する抽出器から暗黙の内に推測されることがある:
FeatureExtraction[None, {"ConformedData", "ImageFeatures"}]fe = FeatureExtraction[{"rhinos have horns", "deer have antlers", "fish have scales"}]明示的な特徴抽出器は削減を含まないので,より長いベクトルになることが多い:
fe = FeatureExtraction[{"rhinos have horns", "deer have antlers", "fish have scales"}, "SentenceVector"]"DimensionReducedVector"を使って次元削減ステップを加える:
fe = FeatureExtraction[{"rhinos have horns", "deer have antlers", "fish have scales"}, {"SentenceVector", "DimensionReducedVector"}]次元削減は使用可能な特徴で訓練されなければならず,したがってデータが与えられていない場合は適用できない:
fe = FeatureExtraction[None, {"SentenceVector", "DimensionReducedVector"}]名前付きの特徴を使ってFeatureExtractorFunction を作成する:
fe = FeatureExtraction[None, {"Name" -> "LowerCasedText", "Molecule" -> "MoleculeFeatures"}]fe[{"Name" -> "Amoxicillin", "Molecule" -> Molecule["Amoxicillin"]}]fe[<|"Name" -> "Amoxicillin", "Molecule" -> Molecule["Amoxicillin"]|>]//Shortresponse = {"No", "No", "no", "no", "no", "no", "yes", "no", "Yes", "Yes"};
fe = FeatureExtraction[response, "LowerCasedText"]fe = FeatureExtraction[response, {"LowerCasedText", "IndicatorVector"}]fe1 = FeatureExtraction[response, "LowerCasedText"]
fe2 = FeatureExtraction[fe1[response], "IndicatorVector"]fe2[fe1["No"]]テキスト
Wolfram Research (2016), FeatureExtraction, Wolfram言語関数, https://reference.wolfram.com/language/ref/FeatureExtraction.html (2025年に更新).
CMS
Wolfram Language. 2016. "FeatureExtraction." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/FeatureExtraction.html.
APA
Wolfram Language. (2016). FeatureExtraction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FeatureExtraction.html
BibTeX
@misc{reference.wolfram_2026_featureextraction, author="Wolfram Research", title="{FeatureExtraction}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/FeatureExtraction.html}", note=[Accessed: 09-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_featureextraction, organization={Wolfram Research}, title={FeatureExtraction}, year={2025}, url={https://reference.wolfram.com/language/ref/FeatureExtraction.html}, note=[Accessed: 09-September-2026]}