src.data package¶
Submodules¶
src.data.load_data module¶
- src.data.load_data.download_gdrive_folder(fid='1NGfGcVpBarNtFMmdvQhq28hWBlVuxdQz', data_dir='data/')¶
Download all files from a Google Drive folder by ID and store them in a local directory.
- Parameters:
fid (str) – Google Drive folder ID. Defaults to DEFAULT_GDRIVE_FOLDER.
data_dir (str) – Target directory where files will be stored. (default: “data/”).
- Returns:
None
- Return type:
None
- src.data.load_data.load_file(path)¶
Load a numpy file into a Points object.
- Parameters:
path (str) – Path to the .npy file.
- Returns:
A Points object containing the loaded data.
- Return type:
- src.data.load_data.load_gdrive_file(fid, cls, data_dir='data/')¶
Download a file from Google Drive using its file ID, move it into a data directory, and optionally load it into a class.
- Parameters:
fid (str) – Google Drive file ID.
cls (Type[T] | None) – Class to wrap the loaded numpy array in. If None, no class is returned.
data_dir (str) – Target directory where the file will be stored. (default: “data/”).
- Returns:
An instance of cls containing the loaded data, or None if cls is None.
- Return type:
T | None
- src.data.load_data.load_s_curve(n_samples=100, *, noise=0.0, random_state=None)¶
Generate a synthetic S-curve dataset.
- Parameters:
n_samples (int) – Number of samples to generate. (default: 100).
noise (float) – Standard deviation of Gaussian noise added to the data. (default: 0.0).
random_state (int | None) – Seed for reproducibility. (default: None).
- Returns:
A tuple (Points, Coordinates) where Points are the 3D data and Coordinates are the unrolled 1D parameters.
- Return type:
Tuple[Points, Coordinates]
- src.data.load_data.load_swiss_roll(n_samples=100, *, noise=0.0, random_state=None, hole=False)¶
Generate a synthetic Swiss roll dataset.
- Parameters:
n_samples (int) – Number of samples to generate. (default: 100).
noise (float) – Standard deviation of Gaussian noise added to the data. (default: 0.0).
random_state (int | None) – Seed for reproducibility. (default: None).
hole (bool | None) – Whether to generate the Swiss roll with a hole. (default: False).
- Returns:
A tuple (Points, Coordinates) where Points are the 3D data and Coordinates are the unrolled 1D parameters.
- Return type:
Tuple[Points, Coordinates]
Module contents¶
- src.data.download_gdrive_folder(fid='1NGfGcVpBarNtFMmdvQhq28hWBlVuxdQz', data_dir='data/')¶
Download all files from a Google Drive folder by ID and store them in a local directory.
- Parameters:
fid (str) – Google Drive folder ID. Defaults to DEFAULT_GDRIVE_FOLDER.
data_dir (str) – Target directory where files will be stored. (default: “data/”).
- Returns:
None
- Return type:
None
- src.data.load_file(path)¶
Load a numpy file into a Points object.
- Parameters:
path (str) – Path to the .npy file.
- Returns:
A Points object containing the loaded data.
- Return type:
- src.data.load_gdrive_file(fid, cls, data_dir='data/')¶
Download a file from Google Drive using its file ID, move it into a data directory, and optionally load it into a class.
- Parameters:
fid (str) – Google Drive file ID.
cls (Type[T] | None) – Class to wrap the loaded numpy array in. If None, no class is returned.
data_dir (str) – Target directory where the file will be stored. (default: “data/”).
- Returns:
An instance of cls containing the loaded data, or None if cls is None.
- Return type:
T | None
- src.data.load_s_curve(n_samples=100, *, noise=0.0, random_state=None)¶
Generate a synthetic S-curve dataset.
- Parameters:
n_samples (int) – Number of samples to generate. (default: 100).
noise (float) – Standard deviation of Gaussian noise added to the data. (default: 0.0).
random_state (int | None) – Seed for reproducibility. (default: None).
- Returns:
A tuple (Points, Coordinates) where Points are the 3D data and Coordinates are the unrolled 1D parameters.
- Return type:
Tuple[Points, Coordinates]
- src.data.load_swiss_roll(n_samples=100, *, noise=0.0, random_state=None, hole=False)¶
Generate a synthetic Swiss roll dataset.
- Parameters:
n_samples (int) – Number of samples to generate. (default: 100).
noise (float) – Standard deviation of Gaussian noise added to the data. (default: 0.0).
random_state (int | None) – Seed for reproducibility. (default: None).
hole (bool | None) – Whether to generate the Swiss roll with a hole. (default: False).
- Returns:
A tuple (Points, Coordinates) where Points are the 3D data and Coordinates are the unrolled 1D parameters.
- Return type:
Tuple[Points, Coordinates]