generates a PredictorFunction[] based on the example input-output pairs given.


generates the same result.


attempts to predict the output associated with input from the training examples given.


uses the built-in predictor function represented by "name".


gives the specified property of the prediction associated with input.

Details and Options

  • Predict can be used on many types of data, including numerical, textual, sounds and images, as well as combinations of these.
  • Each inputi can be a single data element, a list of data elements, an association of data elements or a Dataset object. In Predict[training,], training can be a Dataset object.
  • Predict[training] returns a PredictorFunction[] that can then be applied to specific data.
  • In Predict[,input], input can be a single item or a list of items.
  • In Predict[,input,prop], properties are as given in PredictorFunction[]; they include:
  • "Decision"best prediction according to distribution and utility function
    "Distribution"distribution of value conditioned on input
    "Properties"list of all properties available
  • Examples of built-in predictor functions include:
  • "NameAge"age of a person, given their first name
  • The following options can be given:
  • FeatureExtractorIdentityhow to extract features from which to learn
    FeatureNamesAutomaticfeature names to assign for input data
    FeatureTypesAutomaticfeature types to assume for input data
    IndeterminateThreshold0below what probability density to return Indeterminate
    MethodAutomaticwhich regression algorithm to use
    PerformanceGoalAutomaticaspects of performance to try to optimize
    UtilityFunctionAutomaticutility as function of actual and predicted value
    ValidationSetAutomaticdata on which to validate the model generated
  • Possible settings for PerformanceGoal include:
  • "Memory"minimize storage requirements of the predictor
    "Quality"maximize accuracy of the predictor
    "Speed"maximize speed of the predictor
    "TrainingSpeed"minimize time spent producing the predictor
    Automaticautomatic tradeoff among speed, accuracy, and memory
  • PerformanceGoal{goal1,goal2,} will automatically combine goal1, goal2, etc.
  • Possible settings for Method include:
  • "LinearRegression"predict from linear combinations of features
    "NearestNeighbors"predict from nearest neighboring examples
    "NeuralNetwork"predict using an artificial neural network
    "RandomForest" predict from BreimanCutler ensembles of decision trees
    "GaussianProcess"predict using a Gaussian process prior over functions
  • Predict[{assoc1,assoc2,}"key",] can be used to specify that the output is given by the value of "key" in each association associ.
  • Predict[{list1,list2,}n,] can be used to specify that the output is given by the value of part n in each list listi.
  • Predict[Dataset[]part,] can be used to specify that the outputs are given by the value of part of each row of the dataset.


open allclose all

Basic Examples  (2)

Train a predictor function on a set of examples:

Click for copyable input
Click for copyable input

Predict the value of a new example, given its feature:

Click for copyable input

Get the conditional distribution of the value, given the example feature:

Click for copyable input

Plot this distribution:

Click for copyable input

Predict multiple examples:

Click for copyable input

Plot the predicted values as a function of the feature value and show the training examples:

Click for copyable input

Train a predictor on a dataset with multiple features:

Click for copyable input

Predict the value of a new example, given its features:

Click for copyable input

Predict the value of a new example that has a missing feature:

Click for copyable input

Scope  (8)

Options  (14)

Applications  (4)

Properties & Relations  (1)

Neat Examples  (2)

See Also

PredictorFunction  PredictorMeasurements  PredictorInformation  Classify  SequencePredict  Interpolation  FindFit  Nearest  DimensionReduce  FindFormula  BayesianMinimization

Introduced in 2014
| Updated in 2016