twinlab.active_learn_campaign#

twinlab.active_learn_campaign(campaign_id, num_points, processor='cpu', verbose=False, debug=False, **kwargs)[source]#

Active learn campaign

Draw new candidate data points via active learning from a pre-trained campaign

that exists on the twinLab cloud.

Parameters:
  • campaign_id (str) – Name of pre-trained campaign to use for predictions.

  • num_points (int) – Number of samples to draw for each row of the evaluation data.

  • verbose (bool, optional) – Optional. Determining level of information returned to the user.

Returns:

containing the recommended sample locations

Return type:

pandas.DataFrame

Examples

import pandas as pd
import twinlab as tl

df = pd.DataFrame({'X': [1, 2, 3, 4], 'y': [1, 4, 9, 16]})
tl.upload_dataset(df, "my_dataset")
params = {
    "dataset_id": "my_dataset",
    "inputs": ["X"],
    "outputs": ["y"],
}
tl.train_campaign(params, "my_campaign")
n = 10
df = tl.active_learn_campaign("my_campaign", n)
print(df)

Deprecated since version 2.5.0: The twinLab Python client version v1 will be deprecated imminently. Please upgrade to the latest version of the twinLab Python client. Avaible at https://pypi.org/project/twinlab/.