Skip to main content

A transparent machine learning framework focused on explainability and diagnostics.

Project description

GlassBoxML

Machine Learning you can actually see.

Python Tests License

Overview

GlassBoxML is a theory-first machine learning library built from scratch using pure NumPy.

Unlike traditional libraries that prioritize abstraction and convenience, GlassBoxML emphasizes transparency and understanding. Every model exposes:

what it learns how it learns where it fails

This project bridges the gap between mathematical learning theory and practical implementation.

Philosophy

Most ML libraries behave like black boxes:

model.fit(X, y)
# magic happens

GlassBoxML is different:

model.fit(X, y)

model.loss_history
model.gradients
model.assumptions
model.failure_modes
model.generalization_estimate

You don’t just train models — you inspect learning itself.

Goals Implement core ML algorithms from first principles Expose optimization behavior during training Make model assumptions explicit Demonstrate overfitting and generalization Provide educational transparency without sacrificing code quality Non-Goals Competing with high-performance libraries like scikit-learn GPU acceleration Massive algorithm coverage Production deployment pipelines

This is a learning and reasoning library, not a benchmarking tool.


Implemented / Planned Algorithms

Core Models

  • Linear Regression
  • Logistic Regression
  • k‑Nearest Neighbors
  • Ridge Regression
  • Decision Trees
  • Random Forest
  • SVM

Optimization

  • Batch Gradient Descent
  • Stochastic Gradient Descent
  • Momentum

Diagnostics

  • Loss curves
  • Bias–variance indicators
  • Overfitting detection
  • Condition number warnings

Theory Tools

  • Generalization estimates
  • Capacity indicators
  • Noise sensitivity analysis

Example

from glassboxml import LinearRegression

model = LinearRegression()
model.fit(X, y)

print(model.loss_history)
print(model.explain())
print(model.diagnose()) # basic model insights (expanded in future versions)
---

Project Structure

glassboxml/
│
├── core/          # optimizers, model selection, base classes
├── models/        # ML algorithms
├── diagnostics/   # overfitting & model insights
├── datasets/      # synthetic data generators
├── metrics/       # evaluation metrics
├── preprocessing/ # scaling and transformations
├── tuning/        # hyperparameter search
└── examples/      # demos & experiments

Installation

git clone https://github.com/hogwarts-coder10/GlassBox-ML.git
cd GlassBox-ML
pip install -r requirements.txt

Dependencies are intentionally minimal:

  • numpy
  • matplotlib

Why This Project Exists

Modern ML education often teaches usage before understanding.

This creates developers who can:

train models ❌ but not explain, debug, or trust them ❌

GlassBoxML reverses that:

Understand → Implement → Experiment → Trust


Contributing

This project values clarity over cleverness.

Contributions should:

Prefer readable, math-aligned code Include explanation comments Demonstrate failure cases, not just success


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

glassboxml-0.1.2.tar.gz (42.0 kB view details)

Uploaded Source

Built Distribution

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

glassboxml-0.1.2-py3-none-any.whl (53.0 kB view details)

Uploaded Python 3

File details

Details for the file glassboxml-0.1.2.tar.gz.

File metadata

  • Download URL: glassboxml-0.1.2.tar.gz
  • Upload date:
  • Size: 42.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for glassboxml-0.1.2.tar.gz
Algorithm Hash digest
SHA256 50bfea8a168e717fd0ab6e5acbe4f65410fbdc1e1d9f283fffa91e85b08a8f6b
MD5 514f2fc8c24a695bc2d539ecb938283c
BLAKE2b-256 169b5c9c84cd90af11eb389ed121108e4f958e22ab429e6b2686188010871b18

See more details on using hashes here.

File details

Details for the file glassboxml-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: glassboxml-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 53.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for glassboxml-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 38873aa5f3c5dd36cdc77881956454f41785b1b7b9a0e86038f5e7520c2bd274
MD5 52ac2393d08a2a26e324b520c7a0b52d
BLAKE2b-256 542ffca509ab77c16a59bf08faa360727d7de8e7a8f5071c3bc365e586abc3a4

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