pcntoolkit.dataio.data_factory#
Attributes#
Functions#
Download an example correlation matrix and return the path to its CSV. |
|
|
Download and save fcon dataset to specified path, or load it from there |
|
Load the lifespan_big dataset, which is a large lifespan dataset with many sites. |
|
Download and save the LNM longitudinal dataset, or load it from disk. |
Module Contents#
- fetch_example_correlation_matrix(save_path: str | None = None) str#
Download an example correlation matrix and return the path to its CSV.
- Parameters:
save_path (
str | None) – Folder to save the matrix to. Defaults topcntoolkit_resources/data/correlation_matrix.- Returns:
Path to the CSV, named
<response_var>.csvasCorrelationMatrix.loadexpects.- Return type:
- load_fcon1000(save_path: str | None = None)#
Download and save fcon dataset to specified path, or load it from there if it is already downloaded
- Parameters:
save_path (
str | None) – The path to save the dataset to, or load it from if it is already downloaded- Returns:
The loaded dataset as a NormData object
- Return type:
NormData
- load_lifespan_big(n_response_vars: int | None = None, n_largest_sites: int | None = None, n_subjects: int | None = None) pcntoolkit.dataio.norm_data.NormData#
Load the lifespan_big dataset, which is a large lifespan dataset with many sites.
- Parameters:
n_response_vars (
int | None) – If specified, only use the first n_response_vars response variables.n_largest_sites (
int | None) – If specified, only keep data from the n_largest_sites largest sites.n_subjects (
int | None) – If specified, randomly sample n_subjects subjects.
- Returns:
The loaded dataset as a NormData object.
- Return type:
NormData
- load_lnm(save_path: str | None = None, group: Literal['control', 'patient'] | None = None) pcntoolkit.dataio.norm_data.NormData#
Download and save the LNM longitudinal dataset, or load it from disk.
The dataset has two visits per subject (controls and patients).
- Parameters:
save_path (
str | None) – Folder to save or loadLNM_data.csvfrom. Defaults topcntoolkit_resources/data.group (
{"control", "patient"}| None) – Keep only the subjects of this group. Defaults toNone, which keeps everyone.
- Returns:
Longitudinal dataset with
visits="visit".- Return type:
NormData- Raises:
ValueError – If
groupis not"control","patient"orNone.
- CORRELATION_MATRIX_RESPONSE_VAR = 'rh_G_front_middle_thickness'#
- CORRELATION_MATRIX_URL = 'https://raw.githubusercontent.com/CharFraza/CPC_ML_tutorial/master/data/cmat_rh_G_front_middle_t...#