A production-oriented model monitoring library for detecting performance drift, data drift, and prediction drift, with automated reporting for ML systems.
Project description
!CI !PyPI version
momo-ml
momo-ml 是一个用于生产环境的 模型监控(MOdel MOnitoring for ML) 工具库,旨在提供系统化、可扩展、可自动化的模型质量监测能力。
库覆盖模型性能漂移(performance drift)、数据漂移(data drift)、预测值漂移(prediction drift)等关键监控维度,同时支持自动生成可视化报表。
本项目适用于数据科学、ML 工程、MLOps 等场景,可集成至模型上线后的各类监控与治理流程。
📌 Features
1. Performance Drift
监测模型在不同时间窗口的预测性能变化:
- AUC / F1 / Precision / Recall / RMSE 等指标
- Reference window vs current window 对比
- Rolling window 趋势分析
2. Data Drift
检测输入数据分布稳定性:
- Population Stability Index (PSI)
- KL Divergence、KS Test
- 数值特征统计变化(mean / var / quantile shift)
- 类别特征分布漂移(frequency shift)
3. Prediction Drift
监测模型输出行为是否异常:
- 输出分布变化
- 分箱稳定性(如 deciles shift)
- 不同群体/分段之间的预测差异
4. Automated Reporting
提供统一报表生成能力:
- 自动生成 Drift 图表(matplotlib / plotly)
- 一键生成 HTML 或 PDF 报告
- 可扩展存储或推送到自定义 dashboard
🔧 Installation
pip install momo-ml
momo-ml/
├── momo_ml/
│ ├── __init__.py
│ ├── monitor/
│ │ ├── __init__.py
│ │ ├── model_monitor.py
│ │ ├── performance.py
│ │ ├── prediction.py
│ │ └── data_drift.py
│ │
│ ├── metrics/
│ │ ├── __init__.py
│ │ ├── psi.py # PSI
│ │ ├── kl.py # KL Divergence
│ │ ├── ks.py # KS Test
│ │ └── performance_metrics.py # AUC/Precision/F1...
│ │
│ ├── report/
│ │ ├── __init__.py
│ │ ├── report_builder.py # HTML / PDF 生成
│ │
│ ├── utils/
│ │ ├── __init__.py
│ │ ├── plotting.py # 所有图表方法
│ │ └── validation.py # 输入校验
│
├── tests/
│ ├── test_data_drift.py
│ ├── test_model_monitor.py
│ └── test_performance_metrics.py
│ └── test_prediction_drift.py
│ └── test_report_builder.py
│ └── test_validation.py
│
├── README.md
├── pyproject.toml
└── setup.cfg
└── .gitignore
└── CHANGELOG.md
└── LICENSE
└── MANIFEST.in
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file momo_ml-0.1.3.tar.gz.
File metadata
- Download URL: momo_ml-0.1.3.tar.gz
- Upload date:
- Size: 20.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88765c018abc49be9b2730914cd58916be5fe87874443678a5418b6809e99996
|
|
| MD5 |
34e54794e43cfe2b3b14d0d32315a5bc
|
|
| BLAKE2b-256 |
da9cdc40cf36749598d90aebefd706c65700d5b2e19bd0b663842dbb6e1069d0
|
File details
Details for the file momo_ml-0.1.3-py3-none-any.whl.
File metadata
- Download URL: momo_ml-0.1.3-py3-none-any.whl
- Upload date:
- Size: 23.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e04026f767411fae9f97c9537b2d7fceb2f141648498cc31c2d7b67de062ba1
|
|
| MD5 |
72b4ea8d79463576089b9c09e0bf3bde
|
|
| BLAKE2b-256 |
17077d32ae848ce99758747dc2ddda232c12ca5eaddaf43bd1ce09144f61fbc6
|