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".


takes an existing predictor function and modifies it with the new options given.

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
    RandomSeeding1234what seeding of pseudorandom generators should be done internally
    TargetDevice"CPU"the target device on which to perform training
    TimeGoalAutomatichow long to spend training the classifier
    TrainingProgressReportingAutomatichow to report progress during training
    UtilityFunctionAutomaticutility as function of actual and predicted value
    ValidationSetAutomaticdata on which to validate the model generated
  • Possible settings for PerformanceGoal include:
  • "DirectTraining"train directly on the full dataset, without model searching
    "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
    {goal1,goal2,}automatically combine goal1, goal2, etc.
  • Possible settings for Method include:
  • "DecisionTree"predict using a decision tree
    "GradientBoostedTrees"predict using an ensemble of trees trained with gradient boosting
    "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
  • The following settings for TrainingProgressReporting can be used:
  • "Panel"show a dynamically updating graphical panel
    "Print"periodically report information using Print
    "ProgressIndicator"show a simple ProgressIndicator
    "SimplePanel"dynamically updating panel without learning curves
    Nonedo not report any information
  • 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
  • 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.
  • Predict[,FeatureExtractor"Minimal"] indicates that the internal preprocessing should be as simple as possible.
  • In Predict[PredictorFunction[],FeatureExtractorfe], the FeatureExtractorFunction[] fe will be prepended to the existing feature extractor.
  • Information can be used on the PredictorInformation[] obtained.


open all close 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  (19)

Applications  (4)

Properties & Relations  (1)

Possible Issues  (1)

Neat Examples  (1)

Introduced in 2014
Updated in 2018