({{, (RefLink[FeatureExtractor, paclet:ref/FeatureExtractor]) 
is an option for functions such as (RefLink[Classify, paclet:ref/Classify]) that specifies how features should be extracted.}})

OpenersNotesSection(Spacer1)Details

Possible settings for (RefLink[FeatureExtractor, paclet:ref/FeatureExtractor]) include:

Possible feature extractor methods include:

Additional feature extractor methods can also be used for each data type.

Numeric data:

Nominal data:

Text:

Images:

Audio objects:

By default, FeatureExtractor->(RefLink[Identity, paclet:ref/Identity]).

Typically, the value of (RefLink[FeatureExtractor, paclet:ref/FeatureExtractor]) is interpreted as a preprocessing step: it will not replace the other feature extractors used by the function.

When the feature extractor method is not a (RefLink[FeatureExtractorFunction, paclet:ref/FeatureExtractorFunction])[…] or a custom function, the feature extraction will be learned from the data.

With the settings spec->ext or {(Subscript[spec, 1])->(Subscript[ext, 1]),…}, possible forms for spec and the (Subscript[spec, i]) include:

Parts not mentioned in spec or the (Subscript[spec, i]) are dropped for the purpose of extracting features.

In functions such as (RefLink[Classify, paclet:ref/Classify]), (RefLink[Predict, paclet:ref/Predict]), (RefLink[DimensionReduction, paclet:ref/DimensionReduction]) or (RefLink[ClusterClassify, paclet:ref/ClusterClassify]), FeatureExtractor->"Minimal" indicates that the internal preprocessing should be as simple as possible.

OpenersPrimaryExamplesSection(Spacer1)Examples  (4)

OpenersExampleSection0(Spacer1)Basic Examples  (3)

Train a (RefLink[FeatureExtractorFunction, paclet:ref/FeatureExtractorFunction]) on a simple dataset:

dataset={{1.4,"A"},{1.5,"A"},{2.3,"B"},{5.4,"B"}};

fe=FeatureExtraction[dataset]

Use the feature extractor function as a preprocessing step in (RefLink[Classify, paclet:ref/Classify]):

Classify[dataset->{"Yes","No","No","No"},FeatureExtractor->fe]

Train a classifier using the extractor method "ImageFeatures" as a preprocessing step:

c=Classify[{->"cat",->"cat",->"cat",->"dog",->"dog",->"dog"},FeatureExtractor->"ImageFeatures"]

Classify a new image:

c[]

Generate a predictor function using (RefLink[FeatureExtractor, paclet:ref/FeatureExtractor]) to preprocess the data using a custom function:

data={(DateObject["Mon 5 May 2014 09:53:06""GMT"-5.`, DateObject[{2014,5,5},TimeObject[{9,53,6.301579`},TimeZone->-5.`],TimeZone->-5.`]])->1,(DateObject["Sat 1 Jan 2000 00:00:00""GMT"-5.`, DateObject[{2000,1,1},TimeObject[{0,0,0.`},TimeZone->-5.`],TimeZone->-5.`]])->2,(DateObject["Thu 23 Aug 2007", DateObject[{2007,8,23}]])->3,(DateObject["Mon 4 Apr 2016 15:59:18""GMT"-4.`, DateObject[{2016,4,4},TimeObject[{15,59,18.273754`},TimeZone->-4.`],TimeZone->-4.`]])->4};

p=Predict[data,FeatureExtractor->({AbsoluteTime[#],#["Year"]}&)]

Add the "StandardizedVector" method to the preprocessing pipeline:

p=Predict[data,FeatureExtractor->{{AbsoluteTime[#],#["Year"]}&, "StandardizedVector"}]

Use the predictor on new data:

p[(DateObject["Wed 18 Jan 2017 23:24:10""GMT"-5.`, DateObject[{2017,1,18},TimeObject[{23,24,10.098993`},TimeZone->-5.`],TimeZone->-5.`]])]

OpenersExampleSection1(Spacer1)Scope  (1)

Train a classifier on texts preprocessed by custom functions and an extractor method:

c=Classify[{"The cat is grey."->,"My cat is fast."->,"This dog is scary."-> ,"The big dog."->},FeatureExtractor->{ToUpperCase, RemoveDiacritics,"SegmentedWords"}]

c[{"Nice CAT","What a dög"}]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[FeatureExtraction, paclet:ref/FeatureExtraction])  ▪  (RefLink[FeatureExtractorFunction, paclet:ref/FeatureExtractorFunction])  ▪  (RefLink[FeatureTypes, paclet:ref/FeatureTypes])  ▪  (RefLink[FeatureDistance, paclet:ref/FeatureDistance])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Machine Learning, paclet:guide/MachineLearning])}})}})