Wolfram Language & System 10.4 (2016)|Legacy Documentation

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


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 .

gives the specified property of the prediction associated with input.

Details and OptionsDetails and Options

  • Predict works for a variety of data types, including numerical, textual, sound, and image, and a combination of these types.
  • Each can be a single feature, a list of features, or an association of features. Inputs can also be contained by Dataset.
  • 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:
  • FeatureNamesAutomaticwhat names features should have
    FeatureTypesAutomaticwhat type of features should be considered
    IndeterminateThreshold0below what probability density to return Indeterminate
    MethodAutomaticwhich regression algorithm to use
    NominalVariablesAutomaticwhich features should be considered categorical
    PerformanceGoalAutomaticfavor algorithms with specific advantages
    UtilityFunctionAutomaticutility expressed as a function of actual and predicted value
    ValidationSetAutomaticdata on which to validate the model generated
  • Possible settings for PerformanceGoal include:
  • "Memory"minimize the storage requirements of the predictor
    "Quality"maximize the accuracy of the predictor
    "Speed"maximize the speed of the predictor
    "TrainingSpeed"minimize the time spent producing the predictor
    Automaticautomatic tradeoff among speed, accuracy, and memory
  • PerformanceGoal{goal1,goal2,} will automatically combine , , 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 in each association .
  • Predict[{list1,list2,}n,] can be used to specify that the output is given by the value of part n in each list .
  • Predict[Dataset[]part,] can be used to specify that the outputs are given by the value of part of each row of the dataset.

ExamplesExamplesopen allclose all

Basic Examples  (2)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
Introduced in 2014