Library

class skassist.library.Library(lib_folder='./library')

Manages the root folder of the library.

This class supports the creation and deletion of new experiments

The constructor method tries to read the content of the library folder. When looking for experiments it only considers folder with a name string starting in exp_. Everything else is ignored.

Args:
lib_folder (str, optional): Absolute/relative path to the root directory.
Attributes:

experiments (list): A list of experiments found in the library folder.

path (str): Path to the root directory.

add(name, df, skf, features, description='')

Adds an experiment based on the dataset df to the library. A folder ‘exp_’+name+timestamp is created for the experiment in the library folder. It will hold the dataset and cross-validation masks, as well as sub-folders for each model.

Args:
name (str):
A name for the experiment. Will be used together with the timestamp for storing the experiment.
df (pandas.DataFrame):
The dataset as a Pandas DataFrame.
skf (numpy.ndarray):
An array of indices, each being one cross-validation split.
features (list):
A list of column names that are to be used as features during training.
description (str):
A descriptive string of the dataset, experiment or changes to make finding stuff later easier.
delete(index)

Deletes the experiment at the given index from memory and permanent storage.

Args:
index (int):
Index of the experiment to delete. The index is sorted by name and timestamp.
find(boolean_func)

Iterator function, yielding all experiments matching boolean_func().

Args:
boolean_func (boolean_func()):
A function that takes an Experiment and returns a boolean indicating a match.
findone(boolean_func)

Return the first experiment matching boolean_func().

Args:
boolean_func (boolean_func()):
A function that takes an Experiment and returns a boolean indicating a match.