koaning/scikit-lego

Extra blocks for scikit-learn pipelines.

What it solves

It provides a collection of custom transformers, metrics, and models that are not available in the standard scikit-learn library, reducing the need for developers to write their own repetitive custom components for machine learning pipelines.

How it works

It acts as a companion library to scikit-learn, strictly adhering to its standards. Users can import scikit-lego components (such as GMMClassifier or RandomAdder) and integrate them directly into scikit-learn Pipeline objects alongside standard scikit-learn tools.

Who it’s for

Data scientists and machine learning engineers who use scikit-learn and need specialized preprocessing tools, fairness-constrained classifiers, or specific regression and mixture models.

Highlights

  • Custom Transformers: Includes tools for column selection, outlier removal, and adding randomness during training.
  • Specialized Models: Offers various regression types (Quantile, LAD, Lowess) and GMM-based classifiers.
  • Fairness Tools: Includes classifiers constrained on demographic parity and equal opportunity, along with corresponding fairness metrics.
  • Pipeline Utilities: Provides a DebugPipeline for easier debugging and time-series specific splitting methods like TimeGapSplit.

Related

  • Project
  • Project
  • Project
  • Project
  • Project