twinlab.Emulator#

class twinlab.Emulator(id)[source]#

A trainable twinLab emulator.

An emulator is trainable model that learns the trends in a dataset. It is a machine-learning model in that it requires a dataset of inputs X and outputs y on which to be trained. In this way, it learns to mimic, or emulate, the dataset and can be used to make predictions on new data. Emulators are also often called models, surrogates, or digital twins.

Note that instantiating an emulator locally does not create a new emulator on the twinLab cloud. Instead, it can be used either to interact with an existing emulator that has previously been trained, or as a precursor step to training a new emulator.

Variables:

id (str) – The name for the emulator in the twinLab cloud. If an emulator is specified that does not currently exist, then a new emulator will be instantiated. Otherwise the corresponding emulator will be loaded from the cloud. Be sure to double check which emulators have been created using tl.list_emulators.

__init__(id)[source]#

Methods

__init__(id)

benchmark([params, verbose])

Benchmark the predicted uncertainty of a trained emulator.

calibrate(df_obs, df_std[, params, wait, ...])

Solve an inverse problem using a trained emulator on the twinLab cloud.

delete([verbose])

Delete emulator from the twinLab cloud.

design(priors, num_points[, params, verbose])

Generate an initial design space for an emulator.

get_process(process_id[, verbose])

Get the results from a process associated with the emulator on the twinLab cloud.

heatmap(x1_axis, x2_axis, y_axis[, x_fixed, ...])

Plot a heatmap of the predictions from an emulator across two dimensions.

learn(dataset, inputs, outputs, num_loops, ...)

Perform active learning to improve an emulator on the twinLab cloud.

list_processes([verbose])

List all of the processes associated with a given emulator on the twinLab cloud.

list_processes_statuses([verbose])

List the status of all processes associated with a given emulator on the twinLab cloud.

maximize([params, wait, verbose])

Finding the maximum the output of a trained emulator that exists on the twinLab cloud.

plot(x_axis, y_axis[, x_fixed, params, ...])

Plot the predictions from an emulator across a single dimension with one and two standard deviation bands.

predict(df[, params, wait, verbose])

Make predictions using a trained emulator that exists on the twinLab cloud.

recommend(num_points, acq_func[, params, ...])

Draw new recommended data points from a trained emulator that exists on the twinLab cloud.

sample(df, num_samples[, params, wait, verbose])

Draw samples from a trained emulator that exists on the twinLab cloud.

score([params, verbose])

Score the performance of a trained emulator.

status([verbose])

Check the status of a training process on the twinLab cloud.

summarise([detailed, verbose])

Get a summary of a trained emulator on the twinLab cloud.

train(dataset, inputs, outputs[, params, ...])

Train an emulator on the twinLab cloud.

view([verbose])

View an emulator that exists on the twinLab cloud.

view_test_data([verbose])

View test data on which the emulator was tested in the twinLab cloud.

view_train_data([verbose])

View training data with which the emulator was trained in the twinLab cloud.