ActivePrediction
ActivePrediction[f,{conf1,conf2, …}]
gives an object representing the result of active prediction obtained by using the function f to determine values for the example configurations confi.
ActivePrediction[f,reg]
generates configurations within the region specified by reg.
ActivePrediction[f,sampler]
generates configurations by applying the function sampler.
ActivePrediction[f,{conf1,conf2,…}nsampler]
applies the function nsampler to successively generate configurations starting from one of the confi.
Details and Options



- ActivePrediction[…] returns an ActivePredictionObject[…] whose properties can be obtained using ActivePredictionObject[…]["prop"].
- Possible properties include:
-
"EvaluationHistory" configurations explored and values corresponding to them "Method" method used for active prediction "PredictorFunction" best PredictorFunction[…] obtained "PredictorMeasurementsObject" latest PredictorMeasurementsObject[…] obtained "OracleFunction" original function f used to determine values "LearningCurve" plot of mean cross-entropy evolution "Properties" list of all available properties - Configurations can be of any form accepted by Predict (single data element, list of data elements, association of data elements, etc.) and of any type accepted by Predict (numerical, textual, sounds, images, etc.).
- When applied to a configuration conf, the output of the function f must be a real-number value.
- In ActivePrediction[f,spec], spec defines the domain of the function f. A domain can be defined by a list of configurations, a geometric region or a configuration generator function.
- In ActivePrediction[f,sampler], sampler[] must output a configuration suitable for f to be applied to it.
- In ActivePrediction[f,{conf1,conf2,…}nsampler], nsampler[conf] must output a configuration.
- ActivePrediction has the same options as Predict, with the following additions and changes: [List of all options]
-
InitialEvaluationHistory None initial set of configurations and values MaxIterations 2000 maximum number of iterations Method Automatic method used to determine configurations to query and the prediction algorithm to use RandomSeeding 1234 what seeding of pseudorandom generators should be done internally - Possible settings for Method include:
-
Automatic automatically choose method "Randomized" choose random configurations from the domain "MaxEntropy" choose configurations for which the predictor has maximum uncertainty assoc association specifying the evaluation strategy and prediction method - In the form Methodassoc, the association can have elements:
-
"EvaluationStrategy" method for determining which configurations to query "PredictionMethod" method to use for prediction - Possible settings for RandomSeeding include:
-
Automatic automatically reseed every time the function is called Inherited use externally seeded random numbers seed use an explicit integer or strings as a seed -
AcceptanceThreshold Automatic rarer probability threshold for anomaly detector AnomalyDetector None anomaly detector used by the predictor FeatureExtractor Identity how to extract features from which to learn FeatureNames Automatic feature names to assign for input data FeatureTypes Automatic feature types to assume for input data IndeterminateThreshold 0 below what probability density to return Indeterminate InitialEvaluationHistory None initial set of configurations and values MaxIterations 2000 maximum number of iterations Method Automatic method used to determine configurations to query and the prediction algorithm to use MissingValueSynthesis Automatic how to synthesize missing values PerformanceGoal Automatic aspects of performance to try to optimize RandomSeeding 1234 what seeding of pseudorandom generators should be done internally RecalibrationFunction Automatic how to post-process predicted value TargetDevice "CPU" the target device on which to perform training TimeGoal Automatic how long to spend training the classifier TrainingProgressReporting Automatic how to report progress during training UtilityFunction Automatic utility as function of actual and predicted value ValidationSet Automatic data on which to validate the model generated
List of all options

Examples
open allclose allBasic Examples (3)Summary of the most common use cases
Train an ActivePredictionObject[…] to find the predictor for a function, given a set of configurations:

https://wolfram.com/xid/0g7h9woqf92-eamr7q

Extract the resulting predictor:

https://wolfram.com/xid/0g7h9woqf92-fz55mq


https://wolfram.com/xid/0g7h9woqf92-jr7hzm

Train a prediction object to find the predictor for a function whose domain is defined by an interval:

https://wolfram.com/xid/0g7h9woqf92-71unuc


https://wolfram.com/xid/0g7h9woqf92-v5ek5c


https://wolfram.com/xid/0g7h9woqf92-prwr5

Train a prediction object to find the predictor for the Det function, with the domain defined by a configuration generator:

https://wolfram.com/xid/0g7h9woqf92-p9xt0c


https://wolfram.com/xid/0g7h9woqf92-vequm4


https://wolfram.com/xid/0g7h9woqf92-vzz0e1

Scope (3)Survey of the scope of standard use cases
Train a prediction object to find a predictor for the sine function in an interval:

https://wolfram.com/xid/0g7h9woqf92-pgt7ug

Obtain the list of available object properties:

https://wolfram.com/xid/0g7h9woqf92-39v469

Obtain the history of explored configurations:

https://wolfram.com/xid/0g7h9woqf92-fxrok9

Obtain the predictors trained during active prediction, along with some of their properties:

https://wolfram.com/xid/0g7h9woqf92-4wyf4u


https://wolfram.com/xid/0g7h9woqf92-53v9i0

Obtain the method used to choose configurations to add to the training set:

https://wolfram.com/xid/0g7h9woqf92-pwngyv


https://wolfram.com/xid/0g7h9woqf92-hw4p4y

Display the performances of the predictors trained during active prediction:

https://wolfram.com/xid/0g7h9woqf92-e88e20

Visualize the predictions of the predictor on new examples:

https://wolfram.com/xid/0g7h9woqf92-v3b645

Train a prediction object to find the predictor for a function that computes the color distance between a given color and the red color, with the domain defined by a random color generator:

https://wolfram.com/xid/0g7h9woqf92-jmsr2p


https://wolfram.com/xid/0g7h9woqf92-3bfsuz

Display the performances of the predictors trained during active prediction:

https://wolfram.com/xid/0g7h9woqf92-6nk7qk

Display the comparison plot of the predictor for a test set:

https://wolfram.com/xid/0g7h9woqf92-2z3ar7

Define a nontrivial function, with the domain defined by a neighborhood configuration generator:

https://wolfram.com/xid/0g7h9woqf92-b4xhzs
Train a prediction object to find a predictor for the function, starting with some initial configurations:

https://wolfram.com/xid/0g7h9woqf92-srmmdp


https://wolfram.com/xid/0g7h9woqf92-xf2y34

Visualize the predictions of the predictor. It provides a good model of the function in the neighborhood of the initial configurations:

https://wolfram.com/xid/0g7h9woqf92-4c964f

Options (3)Common values & functionality for each option
InitialEvaluationHistory (1)
Define a quadratic function whose domain is defined by a set of numbers:

https://wolfram.com/xid/0g7h9woqf92-y5pitz
Construct an initial "training set":

https://wolfram.com/xid/0g7h9woqf92-lq60o2

Train a prediction object to find a predictor for the function using the preceding information:

https://wolfram.com/xid/0g7h9woqf92-7z9qmw

The examples in the first row in the training history now correspond to the initial training set:

https://wolfram.com/xid/0g7h9woqf92-p7ov4v

MaxIterations (1)
Define a nontrivial two-dimensional function:

https://wolfram.com/xid/0g7h9woqf92-gm2570
Train a prediction object to find a predictor for the function within a unit disk:

https://wolfram.com/xid/0g7h9woqf92-uu6pnh

Obtain the number of function evaluations:

https://wolfram.com/xid/0g7h9woqf92-e6zvcs

Specify the maximum number of iterations:

https://wolfram.com/xid/0g7h9woqf92-zbusip

Check the number of function evaluations now:

https://wolfram.com/xid/0g7h9woqf92-33s2bl

Method (1)
Define a nontrivial stochastic function:

https://wolfram.com/xid/0g7h9woqf92-kezlvu
Train a prediction object by specifying the method as an association, choosing the evaluation strategy and the prediction method:

https://wolfram.com/xid/0g7h9woqf92-816yfj


https://wolfram.com/xid/0g7h9woqf92-tjldx7

Specify a different method for active prediction:

https://wolfram.com/xid/0g7h9woqf92-pfpp78


https://wolfram.com/xid/0g7h9woqf92-qi3wxr

Visualize the predictions of the two predictors. "GaussianProcess" produces a smoother predictor relative to "NearestNeighbors":

https://wolfram.com/xid/0g7h9woqf92-vym7jj

Applications (2)Sample problems that can be solved with this function
Efficiently train a model to predict the elevation at a specific location:

https://wolfram.com/xid/0g7h9woqf92-ev5fs8
Sample 1000 random locations to test the quality of the model:

https://wolfram.com/xid/0g7h9woqf92-movia0
Compare the predicted elevation versus the actual elevation obtained via a server call:

https://wolfram.com/xid/0g7h9woqf92-tusmgm


https://wolfram.com/xid/0g7h9woqf92-top3sx

LogLikelihood Function Predictor (1)
Load Fisher's Iris dataset and divide it into a training set and a test set:

https://wolfram.com/xid/0g7h9woqf92-tk9bkv
Construct a LogLikelihood function that trains a classifier on the training sample and then gives the "LogLikelihoodRate" on the test sample for a given choice of the hyperparameters:

https://wolfram.com/xid/0g7h9woqf92-voiwbr
Train a prediction object to find a predictor for the LogLikelihood function over a rectangular domain:

https://wolfram.com/xid/0g7h9woqf92-uju1q0


https://wolfram.com/xid/0g7h9woqf92-6078dm

Obtain the coordinates of the explored configurations and their values:

https://wolfram.com/xid/0g7h9woqf92-jvcnbp
Visualize the prediction of the predictor together with the explored configurations:

https://wolfram.com/xid/0g7h9woqf92-7lxq6e

Text
Wolfram Research (2017), ActivePrediction, Wolfram Language function, https://reference.wolfram.com/language/ref/ActivePrediction.html (updated 2017).
CMS
Wolfram Language. 2017. "ActivePrediction." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2017. https://reference.wolfram.com/language/ref/ActivePrediction.html.
APA
Wolfram Language. (2017). ActivePrediction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ActivePrediction.html