Skip to main content

FitCheck

Zero-boilerplate ML data validation, model evaluation, and drift detection.

CI Python 3.10+ Apache 2.0 Tests

FitCheck is a local-first toolkit for answering three questions quickly: Is this dataset healthy? Is this model behaving? Has production data changed? Every workflow produces a self-contained HTML report that can be opened locally and shared in a pull request, Slack, or an incident review.

Why FitCheck

FitCheck is intentionally opinionated. It is zero-config for the common path, never mutates data silently, makes recommendations understandable to beginners, and keeps advanced diagnostics available without making the first command complicated. It does not send telemetry or require a hosted service.

Principle What it means in practice
Zero friction Pass a CSV, Parquet file, DataFrame, or trained model and receive a report.
Read-only by default Checks diagnose problems; optional fix scripts are generated separately for inspection.
Local and private Reports and statistical calculations run locally.
Progressive disclosure The simple API remains small while full workflows expose deeper diagnostics.
Shareable output Reports are standalone HTML with responsive styling and embedded plots.

Installation

pip install data-fitcheck

For development:

git clone https://github.com/neoline361-art/fitcheck.git
cd fitcheck
pip install -e ".[dev]"

The one-command workflow

fitcheck full data.csv \
  --target label \
  --model model.joblib \
  --reference train.csv \
  --auto-fix \
  --output-dir fitcheck_reports

This creates a dataset report, model evaluation report, optional drift report, and—when issues are found—a transparent fix script. The workflow uses the dataset columns other than label as model features, so it is best suited to a model trained on the same feature schema.

Python API

import fitcheck

issues = fitcheck.check("data.csv", target="label")
metrics = fitcheck.report(model, X_test, y_test)
results = fitcheck.detect_drift("train.csv", "production.csv", method="auto")

The dataset check accepts threshold overrides without requiring a configuration file:

fitcheck.check(
    "data.csv",
    target="label",
    config={
        "missing_warning": 0.05,
        "missing_critical": 0.20,
        "outlier_threshold": 0.01,
    },
)

What FitCheck checks

Area Built-in diagnostics
Dataset health Missing values, duplicates, constants, class imbalance, IQR outliers, high cardinality, text-length skew, text-encoding warnings
Time series Timestamp parsing, monotonicity, duplicates, and frequency gaps (--time-column)
Model classification Accuracy, precision, recall, F1, confusion matrix, ROC/AUC, average precision, precision–recall curve, recommended threshold, Brier score, calibration curve, per-class error analysis, and tree feature importance
Model regression MSE, RMSE, MAE, R², adjusted R², explained variance, residual analysis, actual-versus-predicted plot, and tree feature importance
Drift Automatic KS/PSI selection for numeric data, explicit Wasserstein and Jensen–Shannon distance, Chi-squared categorical comparisons, and schema drift (missing columns / dtype changes)
Seasonality Autocorrelation-based hint for repeatable time-series patterns (detect_seasonality)
Reports Severity badges, recommendations, responsive tables, embedded plots, and no external assets. Optional interactive Plotly charts (--renderer plotly)
Integrations Optional MLflow logging and DVC metrics callbacks (log_to_mlflow, log_to_dvc)

For drift, method="auto" uses KS on smaller numeric samples and PSI on larger numeric samples. Use method="wasserstein" when a normalized distribution-distance signal is more useful than a hypothesis test.

CLI commands

fitcheck check data.csv --target label
fitcheck check data1.csv data2.csv            # multi-file check
fitcheck check data.csv --missing-warning 0.10 --missing-critical 0.30
fitcheck check data.csv --time-column timestamp --plugins my_checks
fitcheck check big.parquet --backend polars        # optional fast loading backend
fitcheck report model.joblib X_test.npy y_test.npy --renderer plotly
fitcheck drift train.csv production.csv --method psi
fitcheck full data.csv --target label --model model.joblib --reference train.csv
fitcheck demo --no-browser --output-dir ./demo

CI and exit codes

fitcheck check is CI-native: run it with --json for machine-readable output, --quiet to suppress everything except the exit code, and --fail-on to pick the severity that fails a pipeline.

fitcheck check data.csv --target label --json --quiet --fail-on critical
echo $?   # 0 pass, 1 warnings, 2 critical, 3 runtime error

--json emits a result dict for a single file and a list of dicts for multiple files. High-cardinality detection targets ID-like columns (object, category, and integer dtypes), so continuous numeric measurements are not flagged as cardinality issues.

Exit code Meaning
0 No issues (or only issues below --fail-on)
1 Warnings found
2 Critical issues found
3 Runtime error (missing file, invalid config)

The repository ships a pre-commit hook and a GitHub Action gate (.github/workflows/fitcheck-gate.yml) so dataset health blocks merges the same way linting does.

Plugins and Jupyter

Custom checks are plain functions that take a DataFrame and return issue dictionaries:

from fitcheck.plugins import registry

def my_check(df):
    return [{"column": "x", "type": "custom", "severity": "warning",
             "message": "custom rule triggered", "suggestion": "fix it"}]

registry.register("my_check", my_check)
fitcheck check data.csv --plugins my_check

Inside a notebook, %load_ext fitcheck enables inline reports:

%load_ext fitcheck
%fitcheck df --target label

Reports and privacy

FitCheck does not upload input data. HTML reports embed generated plots as base64 data and include only the information derived from the supplied datasets. Model loading uses Python pickle for user-owned artifacts; never load a model file from an untrusted source.

Development and verification

pip install -r requirements.lock   # reproducible dev environment
pip install -e . --no-deps
ruff check fitcheck tests
mypy fitcheck
bandit -r fitcheck/ -x tests
pytest --cov=fitcheck --cov-report=term-missing

The current repository suite contains 70+ passing tests and reports approximately 95% total coverage on the supported Python environment.

Large CSVs and contact data

Phone numbers should be stored as strings, not numeric values, so leading zeros and country prefixes are preserved. Names are treated as text values. A quick local check is:

fitcheck check contacts.csv --output contacts_report.html
# Fast, explicit sample review for a very large CSV:
fitcheck check contacts.csv --sample-rows 100000 --output contacts_sample_report.html

FitCheck is designed for in-memory pandas workflows. A file with 1 million rows and a few narrow columns is a reasonable local smoke-test target, but a 10-million-row file may require several gigabytes of RAM depending on string length and pandas version. For a fast schema/sample review, use pandas to create a representative sample before calling FitCheck; do not claim a sample report is a full-dataset audit. FitCheck does not print or transmit raw phone numbers in the terminal, but generated reports can contain previews, so protect report files as sensitive data.

Documentation

Resource Purpose
API reference Public functions, arguments, and return values
Architecture Module boundaries and design principles
FAQ Common questions and limitations
Examples Runnable Python examples
Changelog Release history

License

FitCheck is released under the Apache 2.0 License. See LICENSE.

Metadata

Release files for data-fitcheck 3.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for data-fitcheck 3.1.0
File Size Uploaded
data_fitcheck-3.1.0.tar.gz 1.4 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for data-fitcheck 3.1.0
File Interpreter ABI Platform
data_fitcheck-3.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 2.8 MB

Release files / data_fitcheck-3.1.0.tar.gz

Download URL data_fitcheck-3.1.0.tar.gz
Size 1.4 MB
Tags Source
SHA-256 checksum
How to use checksums
ce55d770207cd0ba4061f0f35a59b591a091a8907d7f9196af0d8765c1d89bf4
BLAKE2b-256 checksum
How to use checksums
f16a6360dc616ae7d03d1c615ba7ea25658f4fdf8fd7e8b43f1ecfafa7dfef99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 15, 2026.

Transparency log

Release files / data_fitcheck-3.1.0-py3-none-any.whl

Download URL data_fitcheck-3.1.0-py3-none-any.whl
Size 1.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
f7bf7f8d50910c430dc825e5e6a0f5d3afd8c3138673b94f8381b1d7706ba8d3
BLAKE2b-256 checksum
How to use checksums
c96ffbc93545c5b42e69f80c9dc14667dd6855748d59604be1422b48d6922d19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 15, 2026.

Transparency log

Release history Release notifications | RSS feed

3.4.0

2 release files

3.1.3

2 release files

3.1.2

2 release files

3.1.1

2 release files

This release

3.1.0 This release

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page