load_MAREoS

load_MAREoS#

uniharmony.datasets.load_MAREoS(effects: list[str] | str | None = None, effect_types: list[str] | str | None = None, effect_examples: list[str] | str | None = None, as_numpy: bool = True, data_dir: Path | None = None, force_download: bool = False) dict[str, dict[str, DataFrame | ndarray]]#

Load multiple MAREoS datasets.

Parameters:
effectslist of str, str or None, optional (default None)

List of effects to load. If None, loads all [“eos”, “true”]

effect_typeslist of str, str or None, optional (default None)

List of effect types to load. If None, loads all [“simple”, “interaction”]

effect_exampleslist of str, str or None, optional (default None)

List of examples to load. If None, loads all [“1”, “2”].

as_numpybool, optional (default True)

If True, return numpy.ndarray, else pandas.DataFrame.

data_dirPath | None, optional (default None)

Directory containing MAREoS data files. If None, downloads to cache.

force_downloadbool, optional (default False)

Force to download again the dataset in case of corrupt files.

Returns:
dict of str and dict

Nested dictionary where keys are dataset names containing:

  • “X”: Feature matrix

  • “y”: Target labels

  • “sites”: Site labels

  • “covs”: Covariates

  • “folds”: Cross-validation folds

Raises:
ValueError

If any parameter contains invalid values.

Examples

>>> datasets = load_MAREoS()
>>> len(datasets)
8
>>> datasets = load_MAREoS(effects=["eos"], effect_types=["simple"])
>>> len(datasets)
2
>>> list(datasets.keys())
['eos_simple1', 'eos_simple2']

Examples#

Characterise a multisite problem with MAREoS

Characterise a multisite problem with MAREoS

Load MAREoS dataset

Load MAREoS dataset

Using NeuroComBat with MAREoS dataset

Using NeuroComBat with MAREoS dataset

Using ComBatGAM with MAREoS dataset

Using ComBatGAM with MAREoS dataset