Metadata-Version: 2.4
Name: momo-ml
Version: 1.0.1
Summary: A production-oriented model monitoring library for detecting performance drift, data drift, and prediction drift, with automated reporting for ML systems.
Author-email: Justin Jia <justinjia0201@gmail.com>
License: BSD 3-Clause License
        
        Copyright (c) 2026 Yuheng Jia
        
        Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
        
        3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
        
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: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Information Analysis
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

[![PyPI version](https://img.shields.io/pypi/v/momo-ml)](https://pypi.org/project/momo-ml/)
[![Python Versions](https://img.shields.io/pypi/pyversions/momo-ml)](https://pypi.org/project/momo-ml/)
[![License](https://img.shields.io/pypi/l/momo-ml)](https://github.com/YHJYH/momo_ml/blob/main/LICENSE)

# momo-ml

**momo-ml** (**MO**del **MO**nitoring for **ML**) is a production‑oriented library for systematically, scalably, and automatically monitoring model quality.  
It covers key monitoring dimensions such as **model performance drift**, **data drift**, and **prediction drift**, and also supports automatic generation of visual reports.

This project is suitable for data science, ML engineering, MLOps, and other scenarios – it can be integrated into various monitoring and governance workflows after model deployment.

---

## 📌 Features

### **1. Performance Drift**
Evaluate how model performance changes over time by comparing a **reference dataset** with a **current dataset**.  
Supports both classification and regression tasks with a full suite of metrics, enabling detailed drift detection across time windows.

Key capabilities include:
- Classification metrics such as AUC, Accuracy, Precision, Recall, F1, and KS (supports binary & multiclass).
- Regression metrics including RMSE, MAE, R², SMAPE, P90/P95 Error, and Huber Loss.
- Automatic task‑type detection (classification vs. regression) based on label/prediction structure.
- Flexible configuration for label and prediction columns.

Use this to monitor whether a model’s predictive quality remains stable in production.

---

### **2. Data Drift**
Detect how input feature distributions shift between a **reference** and a **current** dataset.  
Works for both numeric and categorical features, with multiple statistical measures to quantify distributional changes.

Key capabilities include:
- For numeric features: PSI, KL divergence, JS divergence, KS statistic, and Wasserstein distance.
- For categorical features: PSI, KL divergence, JS divergence, and Wasserstein distance.
- Automatic separation of numeric/categorical fields.
- Safe handling of incompatible feature types with clear warnings.

This module helps identify upstream data issues such as schema drift, feature instability, or gradual population changes.

---

### **3. Prediction Drift**
Monitor changes in the distribution of model predictions, independent of labels.  
Useful for real‑time systems, unlabeled production environments, and early anomaly detection.

Key capabilities include:
- Summary statistics for numeric predictions (mean, std, quantiles) and categorical predictions (proportion changes).
- Drift metrics including PSI, KL, JS (all prediction types) and KS for continuous predictions.
- Histogram‑based L1/L2 distance and quantile/decile shift for continuous outputs.
- Automatic distinction between numeric and categorical prediction behavior using a configurable threshold.

Ideal for detecting unexpected output shifts before they escalate into performance degradation.


### **4. Report Generation**
Generate human‑readable reports from model monitoring results, making drift analysis accessible to both technical and business stakeholders. Reports can be exported in multiple formats for different use cases.

Key capabilities include:
- **Markdown reports** – Clean, structured tables with visual risk badges (🟢🟡🔴) for quick drift assessment.
- **JSON exports** – Machine‑readable format for integration with dashboards, CI/CD pipelines, or downstream analytics.
- **Customizable drift thresholds** – Define your own risk levels for PSI, KL, JS, and other metrics to match your domain requirements.
- **Comprehensive summaries** – Performance drift tables, data drift feature‑wise metrics, prediction distribution shifts, and decile analyses all in one place.

Use this component to transform raw drift metrics into actionable insights, helping teams make informed decisions about model retraining or deployment.

---

## 🔧 Installation

```bash
pip install momo-ml
