leaspy.datasets.loader

Classes

DatasetName

str(object='') -> str

Functions

get_dataset_path(name)

get_individual_parameter_path(name)

get_model_path(name)

load_dataset(dataset_name)

Load synthetic longitudinal observations mimicking cohort of subjects with neurodegenerative disorders.

load_individual_parameters(name)

Load a Leaspy instance with a model already calibrated on the synthetic dataset corresponding to the name

load_leaspy_instance(name)

Load a Leaspy instance with a model already calibrated on the synthetic dataset corresponding to the name

Module Contents

class DatasetName

Bases: str, enum.Enum

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

ALZHEIMER = 'alzheimer'
PARKINSON = 'parkinson'
PARKINSON_PUTAMEN = 'parkinson-putamen'
PARKINSON_PUTAMEN_TRAIN_TEST = 'parkinson-putamen-train_and_test'
get_dataset_path(name)
Parameters:

name (Union[str, DatasetName])

Return type:

Path

get_individual_parameter_path(name)
Parameters:

name (Union[str, DatasetName])

Return type:

Path

get_model_path(name)
Parameters:

name (Union[str, DatasetName])

Return type:

Path

load_dataset(dataset_name)

Load synthetic longitudinal observations mimicking cohort of subjects with neurodegenerative disorders.

Parameters:
dataset_namestr or DatasetName

The name of the dataset to load.

Returns:
pandas.DataFrame

The DataFrame containing the IDs, timepoints and observations.

Parameters:

dataset_name (Union[str, DatasetName])

Return type:

DataFrame

Notes

All DataFrames have the same structures.

  • Index: a pandas.MultiIndex - ['ID', 'TIME'] which contain IDs and timepoints.

    The DataFrame is sorted by index. So, one line corresponds to one visit for one subject. The DataFrame having ‘train_and_test’ in their name also have 'SPLIT' as the third index level. It differentiate train and test data.

  • Columns: One column correspond to one feature (or score).

load_individual_parameters(name)

Load a Leaspy instance with a model already calibrated on the synthetic dataset corresponding to the name of the instance.

Parameters:
namestr or IndividualParameterName

The name of the individual parameters to load.

Returns:
IndividualParameters

Leaspy instance with a model already calibrated.

Parameters:

name (Union[str, DatasetName])

Return type:

IndividualParameters

load_leaspy_instance(name)

Load a Leaspy instance with a model already calibrated on the synthetic dataset corresponding to the name of the instance.

Parameters:
namestr or DatasetName

The name of the instance to load.

Returns:
Leaspy

Leaspy instance with a model already calibrated.

Parameters:

name (Union[str, DatasetName])

Return type:

Leaspy