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:
  • InitialEvaluationHistoryNoneinitial set of configurations and values
    MaxIterations2000maximum number of iterations
    MethodAutomaticmethod used to determine configurations to query and the prediction algorithm to use
    RandomSeeding1234what seeding of pseudorandom generators should be done internally
  • Possible settings for Method include:
  • Automaticautomatically choose method
    "Randomized"choose random configurations from the domain
    "MaxEntropy"choose configurations for which the predictor has maximum uncertainty
    assocassociation 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:
  • Automaticautomatically reseed every time the function is called
    Inheriteduse externally seeded random numbers
    seeduse an explicit integer or strings as a seed

Examples

open allclose all

Basic Examples  (3)

Train an ActivePredictionObject[] to find the predictor for a function, given a set of configurations:

Extract the resulting predictor:

Predict new examples:

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

Extract the predictor:

Predict new examples:

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

Extract the predictor:

Predict new examples:

Scope  (3)

Train a prediction object to find a predictor for the sine function in an interval:

Obtain the list of available object properties:

Obtain the history of explored configurations:

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

Obtain the final predictor:

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

Obtain some other properties:

Display the performances of the predictors trained during active prediction:

Visualize the predictions of the predictor on new examples:

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:

Obtain the predictor:

Display the performances of the predictors trained during active prediction:

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

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

Train a prediction object to find a predictor for the function, starting with some initial configurations:

Obtain the predictor:

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

Options  (3)

InitialEvaluationHistory  (1)

Define a quadratic function whose domain is defined by a set of numbers:

Construct an initial "training set":

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

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

MaxIterations (1)

Define a nontrivial two-dimensional function:

Train a prediction object to find a predictor for the function within a unit disk:

Obtain the number of function evaluations:

Specify the maximum number of iterations:

Check the number of function evaluations now:

Method (1)

Define a nontrivial stochastic function:

Train a prediction object by specifying the method as an association, choosing the evaluation strategy and the prediction method:

Obtain the predictor:

Specify a different method for active prediction:

Obtain the predictor again:

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

Applications  (1)

LogLikelihood Function Predictor  (1)

Load Fisher's Iris dataset and divide it into a training set and a test set:

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:

Train a prediction object to find a predictor for the LogLikelihood function over a rectangular domain:

Obtain the predictor:

Obtain the coordinates of the explored configurations and their values:

Visualize the prediction of the predictor together with the explored configurations:

Introduced in 2017
 (11.1)
 |
Updated in 2017
 (11.2)