Metadata-Version: 2.4
Name: momo-ml
Version: 0.1.3
Summary: A production-oriented model monitoring library for detecting performance drift, data drift, and prediction drift, with automated reporting for ML systems.
Author: YHJYH
License: MIT License
        
        Copyright (c) 2026 Werner Heisenberg
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/YHJYH/momo_ml
Project-URL: Source, https://github.com/YHJYH/momo_ml
Project-URL: Issues, https://github.com/YHJYH/momo_ml/issues
Keywords: model monitoring,drift detection,MLOps,machine learning,analytics
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: scikit-learn
Requires-Dist: scipy
Requires-Dist: matplotlib
Requires-Dist: plotly
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Dynamic: license-file

!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

```bash
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
