leaspy.datasets.loader ====================== .. py:module:: leaspy.datasets.loader Classes ------- .. autoapisummary:: leaspy.datasets.loader.DatasetName Functions --------- .. autoapisummary:: leaspy.datasets.loader.get_dataset_path leaspy.datasets.loader.get_individual_parameter_path leaspy.datasets.loader.get_model_path leaspy.datasets.loader.load_dataset leaspy.datasets.loader.load_individual_parameters leaspy.datasets.loader.load_model Module Contents --------------- .. py:class:: DatasetName Bases: :py:obj:`str`, :py:obj:`enum.Enum` Enum for the names of the datasets available in Leaspy. The names correspond to the files in the `data` folder. .. !! processed by numpydoc !! .. py:attribute:: ALZHEIMER :value: 'alzheimer' .. py:attribute:: PARKINSON :value: 'parkinson' .. py:attribute:: PARKINSON_PUTAMEN :value: 'parkinson-putamen' .. py:attribute:: PARKINSON_PUTAMEN_TRAIN_TEST :value: 'parkinson-putamen-train_and_test' .. py:function:: get_dataset_path(name) Get the path to the dataset file. :Parameters: **name** : :obj:`str` or :class:`~leaspy.datasets.loader.DatasetName` The name of the dataset. :Returns: :obj:`pathlib.Path` The path to the dataset file. .. !! processed by numpydoc !! .. py:function:: get_individual_parameter_path(name) Get the path to the individual parameters file. :Parameters: **name** : :obj:`str` or :class:`~leaspy.datasets.loader.DatasetName` The name of the dataset. :Returns: :obj:`pathlib.Path` The path to the individual parameters file. :Raises: :exc:`ValueError` If the dataset does not have individual parameters, such as `parkinson-putamen-train_and_test`. .. !! processed by numpydoc !! .. py:function:: get_model_path(name) Get the path to the model parameters file. :Parameters: **name** : :obj:`str` or :class:`~leaspy.datasets.loader.DatasetName` The name of the dataset. :Returns: :obj:`pathlib.Path` The path to the model parameters file. :Raises: :exc:`ValueError` If the dataset does not have a model, such as `parkinson-putamen-train_and_test`. .. !! processed by numpydoc !! .. py:function:: load_dataset(dataset_name) Load synthetic longitudinal observations mimicking cohort of subjects with neurodegenerative disorders. :Parameters: **dataset_name** : :obj:`str` or :class:`DatasetName` The name of the dataset to load. :Returns: :obj:`pandas.DataFrame` The DataFrame containing the IDs, timepoints and observations. .. rubric:: Notes All `DataFrames` have the same structures. * Index: a :class:`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). .. !! processed by numpydoc !! .. py:function:: 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: **name** : :obj:`str` or :class:`~leaspy.datasets.loader.DatasetName` The name of the individual parameters to load. :Returns: :class:`~leaspy.io.outputs.IndividualParameters` Leaspy instance with a model already calibrated. .. !! processed by numpydoc !! .. py:function:: load_model(name) Load a model already calibrated on the synthetic dataset corresponding to the name of the instance. :Parameters: **name** : :obj:`str` or :class:`~leaspy.datasets.loader.DatasetName` The name of the instance to load. :Returns: :class:`~leaspy.models.BaseModel` Model instance already calibrated. .. !! processed by numpydoc !!