A library for evaluating and improving model stability.
Project description
Tools for stable ML models.
Installation
Install via pip:
pip install .
Usage
The main function provided is stability_index, which evaluates the stability of a sequence of metric values (e.g., accuracy over time or epochs).
Example
from modstablib.metrics._performance import stability_index
# Example: accuracy values over epochs
metric_vector = [0.85, 0.86, 0.84, 0.83, 0.82]
score = stability_index(metric_vector)
print(f"Stability index: {score}")
Parameters
metric_vector: Sequence (list, numpy array, etc.) of metric values to evaluate stability.falling_rate_weight: (optional, default=12) Weight for penalizing negative trend (slope).variability_weight: (optional, default=0.5) Weight for penalizing variability (standard deviation of residuals).
Returns
- A float: Higher values indicate greater stability (less decrease and less variability).
License
MIT
Issues
For questions or issues, please use the GitHub issue tracker.
Project details
Release history Release notifications | RSS feed
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 modstablib-0.1.1.tar.gz.
File metadata
- Download URL: modstablib-0.1.1.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d770132bd14b1f039afb57699ee8435c16d20cf0833ff0ddb1f4c62acb0fbe78
|
|
| MD5 |
28edc4d0996c3d479dc9d34191b46b85
|
|
| BLAKE2b-256 |
7315663c3f60ef960c3c62b337fb16566ce61a636b4db63c481f3a8c5927e87c
|
File details
Details for the file modstablib-0.1.1-py3-none-any.whl.
File metadata
- Download URL: modstablib-0.1.1-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5959680d51e28597a9ad8b3b4ddcf3357e365425744f243bcc157c2a6bb6b89f
|
|
| MD5 |
cb8460915c37c5be9ef32bebe95850e6
|
|
| BLAKE2b-256 |
c6e1dea6736b9694971abc3857f3de098796ee6c297397a27f33778557bd517c
|