Driftguard

Latest version: v0.1.4

Safety actively analyzes 723217 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.1.4

We are pleased to announce **DriftGuard v0.1.4**, which fixes the environment variable bug introduced in v0.1.2 while keeping the core features the same.

**Bug Fixes:**
- **Fixed `.env` Bug from v0.1.2:** This release addresses the issue where the environment variable `DRIFTGUARD_EMAIL_PASSWORD` wasn't properly handled in v0.1.2, which caused errors when sending email alerts.

**Features:**
- The features remain the same as in the previous release, including:
- Email alerting functionality with default sender settings.
- Configurable recipient email address for sending alerts.
- Alert history management and logging.

**How to Upgrade:**
To upgrade to DriftGuard v0.1.4, simply run:

bash
pip install --upgrade driftguard


This version resolves the `.env` issue from v0.1.2 and works seamlessly with the existing functionality.

**Known Issues:**
- No new known issues for this release.

**Full Changelog**: https://github.com/kiplangatkorir/driftguard/compare/v0.1.3...v0.1.4

0.1.3

We are pleased to announce **DriftGuard v0.1.3**, which fixes the environment variable bug introduced in v0.1.2 while keeping the core features the same.

**Bug Fixes:**
- **Fixed `.env` Bug from v0.1.2:** This release addresses the issue where the environment variable `DRIFTGUARD_EMAIL_PASSWORD` wasn't properly handled in v0.1.2, which caused errors when sending email alerts.

**Features:**
- The features remain the same as in the previous release, including:
- Email alerting functionality with default sender settings.
- Configurable recipient email address for sending alerts.
- Alert history management and logging.

**How to Upgrade:**
To upgrade to DriftGuard v0.1.3, simply run:

bash
pip install --upgrade driftguard


This version resolves the `.env` issue from v0.1.2 and works seamlessly with the existing functionality.

**Known Issues:**
- No new known issues for this release.


**Full Changelog**: https://github.com/kiplangatkorir/driftguard/compare/v0.1.2...v0.1.3

0.1.2

๐Ÿš€ Enhanced Drift Detection
โœ… **Categorical Drift Detection**: Now supports **Chi-Square test** for categorical features.
โœ… **Dynamic Sample Size Adjustment**: Ensures reliable drift detection even with small datasets.
โœ… **Parallel Processing**: Speeds up drift detection for large datasets.
โœ… **Detailed Logging**: Improves debugging and interpretability.

๐Ÿ“Š Smarter Model Performance Monitoring
โœ… **Regression Metrics Support**: Now tracks **MSE, MAE, and Rยฒ** for regression models.
โœ… **Adaptive Thresholding**: Dynamically adjusts drift thresholds based on **standard deviation**.
โœ… **Parallel Prediction Processing**: Reduces latency for high-volume inference.
โœ… **Degradation Alerts**: Sends **email alerts** when performance drops significantly.

๐Ÿ“ฆ Installation

bash
pip install driftguard


๐Ÿš€ Quick Start

python
from driftguard import Wrapper

Initialize monitoring
monitor = Wrapper(
model=trained_model,
reference_data=training_data,
alert_email="usercompany.com"
)

Monitor new data
results = monitor.monitor(new_data, actual_labels)

Check monitoring stats
stats = monitor.get_monitoring_stats()


๐Ÿ”ง Components

๐Ÿ† **ModelMonitor**
- Tracks model performance over time.
- Supports **classification & regression** metrics.
- Stores performance history for analysis.

๐Ÿ”Ž **DriftDetector**
- Detects **numerical & categorical drift** (KS test + Chi-Square).
- Provides **p-values and drift scores** for insights.
- Uses **parallel processing** for efficiency.

๐Ÿ“ข **AlertManager**
- **Email-based alerting** for drift & performance issues.
- Configurable alert **thresholds & recipients**.
- Tracks **alert history** for visibility into issues.

๐Ÿ“œ Requirements
- Python 3.8+
- numpy
- pandas
- scipy
- scikit-learn
- python-dotenv

๐Ÿ“– [Documentation](https://github.com/kiplangatkorir/driftguard/blob/main/documentation.md)

๐Ÿ”ฎ Coming Soon
- **More drift detection methods** (Jensen-Shannon, Wasserstein).
- **Real-time monitoring dashboard**.
- **REST API for production integration**.
- **Cloud-based monitoring solutions**.

๐Ÿ›  Bug Reports & Feature Requests
This is an early version, and feedback is **critical** for improvement! If you find a bug or have a feature suggestion, please [open an issue](https://github.com/kiplangatkorir/driftguard/issues)

โš–๏ธ License
[MIT License](https://github.com/kiplangatkorir/driftguard/blob/main/LICENSE)

๐Ÿ‘ฅ Contributors
This release was developed by **kiplangatkorir**. Contributions are welcomeโ€”fork the repo & submit a PR!

0.1.1

I am excited to announce the second release of **DriftGuard**, a Python package for automated ML model monitoring and drift detection. Formerly known as **DriftMonitor**, I have rebranded the package to avoid name conflicts and to better reflect its purpose of guarding against model drift.

Features

Core Components
- **Model Performance Monitoring**: Track model accuracy over time.
- **Drift Detection**: Detect data drift using statistical methods such as the Kolmogorov-Smirnov test.
- **Automated Alerting**: Receive email notifications when drift or performance issues are detected.
- **Simple Integration**: Easy-to-use wrapper for seamless integration into existing ML pipelines.

Key Highlights
- Minimal configuration required for setup.
- Non-intrusive monitoring that doesn't impact model performance.
- Automated email alerts for drift and performance issues.
- Performance history tracking to monitor long-term accuracy.
- Feature-level drift detection to identify specific variables at risk.

Installation

bash
pip install driftguard


Quick Start

python
from driftguard import Wrapper

Initialize monitoring
monitor = Wrapper(
model=trained_model,
reference_data=training_data,
alert_email="usercompany.com"
)

Monitor new data
results = monitor.monitor(new_data, actual_labels)

Check monitoring stats
stats = monitor.get_monitoring_stats()


Components

ModelMonitor
- Tracks model performance over time.
- Stores performance history for later analysis.
- Supports accuracy and other metrics for performance evaluation.

DriftDetector
- Detects statistical drift using the Kolmogorov-Smirnov test.
- Performs feature-level drift analysis.
- Provides p-values and drift scores for drift assessment.

AlertManager
- Email-based alerting system.
- Configurable thresholds for drift detection.
- Tracks alert history for visibility into drift events.

Requirements
- Python 3.8+
- numpy
- pandas
- scipy
- scikit-learn
- python-dotenv

[Documentation](https://github.com/kiplangatkorir/driftguard/blob/main/documentation.md)
Full documentation is available at [Documentation](https://github.com/kiplangatkorir/driftguard/blob/main/documentation.md).

Coming Soon
- Additional performance metrics.
- More drift detection methods.
- Dashboard for monitoring visualization.
- REST API support for easier integration into production environments.
- Cloud integration options for scalable monitoring.

Bug Reports and Feature Requests
We know this is an early version, and bugs are possible! If you encounter any issues or have suggestions for new features, please feel free to [open an issue](https://github.com/kiplangatkorir/driftguard/issues). Weโ€™re actively working on improving DriftGuard and your feedback is invaluable in shaping the future of this project.

License
[MIT License](https://github.com/kiplangatkorir/driftguard/blob/main/LICENSE)

Contributors
I created this initial release. Contributions are welcome! Feel free to fork the repository and submit pull requests.

0.1.0

I am excited to announce the initial release of **DriftGuard**, a Python package for automated ML model monitoring and drift detection. Formerly known as **DriftMonitor**, I have rebranded the package to avoid name conflicts and to better reflect its purpose of guarding against model drift.

Features

Core Components
- **Model Performance Monitoring**: Track model accuracy over time.
- **Drift Detection**: Detect data drift using statistical methods such as the Kolmogorov-Smirnov test.
- **Automated Alerting**: Receive email notifications when drift or performance issues are detected.
- **Simple Integration**: Easy-to-use wrapper for seamless integration into existing ML pipelines.

Key Highlights
- Minimal configuration required for setup.
- Non-intrusive monitoring that doesn't impact model performance.
- Automated email alerts for drift and performance issues.
- Performance history tracking to monitor long-term accuracy.
- Feature-level drift detection to identify specific variables at risk.

Installation

bash
pip install driftguard


Quick Start

python
from driftguard import Wrapper

Initialize monitoring
monitor = Wrapper(
model=trained_model,
reference_data=training_data,
alert_email="usercompany.com"
)

Monitor new data
results = monitor.monitor(new_data, actual_labels)

Check monitoring stats
stats = monitor.get_monitoring_stats()


Components

ModelMonitor
- Tracks model performance over time.
- Stores performance history for later analysis.
- Supports accuracy and other metrics for performance evaluation.

DriftDetector
- Detects statistical drift using the Kolmogorov-Smirnov test.
- Performs feature-level drift analysis.
- Provides p-values and drift scores for drift assessment.

AlertManager
- Email-based alerting system.
- Configurable thresholds for drift detection.
- Tracks alert history for visibility into drift events.

Requirements
- Python 3.8+
- numpy
- pandas
- scipy
- scikit-learn
- python-dotenv

[Documentation](https://github.com/kiplangatkorir/driftguard/blob/main/documentation.md)
Full documentation is available at [Documentation](https://github.com/kiplangatkorir/driftguard/blob/main/documentation.md).

Coming Soon
- Additional performance metrics.
- More drift detection methods.
- Dashboard for monitoring visualization.
- REST API support for easier integration into production environments.
- Cloud integration options for scalable monitoring.

Bug Reports and Feature Requests
We know this is an early version, and bugs are possible! If you encounter any issues or have suggestions for new features, please feel free to [open an issue](https://github.com/kiplangatkorir/driftguard/issues). Weโ€™re actively working on improving DriftGuard and your feedback is invaluable in shaping the future of this project.

License
[MIT License](https://github.com/kiplangatkorir/driftguard/blob/main/LICENSE)

Contributors
I created this initial release. Contributions are welcome! Feel free to fork the repository and submit pull requests.

Links

Releases

ยฉ 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.