ml-assert

maintained

A lightweight, chainable assertion toolkit for validating data and models in ML workflows.

Python scikit-learn pandas pytest

ml-assert is a Python library that provides a fluent, expressive API to act as a guardrail in your automated ML pipelines.

The Problem

Standard metrics libraries just calculate scores. When an accuracy drops to 75%, the pipeline continues, propagating bad models.

The Solution

ml-assert asserts that accuracy must be >= 80%. If it’s 75%, it raises an AssertionError, halting execution. This is a paradigm shift from passive calculation to active assertion for robust ML Ops.

Features

  • DataFrame Assertions
  • Statistical Drift Detection
  • Model Performance Assertions
  • Extensible Plugin System
  • Declarative CLI