Skip to content

About

Reproducible ML evaluation, calibration, validation, and inference benchmarks.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

ML Eval Forge

Reproducible machine-learning engineering tasks for training, inference, calibration, and verification.

ML Eval Forge is a small, dependency-light evaluation lab built around synthetic multispectral-style data. It is designed to make the engineering contract visible: the data split is fingerprinted, the model is trained deterministically, calibration uses validation data only, metrics are computed from held-out predictions, and a validator checks the run before its report is accepted.

Why this repository exists

Many ML failures are not caused by a missing model layer. They come from data leakage, non-reproducible splits, invalid probabilities, calibration fitted on the test set, silent numerical errors, or performance claims without a measurement protocol. This repository turns those failure modes into executable checks.

Included projects

1. Calibrated classification task

ml-eval-forge run generates a deterministic binary classification dataset, fits a regularized logistic model with NumPy, fits a scalar temperature on validation logits, evaluates the untouched test split, and writes machine-readable evidence.

The report includes accuracy, precision, recall, F1, log loss, Brier score, expected calibration error, and a deterministic bootstrap interval for accuracy.

2. Inference parity and performance lab

ml-eval-forge benchmark compares vectorized batch inference with a deliberately simple row-wise reference implementation. It fails if outputs disagree beyond the configured tolerance and records latency, speedup, and maximum absolute error as JSON.

Engineering signals

  • Deterministic NumPy data generation and seeded optimization.
  • Train/validation/test ownership checks and dataset fingerprinting.
  • Validation-only temperature calibration; test data is not used for fitting.
  • Read-only replay validation of model weights, normalization, predictions, metrics, split identity, and all recorded losses.
  • Strict JSON parsing, finite-value checks, and numerical-parity contracts.
  • Reproducible JSON artifacts suitable for review or downstream automation.
  • Unit tests covering repeatability, metric behaviour, calibration, and rejection paths.
  • GitHub Actions CI on a clean Python environment.
  • No hosted model, private data, or GPU required.

Quick start

python -m venv .venv
# Linux/macOS: source .venv/bin/activate
# Windows PowerShell: .venv\Scripts\Activate.ps1
python -m pip install -e .

python -m ml_eval_forge run --output results/latest
python -m ml_eval_forge benchmark --output results/latest/benchmark.json
python -m ml_eval_forge validate --run results/latest
python -m unittest discover -s tests -v

The only runtime dependency is NumPy. The commands are intentionally explicit so that a reviewer can reproduce the evidence from a fresh checkout.

Example evidence

The committed files under results/latest/ are generated by the commands above. Values are measurements from the included synthetic workload, not claims about a production dataset.

test accuracy:       0.7771
test F1:             0.7775
test ECE:            0.0597 raw / 0.0418 calibrated
parity max error:    <= 1e-12

Calibration is fitted on the validation split only. The fixed seed is retained without searching for a flattering result. These artifacts were regenerated on Python 3.12 / NumPy 2.5.5 after correcting loss-history accounting; see environment metadata. The regenerated dataset fingerprint differs from the earlier committed report; that earlier environment was not recorded, so its exact cause is unverified. The loss-history correction does not change dataset generation or optimizer updates. Earlier artifacts remain available in Git history. Run the benchmark on your machine before comparing latency. Hardware, BLAS, Python, and NumPy versions affect the result.

What validation proves

validate parses all four artifacts (data_manifest.json, model.json, metrics.json, and training_history.json) and replays the fixed experiment from its declared seed. It rejects missing or extra fields, ambiguous JSON, altered split fingerprints, inconsistent model parameters, probabilities, calibration, metrics, bootstrap intervals, and loss history. Floating-point comparisons use rtol=1e-9, atol=1e-10; discrete values and fingerprints must match exactly. It reads existing artifacts without overwriting them and exits nonzero on failure.

Replay includes training, so it costs more than a schema check. Use the same numerical environment as the producer: RNG or BLAS differences can change byte fingerprints. For the published run, install requirements-reproduce.txt with Python 3.12, then generate and validate a fresh output directory on your machine. This is a consistency check of this fixed synthetic workflow, not an independent implementation, proof of authorship, or a validator for arbitrary models. Benchmark and environment metadata are separate reports and are not among the four replayed artifacts.

The debugging case study records the original false pass, the fix at the experiment boundary, negative controls, and the numerical loss-reporting correction. CI generates and validates its own fresh run on each tested Python version.

Layout

src/ml_eval_forge/
  data.py          deterministic data and split fingerprints
  model.py         regularized logistic model and stable loss functions
  metrics.py       classification and calibration metrics
  harness.py       experiment orchestration and validation contract
  benchmark.py     reference-vs-vectorized inference measurement
  cli.py           reproducible command-line interface
tests/             deterministic regression and failure-path tests
results/latest/    small JSON artifacts from the included workload

Limitations

The dataset is synthetic and the model is intentionally small. This repository demonstrates evaluation and systems discipline; it does not claim domain accuracy on satellite imagery, production serving throughput, or GPU performance. For large-image inference and spatial parity, see tileflow-inference. For a real-image training and calibration workflow, see geovision-bench.

License

Free noncommercial use; commercial use requires prior written permission and a separate agreement with an agreed fee. See LICENSE.

Commercial permission

Original material in this repository is available under the Noncommercial Use and Commercial Permission License. Noncommercial use is free. Commercial use requires prior written permission and a separate written agreement specifying the scope and agreed fee. Contact [email protected] with the repository name and intended use.

Portfolio review and recruitment evaluation are permitted without a fee. Third-party components retain their own licenses. Permissions already granted for earlier versions remain valid; the new terms do not revoke those grants. These are custom source-available terms, not an OSI-approved open-source license.

About

Reproducible ML evaluation, calibration, validation, and inference benchmarks.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages