Skip to main content

A library for evaluating and improving model stability.

Project description

PyPi GitHub issues model-stability logo

Tools for stable ML models.

Installation

Install via pip:

pip install modstablib

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

modstablib-0.1.2.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

modstablib-0.1.2-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file modstablib-0.1.2.tar.gz.

File metadata

  • Download URL: modstablib-0.1.2.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.2

File hashes

Hashes for modstablib-0.1.2.tar.gz
Algorithm Hash digest
SHA256 899facab030ad1bb8041fdb8d2d2c078634af215d9aa0127ad1345174722f3da
MD5 3f5c9f1eab2c6c491815c5614d61f16f
BLAKE2b-256 ae4946725f4dc24c0a4083dfa17fd2374045f7fbb1802daba02c15f59089f6dd

See more details on using hashes here.

File details

Details for the file modstablib-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: modstablib-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.2

File hashes

Hashes for modstablib-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7e8a2d9446ffb563cb34d72f2a17a39c9dac8479d0012f2c2907844ba535fabe
MD5 88a48b48d25c7b4638f8eda0c87bcc42
BLAKE2b-256 a3dba2a54a864dd9ed35c6b6486ac12bb90b68eb46a6e5b50b4059255011a5e5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page