Code Documentation

This section provides a complete overview of the internal modules of biomedical-data-generator. It is intended for developers, contributors, and advanced users who want to understand or extend the code base.

The API documentation is automatically generated using Sphinx autodoc and autosummary. Each module listed below expands into a separate page in the _autosummary directory.

Configuration Models

These classes define the full dataset configuration, including class structure, correlated clusters, noise distribution, and optional batch effects.

biomedical_data_generator.config.ClassConfig

Configuration for a single class in the dataset.

biomedical_data_generator.config.BatchEffectsConfig

Configuration for simulating batch effects.

biomedical_data_generator.config.CorrClusterConfig

A correlated block with optional, independent mean and covariance channels.

biomedical_data_generator.config.DatasetConfig

Configuration for synthetic dataset generation.

Cluster signal channels

A correlated cluster carries class-discriminating signal only through its optional channels. The mean channel encodes a first-moment (per-class mean shift on the anchor); the covariance channel encodes a second-moment (per-class within-cluster correlation, i.e. differential co-expression). Both are resolved per class by CorrClusterConfig, falling back to a baseline when a class is absent.

biomedical_data_generator.config.MeanChannel

First-moment signal: a per-class mean shift applied to the cluster anchor.

biomedical_data_generator.config.CovarianceChannel

Second-moment signal: a per-class within-cluster correlation.

Standalone informative groups

Groups of cluster-free informative features that share one separation strength. A list of groups with decreasing class_sep realizes a signal-strength gradient across the standalone-informative block.

biomedical_data_generator.config.StandaloneInformativeGroup

A group of standalone informative features sharing one separation strength.

Dataset Generator

The central entry point for creating synthetic datasets.

biomedical_data_generator.generate_dataset

Generate synthetic biomedical dataset with specified feature structure.

Feature Generators

Functions responsible for generating informative features, noise features, and correlated feature clusters.

Informative features

biomedical_data_generator.features.informative

Generation of standalone informative features and class separation.

Correlated feature clusters

biomedical_data_generator.features.correlated

Generation of correlated feature clusters simulating pathway-like modules.

Independent noise features

Independent noise features are not produced by a dedicated module. They are sampled directly in biomedical_data_generator.generate_dataset() using biomedical_data_generator.utils.sampling.sample_distribution().

Batch Effects

Simulation of site effects, instrument variation, temporal drift, and confounding with class labels.

biomedical_data_generator.effects.batch

Batch effect simulation for synthetic biomedical datasets.

Metadata

Structured metadata describing the full generative process, including feature roles, class labels, correlated clusters, batch labels, and derived dataset properties.

biomedical_data_generator.meta.DatasetMeta

Metadata about the generated dataset.

biomedical_data_generator.meta.FeatureRoles

Generative feature roles derived from a DatasetMeta.

biomedical_data_generator.meta.compute_feature_roles

Derive the six-way generative feature-role partition from a DatasetMeta.

Per-feature signal strengths

Derived, per-column assessment of how strongly each feature separates the classes. compute_feature_strengths() reads a DatasetMeta record and returns a FeatureStrengths summary.

biomedical_data_generator.meta.FeatureStrengths

Derived per-feature signal-strength annotation.

biomedical_data_generator.meta.compute_feature_strengths

Derive per-feature signal strengths from a DatasetMeta.

Utility Modules (Optional)

Helper functions for data manipulation, visualization, and integration with scikit-learn.

biomedical_data_generator.utils.correlation_tools

Correlation analysis and seed search utilities (no plotting).

biomedical_data_generator.utils.export_utils

Export utilities for saving generated datasets to various formats.

biomedical_data_generator.utils.sampling

Utility functions for sampling from distributions.

biomedical_data_generator.utils.visualization

Plot utilities for correlation analysis.

biomedical_data_generator.utils.sklearn_compat

Sklearn-like convenience wrapper around biomedical-data-generator.