Skip to main content

Machine learning experiment manager and leakage detection toolkit

Project description

MLGuard

Python License Status

MLGuard is a lightweight machine learning experiment management and data validation toolkit designed to help detect potential data leakage and benchmark multiple models quickly.


๐Ÿš€ Features

  • ๐Ÿ” Data Leakage Detection Detects potential target leakage by analyzing correlations between features and the target.

  • โš™๏ธ Experiment Manager Automatically runs multiple ML models and evaluates them.

  • ๐Ÿ“Š Model Comparison Compare model performance using appropriate metrics.

  • ๐Ÿง  Automatic Problem Detection Detects whether the task is regression or classification.


๐Ÿ“ฆ Installation

pip install mlguard

or install locally:

pip install -e .

โšก Quick Example

Regression Example

from sklearn.datasets import fetch_california_housing
from mlguard.experiments import ExperimentManager

data = fetch_california_housing(as_frame=True)

X = data.data
y = data.target

exp = ExperimentManager()

exp.fit(X, y)

print(exp.compare())

Example output:

Running leakage detection...
No leakage detected

Detected problem type: regression

[('rf', 0.50), ('ridge', 0.74)]

Classification Example

from sklearn.datasets import load_iris
from mlguard.experiments import ExperimentManager

data = load_iris(as_frame=True)

X = data.data
y = data.target

exp = ExperimentManager()

exp.fit(X, y)

print(exp.compare())

๐Ÿ— Project Structure

mlguard/
โ”‚
โ”œโ”€โ”€ experiments
โ”‚   โ””โ”€โ”€ experiment_manager.py
โ”‚
โ”œโ”€โ”€ inspection
โ”‚   โ””โ”€โ”€ leakage_detector.py
โ”‚
โ”œโ”€โ”€ metrics
โ”‚   โ”œโ”€โ”€ regression_metrics.py
โ”‚   โ””โ”€โ”€ classification_metrics.py
โ”‚
โ”œโ”€โ”€ utils
โ”‚   โ””โ”€โ”€ problem_type.py
โ”‚
โ”œโ”€โ”€ examples
โ”œโ”€โ”€ tests

๐Ÿง  How MLGuard Works

MLGuard runs a lightweight validation and experimentation pipeline:

Dataset
   โ†“
Leakage Detection
   โ†“
Problem Type Detection
   โ†“
Model Experiments
   โ†“
Model Evaluation
   โ†“
Model Comparison

This helps ML practitioners quickly answer:

Which model works best for my dataset?


๐Ÿ›ฃ Roadmap

Planned improvements:

  • Cross-validation experiment engine
  • Dataset inspector
  • Automatic preprocessing pipelines
  • Feature validation tools
  • Experiment tracking

๐Ÿค Contributing

Contributions are welcome!

  1. Fork the repository
  2. Create a new branch
  3. Submit a pull request

๐Ÿ“œ License

MIT License ยฉ 2026 Tarun

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

mlguardlabs-0.1.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

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

mlguardlabs-0.1.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file mlguardlabs-0.1.0.tar.gz.

File metadata

  • Download URL: mlguardlabs-0.1.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for mlguardlabs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bfbbf39fb99767fae13419a27f75e8365ef5b8faf78eedb53a72a54c2c1a23a9
MD5 3fa6b58d96dad1048e4f32b2312502f5
BLAKE2b-256 54da7403009504c4e31e62f3969e176ec0ba1930425b24cb23f4111c94052030

See more details on using hashes here.

File details

Details for the file mlguardlabs-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mlguardlabs-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for mlguardlabs-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fe0773c270f8fc0c23be0f16bc905e54ee17bc686854cad71755f98f6ff62a8a
MD5 ea4fccc6aa49693a717bb3103ba42b82
BLAKE2b-256 94ffac84b95586b4b821788e6511e44730a0070ec3059d2bad6577585a048650

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