Skip to main content

A glass-box machine learning toolbox for interpretable pipelines

Project description

Machine Learning Toolbox

This repository provides a collection of modular, production-ready tools for building, evaluating, and interpreting machine learning models. Each tool is built with a focus on clean design, extensibility, and practical utility.


Philosophy: Explainable, Transparent, Glass-Box ML

Unlike traditional AutoML tools that act as "black boxes", this toolbox is designed to be a glass box — every decision, transformation, and output is fully transparent and controllable.

This toolbox is ideal for:

  • Data scientists who value interpretable models
  • Regulated industries requiring auditability
  • Educators and learners exploring machine learning foundations
  • Teams that prioritize trust and understanding over automation

We emphasize explainability through SHAP, feature importances, coefficients, and detailed diagnostics at every stage.


Contents

Module Description
DataExplorer.py Exploratory Data Analysis (EDA) and VIF calculation
ML_pipeline.py Full preprocessing + modeling pipeline with cross-validation & diagnostics
ModelInterpreter.py SHAP, feature importance, and coefficient visualizations

Module Overviews

DataExplorer.py

A lightweight class for quick exploratory analysis:

  • Displays dataset shape, dtypes, and missing values
  • Plots target distribution (auto-detects regression vs classification)
  • Correlation heatmap and Variance Inflation Factor (VIF)
  • Returns median-imputed numeric-only DataFrame for diagnostics

ML_pipeline.py

A complete scikit-learn-based pipeline manager:

  • Auto-detects numerical and categorical columns
  • Builds preprocessing pipeline (scaling, imputation, encoding)
  • Supports both regression and classification
  • Cross-validation with metrics, ROC, F1-thresholds, and confusion matrix
  • Built-in visualizations for:
    • Predicted vs. Actual
    • Residual plots
    • Error distribution
    • ROC curve and F1-threshold optimization

ModelInterpreter.py

Interpret model behavior post-training:

  • Works with pipelines and standalone models
  • Tree-based models: Feature importances
  • Linear models: Coefficients (with optional plot)
  • Universal SHAP summary plot (auto-handles pipelines)

Getting Started

Each module can be used independently. Example usage:

from ML_pipeline import MLPipeline
pipeline = MLPipeline()
X_train, X_test, y_train, y_test = pipeline.split_data(df, 'target')
pipeline.fit(X_train, y_train)
pipeline.plot_roc_curve(X_test, y_test)

Or for model interpretation:

from ModelInterpreter import ModelInterpreter
interpreter = ModelInterpreter(model, X_train, task='classification')
interpreter.shap_summary()

Requirements

  • scikit-learn
  • pandas, numpy
  • matplotlib, seaborn
  • shap
  • statsmodels (for VIF)

Notes

  • SHAP is optimized for tree-based models; linear models are also supported
  • Pipelines handle preprocessing internally—no need to do it manually
  • Modules follow sklearn conventions for compatibility and ease of use

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

glazzbocks-0.1.4.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

glazzbocks-0.1.4-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file glazzbocks-0.1.4.tar.gz.

File metadata

  • Download URL: glazzbocks-0.1.4.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for glazzbocks-0.1.4.tar.gz
Algorithm Hash digest
SHA256 7e808b35749562d0b29f92df615dc2efcb36831a19b1548b47020420e40b6ca8
MD5 5410061d062f0df1834f3e9c3e165efa
BLAKE2b-256 84400088e56d165c17246a10de18ebc61a5de3ba54a28f73ae2c3b61224f643a

See more details on using hashes here.

File details

Details for the file glazzbocks-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: glazzbocks-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for glazzbocks-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2e9ad964f2d331877780c3c2dd33c6a71d27b81697f53ae34ca1198dbb3515f4
MD5 85929f3914dbb77c140448cfb38470ce
BLAKE2b-256 2ba904f48b4617ced23ec481ee3a63edce562d167d50d8b758adfefb6261637a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page