Skip to main content

Statys

Latest release CI PyPI License

Statys provides descriptive measures, pairwise non-parametric tests, Friedman and Iman-Davenport statistics, Nemenyi critical differences, and comparison plots.

Statys requires Python 3.11 or newer.

Installation

pip install statys

Repeated comparisons

import numpy as np

from statys import friedman, nemenyi, plot_critical_difference

scores = np.array(
    [
        [0.82, 0.79, 0.75],
        [0.80, 0.77, 0.78],
        [0.84, 0.81, 0.76],
        [0.79, 0.75, 0.74],
    ]
)

print(friedman(scores))
ranks, critical_difference = nemenyi(scores)
plot_critical_difference(
    ranks,
    critical_difference,
    labels=["Model A", "Model B", "Model C"],
    output="critical-difference.pdf",
)

Rows are experimental blocks and columns are the treatments being compared.

Measures and pairwise tests

from statys import measures, pairwise, significance

control = [0.82, 0.80, 0.84, 0.79]
model_a = [0.79, 0.77, 0.81, 0.75]
model_b = [0.75, 0.78, 0.76, 0.74]

print(measures.mean(control, model_a, model_b))

results = pairwise.signed_rank(control, model_a, model_b)
significance.plot_p_value(
    results,
    labels=["Control", "Model A", "Model B"],
    output="p-values.pdf",
)

The measures module also provides kurtosis, max, median, min, rank, skewness, std, and var. The pairwise module provides u_test, signed_rank, and rank_sum.

Development

uv sync
uv run pytest
uv run pre-commit run --all-files
uv build

Documentation is available at statys.readthedocs.io.

Download files

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

Source Distribution

statys-2.0.1.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

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

statys-2.0.1-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file statys-2.0.1.tar.gz.

File metadata

  • Download URL: statys-2.0.1.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for statys-2.0.1.tar.gz
Algorithm Hash digest
SHA256 e01d1696bdf735fdcd61cddaa67745575f7ebc47201e2ea2ef23f2329a94421f
MD5 a69d5e4b170cd0c35ce12d6868e29abc
BLAKE2b-256 b42648aeb03cd467ba9273550db1090fc8a1f998d592ba4760d7506bb3c9bcda

See more details on using hashes here.

File details

Details for the file statys-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: statys-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for statys-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 98f7354ad1e57121908bbc5783ee8e95e7bf107b7ff4cced2f3c8c5972e84722
MD5 cb36ac79437d6e33d4bab9797496e12d
BLAKE2b-256 1192879e40d7000c3b25846b4001635e0043bc956ced32cb18439b4ca1f5f47d

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 files

2.0.0

2 files

1.0.1

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page