qbiocode.data_generation.make_spirals module#

Generate synthetic n-dimensional spiral datasets for multi-class classification.

This module creates multiple configurations of high-dimensional spiral datasets with varying sample sizes, noise levels, and dimensionality, useful for testing machine learning algorithms on complex non-linearly separable patterns.

Summary#

Functions:

make_spirals

Generate an n-dimensional dataset of intertwined spirals.

Reference#

make_spirals(n_samples=5000, n_classes=2, noise=0.3, dim=3)[source]#

Generate an n-dimensional dataset of intertwined spirals.

Creates spiral patterns in n-dimensional space where each class forms a distinct spiral arm. Supports dimensions 3, 6, 9, and 12.

Parameters:
  • n_samples (int, default=5000) – Total number of samples to generate.

  • n_classes (int, default=2) – Number of spiral arms (classes).

  • noise (float, default=0.3) – Standard deviation of Gaussian noise added to each dimension.

  • dim (int, default=3) – Dimensionality of the output space (must be 3, 6, 9, or 12).

Returns:

  • X (ndarray of shape (n_samples, dim)) – Generated spiral data points.

  • y (ndarray of shape (n_samples,)) – Class labels for each sample.