FeatureExtractor

FeatureExtractor

is an option for functions such as Classify that specifies how features should be extracted.

Details

  • Possible settings for FeatureExtractor include:
  • FeatureExtractorFunction[]apply the given extractor function
    extractorapply the specified feature extractor method
    {extractor1,extractor2,}apply the sequence of extractor methods in turn
    specextapply extractor ext to data parts specified by spec
    {spec1ext1,spec2ext2,}apply extractors exti to data parts specified by the speci
  • Possible feature extractor methods to use in FeatureExtractor include:
  • Automaticautomatic extraction
    "AudioFeatures"sequence of semantic vectors from an audio object
    "ConformedData"conformed images, colors, dates, etc.
    "DiscretizedVector"discretized numerical data
    "DimensionReducedVector"reduced-dimension numeric vectors
    "FaceFeatures"semantic vector from an image of a human face
    "ImageFeatures"semantic vector from an image
    "IndicatorVector"nominal data "one-hot encoded" with indicator vectors
    "IntegerVector"nominal data encoded with integers
    "LPC"audio linear prediction coefficients
    "LowerCasedText"text with each character lowercase
    "MelSpectrogram"audio spectrogram with logarithmic frequencies bins
    "MFCC"audio mel-frequency cepstral coefficients vectors sequence
    "MissingImputed"data with missing values imputed
    "NumericVector"numeric vector from any data
    "PixelVector"vector of pixel values from an image
    "StandardizedVector"numeric data processed with Standardize
    "SegmentedCharacters"text segmented into characters
    "SegmentedWords"text segmented into words
    "Spectrogram"audio spectrogram
    "TFIDF"term frequency-inverse document frequency vector
    "WordVectors"semantic vectors sequence from a text (English only)
    Identitygive data unchanged
    fapplies function f to each example
    {extractor1,extractor2,}use a sequence of extractors in turn
  • By default, FeatureExtractorIdentity.
  • When the feature extractor method is not a FeatureExtractorFunction[] or a custom function, the feature extraction will be learned from the data.
  • With the settings specext or {spec1ext1,}, possible forms for spec and the speci include:
  • Allall parts of each example
    ii^(th) part of each example
    {i1,i2,}parts i1, i2, of each example
    "name"part with the specified name in each example
    {"name1","name2",}parts with names "namei" in each example
  • Parts not mentioned in spec or the speci are dropped for the purpose of extracting features.

Examples

open allclose all

Basic Examples  (3)

Train a FeatureExtractorFunction on a simple dataset:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=

Use the feature extractor function as a preprocessing step in Classify:

In[3]:=
Click for copyable input
Out[3]=

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

In[1]:=
Click for copyable input
Out[1]=

Classify a new image:

In[2]:=
Click for copyable input
Out[2]=

Generate a predictor function using FeatureExtractor to preprocess the data using a custom function:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=

Add the "StandardizedVector" method to the preprocessing pipeline:

In[3]:=
Click for copyable input
Out[3]=

Use the predictor on new data:

In[4]:=
Click for copyable input
Out[4]=

Scope  (1)

See Also

FeatureExtraction  FeatureExtractorFunction  FeatureTypes  FeatureDistance

Introduced in 2016
(11.0)