generates a FeatureExtractorFunction[] trained from the examples given.


uses the specified feature extractor method.


applies the extractori in sequence to generate a feature extractor.


uses the extractor methods specified by ext on parts of examples specified by spec.


uses the extractor methods exti on parts of examples specified by the speci.


gives the feature extraction properties specified by props.

Details and Options

  • FeatureExtraction can be used on many types of data, including numerical, textual, sounds, and images, as well as combinations of these.
  • Each examplei can be a single data element, a list of data elements, an association of data elements, or a Dataset object.
  • FeatureExtraction[examples] returns a FeatureExtractorFunction[] that can be applied to specific data.
  • Possible feature extractor methods include:
  • Automaticautomatic extraction
    Identitygive data unchanged
    "ConformedData"conformed images, colors, dates, etc.
    "NumericVector"numeric vector from any data
    fapplies function f to each example
    {extractor1,extractor2,}use a sequence of extractors in turn
  • Additional feature extractor methods can also be used for each data type.
  • Numeric data:
  • "DiscretizedVector"discretized numerical data
    "DimensionReducedVector"reduced-dimension numeric vectors
    "IndicatorVector"nominal data "one-hot encoded" with indicator vectors
    "IntegerVector"nominal data encoded with integers
    "MissingImputed"data with missing values imputed
    "StandardizedVector"numeric data processed with Standardize
  • Nominal data:
  • "IndicatorVector"nominal data "one-hot encoded" with indicator vectors
  • Text:
  • "LowerCasedText"text with each character lowercase
    "SegmentedCharacters"text segmented into characters
    "SegmentedWords"text segmented into words
    "TFIDF"term frequency-inverse document frequency vector
    "WordVectors"semantic vectors sequence from a text (English only)
  • Images:
  • "FaceFeatures"semantic vector from an image of a human face
    "ImageFeatures"semantic vector from an image
    "PixelVector"vector of pixel values from an image
  • Audio objects:
  • "AudioFeatures"sequence of semantic vectors from an audio object
    "LPC"audio linear prediction coefficients
    "MelSpectrogram"audio spectrogram with logarithmic frequencies bins
    "MFCC"audio mel-frequency cepstral coefficients vectors sequence
    "Spectrogram"audio spectrogram
  • Feature extractor methods are applied to data elements with whose types they are compatible. Other data elements are returned unchanged.
  • FeatureExtraction[examples] is equivalent to FeatureExtraction[examples,Automatic], which is typically equivalent to FeatureExtraction[examples,"NumericVector"].
  • The "NumericVector" method will typically convert examples to numeric vectors, impute missing data, and reduce the dimension using DimensionReduction.
  • In FeatureExtraction[examples,extractors,props], props can be a single property or a list of properties. Possible properties include:
  • "ExtractorFunction"FeatureExtractorFunction[] (default)
    "ExtractedFeatures"examples after feature extraction
    "ReconstructedData"examples after extraction and inverse extraction
    "FeatureDistance"FeatureDistance[] generated from the extractor
  • In FeatureExtraction[examples,specext] or FeatureExtraction[examples,{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.
  • In FeatureExtraction[examples,{spec1ext1,}], the exti are all applied separately to examples.
  • The following options can be given:
  • FeatureNamesAutomaticnames to assign to elements of the examplei
    FeatureTypesAutomaticfeature types to assume for elements of the examplei
    RandomSeeding1234what seeding of pseudorandom generators should be done internally
  • Possible settings for RandomSeeding include:
  • Automaticautomatically reseed every time the function is called
    Inheriteduse externally seeded random numbers
    seeduse an explicit integer or strings as a seed
  • FeatureExtraction[,"ExtractedFeatures"] is equivalent to FeatureExtract[].
  • FeatureExtraction[,"FeatureDistance"] is equivalent to FeatureDistance[FeatureExtraction[]].


open all close all

Basic Examples  (3)

Train a FeatureExtractorFunction on a simple dataset:

Click for copyable input

Extract features from a new example:

Click for copyable input

Extract features from a list of examples:

Click for copyable input

Train a feature extractor on a dataset of images:

Click for copyable input

Use the feature extractor on the training set:

Click for copyable input

Construct a feature extractor from a numerical dataset using the "StandardizedVector" extractor method:

Click for copyable input

Use the feature extractor on the training set:

Click for copyable input

The property "ExtractedFeatures" can be used to perform this operation in one step:

Click for copyable input

Multiple properties can be queried:

Click for copyable input

Scope  (12)

Options  (3)

Applications  (3)

Introduced in 2016
Updated in 2017