qbiocode.data_generation.make_s_curve module#

Generate synthetic 3D S-curve datasets for manifold learning tasks.

This module creates multiple configurations of 3D S-curve datasets with varying sample sizes and noise levels, useful for testing dimensionality reduction and manifold learning algorithms.

Summary#

Functions:

generate_s_curve_datasets

Generate multiple 3D S-curve datasets with varying parameters.

Reference#

generate_s_curve_datasets(n_samples=[100, 120, 140, 160, 180, 200, 220, 240, 260, 280], noise=[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9], save_path=None, random_state=42)[source]#

Generate multiple 3D S-curve datasets with varying parameters.

Creates a series of 3D datasets where samples lie on an S-shaped manifold, a classic benchmark for manifold learning and dimensionality reduction algorithms. Each configuration varies the number of samples and noise level.

Parameters:
  • n_samples (list of int, default=range(100, 300, 20)) – List of sample sizes to generate for each configuration.

  • noise (list of float, default=[0.1, 0.2, ..., 0.9]) – List of noise standard deviations to apply to the data.

  • save_path (str, optional) – Directory path where datasets and configuration files will be saved.

  • random_state (int, default=42) – Random seed for reproducibility.

Returns:

Saves CSV files for each dataset configuration and a JSON file with all configuration parameters.

Return type:

None

Notes

  • Each dataset is saved as ‘s_curve_data-{i}.csv’ where i is the configuration number

  • Configuration parameters are saved in ‘dataset_config.json’

  • The last column ‘class’ contains the position along the manifold (continuous values)

  • S-curve is a standard benchmark for testing manifold learning algorithms

Examples

>>> from qbiocode.data_generation import generate_s_curve_datasets
>>> generate_s_curve_datasets(n_samples=[200], noise=[0.1], save_path='data')
Generating S Curve dataset...