FeatureTypes

FeatureTypes

is an option for machine learning functions such as Classify or Predict that specifies what feature types to assume for elements of input data given.

Details

  • Possible settings for FeatureTypes include:
  • Automaticautomatically detect types of all features
    typeinterpret the unique feature as type
    {t1,t2,}interpret the i^(th) feature as type ti
    <|iti,jtj,|>interpret the i^(th) feature as type ti etc.
    <|{i,j,}t,|>interpret the i^(th), j^(th), etc. features as type t
    <|"n1"t1,"n2"t2,|>interpret the feature named "ni" as type ti
    <|{"n1","n2",}t,|>interpret the features named AddSpans[], AddSpans[], etc. as type t
  • Possible feature types include:
  • Automaticautomatically detected type
    "Audio"acoustic signal
    "Boolean"Boolean value
    "BooleanTensor"fixed-dimension array of Boolean values
    "BooleanVector"fixed-length vector of Boolean values
    "Color"color
    "Complex"complex value
    "ComplexTensor"fixed-dimension array of complex values
    "ComplexVector"fixed-length vector of complex values
    "Date"date as a string or DateObject
    "Graph"network graph
    "Image"2D image
    "Image3D"3D image
    "Molecule"molecule
    "Nominal"discrete value specified by a name
    "NominalBag"collection of nominal values
    "NominalSequence"ordered collection of nominal values
    "NominalTensor"fixed-dimension array of nominal values
    "NominalVector"fixed-length vector of nominal values
    "Numerical"continuous numerical real value
    "NumericalBag"collection of numerical values
    "NumericalSequence"ordered collection of numerical values
    "NumericalTensor"fixed-dimension array of numerical values
    "NumericalVector"fixed-length vector of numerical values
    "NumericalVectorSequence"sequence of numerical vectors
    "NumericalTensorSequence"sequence of numerical tensors
    "Text"natural language string
    "Time"time as a string or TimeObject
    "Video"video
  • When the type of a feature is not specified, or is specified as Missing[], it is considered as Automatic.
  • The value of option FeatureTypes supersedes the value of option NominalVariables, except when FeatureTypesAutomatic.

Examples

Basic Examples  (4)

Train a predictor without specifying feature types:

The features are assumed to be numerical:

Specify that the first feature should be interpreted as a nominal variable, while the type of the second should be determined automatically:

Train a classifier on data where the feature is intended to be a sequence of tokens:

Classify wrongly assumed that examples contained two different text features:

The following classification will output an error message:

Force Classify to interpret the feature as a "NominalSequence":

Classify a new example:

Train a predictor on nominal data:

The feature has been wrongly interpreted as text:

Specify that the feature should be considered nominal:

Predict an example:

Train a classifier with named features:

Both features have been considered numerical:

Specify that the feature "gender" should be considered nominal:

Wolfram Research (2015), FeatureTypes, Wolfram Language function, https://reference.wolfram.com/language/ref/FeatureTypes.html (updated 2017).

Text

Wolfram Research (2015), FeatureTypes, Wolfram Language function, https://reference.wolfram.com/language/ref/FeatureTypes.html (updated 2017).

CMS

Wolfram Language. 2015. "FeatureTypes." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2017. https://reference.wolfram.com/language/ref/FeatureTypes.html.

APA

Wolfram Language. (2015). FeatureTypes. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FeatureTypes.html

BibTeX

@misc{reference.wolfram_2022_featuretypes, author="Wolfram Research", title="{FeatureTypes}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/FeatureTypes.html}", note=[Accessed: 12-October-2024 ]}

BibLaTeX

@online{reference.wolfram_2022_featuretypes, organization={Wolfram Research}, title={FeatureTypes}, year={2017}, url={https://reference.wolfram.com/language/ref/FeatureTypes.html}, note=[Accessed: 12-October-2024 ]}