FeatureNames

FeatureNames

is an option for machine learning functions such as Classify or Predict that specifies names to use for elements of input data given.

Details

  • Possible settings for FeatureNames include:
  • Automaticassign names automatically
    {"n1","n2",}name the i^(th) feature "ni"
  • Feature names must be strings.
  • When FeatureNamesAutomatic, features are named "f1", "f2", etc.
  • In the case of a dataset with named features, FeatureNames{"n1","n2",} can be used to define the ordering of the features.

Examples

Basic Examples  (3)

Train a classifier and give a name to each feature:

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

Use the association format to predict a new example:

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

The list format can still be used:

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

Train a predictor on a training set with named features, and use FeatureNames to set their order:

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

Features are ordered as specified:

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

Classify a new example from a list:

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

Train a classifier without specifying feature names:

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

Use ClassifierInformation and FeatureNames to obtain the names that have been automatically given to features:

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

Use these names to classify a new example described by an association:

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

See Also

FeatureTypes  Classify  Predict

Introduced in 2015
(10.1)