leaspy.datasets¶
Submodules¶
Classes¶
Enum for the names of the datasets available in Leaspy. |
Functions¶
|
Get the path to the dataset file. |
Get the path to the individual parameters file. |
|
|
Get the path to the model parameters file. |
|
Load synthetic longitudinal observations mimicking cohort of subjects with neurodegenerative disorders. |
Load a Leaspy instance with a model already calibrated on the synthetic dataset corresponding to the name |
|
|
Load a model already calibrated on the synthetic dataset corresponding to the name of the instance. |
Package Contents¶
- class DatasetName[source]¶
-
Enum for the names of the datasets available in Leaspy. The names correspond to the files in the data folder.
- ALZHEIMER = 'alzheimer'¶
- PARKINSON = 'parkinson'¶
- PARKINSON_PUTAMEN = 'parkinson-putamen'¶
- PARKINSON_PUTAMEN_TRAIN_TEST = 'parkinson-putamen-train_and_test'¶
- get_dataset_path(name)[source]¶
Get the path to the dataset file.
- Parameters:
- name
strorDatasetName The name of the dataset.
- name
- Returns:
pathlib.PathThe path to the dataset file.
- Parameters:
name (Union[str, DatasetName])
- Return type:
- get_individual_parameter_path(name)[source]¶
Get the path to the individual parameters file.
- Parameters:
- name
strorDatasetName The name of the dataset.
- name
- Returns:
pathlib.PathThe path to the individual parameters file.
- Raises:
ValueErrorIf the dataset does not have individual parameters, such as parkinson-putamen-train_and_test.
- Parameters:
name (Union[str, DatasetName])
- Return type:
- get_model_path(name)[source]¶
Get the path to the model parameters file.
- Parameters:
- name
strorDatasetName The name of the dataset.
- name
- Returns:
pathlib.PathThe path to the model parameters file.
- Raises:
ValueErrorIf the dataset does not have a model, such as parkinson-putamen-train_and_test.
- Parameters:
name (Union[str, DatasetName])
- Return type:
- load_dataset(dataset_name)[source]¶
Load synthetic longitudinal observations mimicking cohort of subjects with neurodegenerative disorders.
- Parameters:
- dataset_name
strorDatasetName The name of the dataset to load.
- dataset_name
- Returns:
pandas.DataFrameThe DataFrame containing the IDs, timepoints and observations.
- Parameters:
dataset_name (Union[str, DatasetName])
- Return type:
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.
- Index: a
Columns: One column correspond to one feature (or score).
- load_individual_parameters(name)[source]¶
Load a Leaspy instance with a model already calibrated on the synthetic dataset corresponding to the name of the instance.
- Parameters:
- name
strorDatasetName The name of the individual parameters to load.
- name
- Returns:
IndividualParametersLeaspy instance with a model already calibrated.
- Parameters:
name (Union[str, DatasetName])
- Return type:
- load_model(name)[source]¶
Load a model already calibrated on the synthetic dataset corresponding to the name of the instance.
- Parameters:
- name
strorDatasetName The name of the instance to load.
- name
- Returns:
BaseModelModel instance already calibrated.
- Parameters:
name (Union[str, DatasetName])
- Return type: