Wolfram Language & System 11.0 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)

FeatureExtraction

FeatureExtraction[{example1,example2,}]
generates a FeatureExtractorFunction[] trained from the examples given.

FeatureExtraction[examples,extractor]
uses the specified feature extractor method.

FeatureExtraction[examples,{extractor1,extractor2,}]
applies the extractori in sequence to generate a feature extractor.

FeatureExtraction[examples,specext]
uses the extractor methods specified by ext on parts of examples specified by spec.

FeatureExtraction[examples,{spec1ext1,spec2ext2,}]
uses the extractor methods exti on parts of examples specified by the speci.

FeatureExtraction[examples,extractor,props]
gives the feature extraction properties specified by props.

Details and OptionsDetails 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 to use in FeatureExtraction include:
  • Automaticautomatic extraction
    "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
    "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
    "TFIDF"term frequency-inverse document frequency vector
    Identitygive data unchanged
    {extractor1,extractor2,}use a sequence of extractors in turn
  • 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
  • Possible settings for PerformanceGoal include:
  • "Memory"minimize storage requirements of the extractor
    "Quality"maximize quality of the extractor
    "Speed"maximize speed of the extractor
    "TrainingSpeed"minimize time spent producing the extractor
    Automaticautomatic tradeoff among speed, accuracy, and memory
  • FeatureExtraction[,"ExtractedFeatures"] is equivalent to FeatureExtract[].
  • FeatureExtraction[,"FeatureDistance"] is equivalent to FeatureDistance[FeatureExtraction[]].

ExamplesExamplesopen allclose all

Basic Examples  (3)Basic Examples  (3)

Train a FeatureExtractorFunction on a simple dataset:

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

Extract features from a new example:

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

Extract features from a list of examples:

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

Train a feature extractor on a dataset of images:

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

Use the feature extractor on the training set:

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

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

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

Use the feature extractor on the training set:

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

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

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

Multiple properties can be queried:

In[4]:=
Click for copyable input
Out[4]=
Introduced in 2016
(11.0)