PredictorFunction

PredictorFunction[]

represents a function generated by Predict that predicts numerical values from data.

Details and Options

  • PredictorFunction works like Function.
  • PredictorFunction[][data] attempts to predict the value associated with data.
  • PredictorFunction[][{data1,data2,}] attempts to predict all the datai.
  • PredictorFunction[][data,prop] gives the specified property of the prediction associated with data.
  • Possible properties applicable to all methods include:
  • "Decision"best prediction according to the distribution and the utility function
    "Distribution"distribution of value conditioned on input
    "Properties"list of all properties available
  • PredictorFunction[][data,,opts] specifies that the predictor should use the options opts when applied to data.
  • Possible options are:
  • IndeterminateThresholdAutomaticbelow what probability density to return Indeterminate
    PerformanceGoalAutomaticwhich aspect of performance to optimize
    TargetDevice"CPU"the target device on which to perform training
    UtilityFunctionAutomaticutility expressed as a function of actual and predicted value
  • Predict[PredictorFunction[],opts] can be used to update the values of PerformanceGoal, IndeterminateThreshold, UtilityFunction or FeatureExtractor of the classifier.
  • In Predict[PredictorFunction[],FeatureExtractorfe], the FeatureExtractorFunction[] fe will be prepended to the existing feature extractor.
  • Information[PredictorFunction[]] generates an information panel about the classifier and its estimated performances.
  • Information[PredictorFunction[],prop] can be used to obtain specific properties.
  • Information of a PredictorFunction[] may include the following properties:
  • "BatchEvaluationTime"marginal time to predict one example when a batch is given
    "EvaluationTime"time needed to predict one example
    "ExampleNumber"number of training examples
    "FeatureTypes"feature types of the predictor input
    "FunctionMemory"memory needed to store the predictor
    "FunctionProperties"all prediction properties available for this predictor
    "IndeterminateThreshold"value of IndeterminateThreshold used by the predictor
    "LearningCurve"performance as function of training set size
    "MaxTrainingMemory"maximum memory used during training
    "MeanCrossEntropy"estimated mean cross entropy of the predictor
    "Method"value of Method used by the predictor
    "MethodDescription"summary of the method
    "MethodOption"full method option to be reused in a new training
    "Properties"all information properties available for this predictor
    "StandardDeviation"estimated standard deviation of the predictor
    "TrainingTime"time used by Predict to generate the predictor
    "UtilityFunction"value of UtilityFunction used by the predictor
  • Information properties also include all method suboptions.

Examples

open allclose all

Basic Examples  (2)

Train a PredictorFunction:

Use the trained PredictorFunction to predict an output, given some feature:

Predict multiple examples:

Calculate the probability distribution of the predicted value:

Generate a PredictorFunction using multiple features:

Use the function on a new example:

Predict an example that has missing features:

Obtain general information about the predictor:

Scope  (5)

Train a PredictorFunction on textual data:

Predict the values of new examples:

Train a PredictorFunction to recognize the frequency of SawtoothWave sounds:

Predict the values of new examples:

Train a PredictorFunction:

Generate a PredictorMeasurementsObject of the function applied to a test set:

Get the standard deviation of the residuals of the function on the test set:

Visualize the scatter plot of the test values as a function of the predicted values:

Generate a predictor function whose input is an association:

Use the function on an example:

Predict examples containing missing features:

Construct a Dataset with a list of associations:

Train a PredictorFunction to predict the feature "age" as function of the other features:

Once the PredictorFunction is trained, any input format can be used. Predict an example formatted as an association:

Find out the order of the features, and classify an example formatted as a list:

Classify examples in a Dataset:

Options  (4)

IndeterminateThreshold  (1)

Train a PredictorFunction:

Visualize the probability density for a given example:

The value with the highest probability density is predicted:

No prediction is made if the maximum probability density is below a specified threshold:

Update the value of the threshold permanently:

TargetDevice  (1)

Train a predictor using a neural network:

Evaluate the resulting predictor on system's default GPU and look at its AbsoluteTiming:

Compare the previous timing with the one achieved by using the default CPU computation:

UtilityFunction  (1)

Train a predictor function:

Visualize the probability density for a given example:

By default, the value with the highest probability density is predicted:

Define a utility function that penalizes the predicted value's being smaller than the actual value:

Plot this function for a given actual value:

The predictor decision is now changed despite the probability density's being unchanged:

Update the value of the utility function permanently:

PerformanceGoal  (1)

Obtain the built-in PredictorFunction "NameAge":

Set a custom utility function to use with this predictor:

Compute the time required to use an example with this utility function:

Use PerformanceGoal to use a faster but less accurate result:

Introduced in 2014
 (10.0)
 |
Updated in 2018
 (11.3)
2019
 (12.0)