Utility Functions#

The following functions are contained in the twinlab Core functionality.

User#

set_user(username[, verbose])

Set the username for their twinLab cloud account.

get_user([verbose])

Show the username for the twinLab cloud account.

API key#

set_api_key(api_key[, verbose])

Set the user API key for their twinLab cloud account.

get_api_key([verbose])

Show the user API key for their twinLab cloud account.

Server URL#

set_server_url(url[, verbose])

Set the server URL for twinLab.

get_server_url([verbose])

Show the URL from which twinLab is currently being accessed.

User information#

versions([verbose])

Get information about the twinLab version being used.

user_information([verbose])

Get information about the twinLab user.

Datasets and emulators#

list_emulators([verbose])

List trained emulators that exist in the user's twinLab cloud account.

list_emulators_statuses([verbose])

List the status of training and trained emulators, as well as those that have failed to train.

list_datasets([verbose])

List datasets that have been uploaded to the user's twinLab cloud account.

list_example_datasets([verbose])

List example datasets that are available on the twinLab cloud.

load_example_dataset(dataset_id[, verbose])

Load an example dataset from the twinLab cloud into the current session.

Helper functions#

get_sample(df, key)

Retrieve an individual sample from the multi-indexed dataframe returned by the Emulator.sample() method.

join_samples(df_one, df_two)

Join two dataframes that contain independent samples generated by the Emulator.sample() method.

load_dataset(filepath[, verbose])

Load a dataset from a local file in .csv format into a pandas dataframe.

load_params(filepath[, verbose])

Load a parameter set from a local file in .json format into a dictionary.