Skip to content

Releases: EttoreRocchi/combatlearn

v2.0.0

07 Apr 18:26

Choose a tag to compare

Added

  • combatlearn.inspection module: standalone feature_batch_diagnostics() and summary() functions for inspecting fitted ComBat models.
  • Weighted RMS in feature_batch_diagnostics(): new weighted parameter (default True) weights batch contributions by sample size for more representative importance scores.
  • Lazy imports in combatlearn.visualization: matplotlib, plotly, seaborn, umap, and sklearn reducers are imported at function call time, not at module import.

Changed

  • Architecture refactor: composition over mixins. ComBatMetricsMixin and ComBatVisualizationMixin removed. All metrics, inspection, and visualization functions are now standalone, accepting a fitted ComBat instance as first argument.
  • ComBat class retains only sklearn-standard methods: fit, transform, fit_transform, get_feature_names_out, set_params, get_params.
  • feature_batch_importance() renamed to feature_batch_diagnostics() and moved to combatlearn.inspection.
  • compute_batch_metrics() moved to combatlearn.metrics as a standalone function: compute_batch_metrics(combat, X, ...).
  • summary() moved to combatlearn.inspection as a standalone function: summary(combat).
  • Visualization functions moved to combatlearn.visualization as standalone functions: plot_transformation(combat, X, ...), plot_feature_diagnostics(combat, ...), plot_batch_effect_heatmap(combat, ...).

Removed

  • compute_metrics parameter from ComBat.__init__().
  • metrics_ caching property from ComBat.
  • ComBatMetricsMixin class.
  • ComBatVisualizationMixin class.

Migration

v1.x v2.0
cb.compute_batch_metrics(X) compute_batch_metrics(cb, X)
cb.feature_batch_importance() feature_batch_diagnostics(cb)
cb.summary() summary(cb)
cb.plot_transformation(X) plot_transformation(cb, X)
cb.plot_feature_diagnostics() plot_feature_diagnostics(cb)
cb.plot_batch_effect_heatmap() plot_batch_effect_heatmap(cb)
ComBat(batch, compute_metrics=True) metrics = compute_batch_metrics(cb, X)
cb.metrics_ metrics = compute_batch_metrics(cb, X)

v1.4.0

03 Apr 18:09

Choose a tag to compare

Added

  • Diagnostics table in summary() (batch variance explained, condition number, convergence info)
  • Input validation warnings (near-zero variance, imbalanced batches, collinearity)
  • py.typed marker and mypy strict compliance
  • FAQ docs

v1.3.0

20 Mar 14:37

Choose a tag to compare

Added

  • nn_algorithm parameter for nearest-neighbor metrics (kBET, LISI, kNN preservation)
  • Input validation on fit() and transform() (NaN/Inf checks on X, batch, covariates)
  • summary() method for fitted model overview
  • plot_batch_effect_heatmap() via seaborn
  • get_feature_names_out() for set_output(transform='pandas') pipeline support
  • seaborn>=0.12 dependency

Bug Fixes

  • hasattr guard on _model before checking _gamma_star in metrics and feature importance

Docs

  • Rendered demo notebook in Sphinx

Chores

  • examples/ directory (switched entirely to demo notebook)

v1.2.0

06 Feb 12:05

Choose a tag to compare

Features

  • Added feature_batch_importance() for ranking features by location shift (gamma) and scale shift (delta)
  • Added plot_feature_importance() for visualizing per-feature batch effect magnitudes

Refactor

  • Reorganized package into modules (core, metrics, visualization, sklearn_api) for clarity but no public API changes

v1.1.2

16 Jan 10:59

Choose a tag to compare

Fixed a bug in the chen method (CovBat) where PCA centering was handled inconsistently between fit and transform operations

v1.1.1

15 Jan 17:33

Choose a tag to compare

  • Migrated docs to Sphinx
  • Added ruff linting to CI

v1.1.0

08 Jan 17:04

Choose a tag to compare

Quantitative Batch Effect Assessment

New compute_batch_metrics() method for evaluating batch correction quality.

Metrics included:

  • Batch effect: Silhouette, Davies-Bouldin, kBET, LISI, variance ratio
  • Structure preservation: k-NN preservation, distance correlation
  • Alignment: Centroid distance, Levene statistic

See Metrics Guide for more details

v1.0.0

20 Nov 16:11

Choose a tag to compare

  • Improve packaging: separate dev dependencies, dynamic versioning, fixing imports
  • Complete MkDocs documentation setup
  • Fix all deprecation warnings and expand test coverage

Full documentation is available at combatlearn.readthedocs.io, check it out!

v0.2.2

22 Jul 08:06

Choose a tag to compare

Ensure color consistency for batch labels in all ComBat().plot_transformation() plots for 'interactive' mode.

v0.2.1

21 Jul 10:37

Choose a tag to compare

Minor fix for the new feature (the plot_transformation method).