Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zachcoleman/fast-stats
A fast and simple library for calculating basic statistics written in Rust and Python
https://github.com/zachcoleman/fast-stats
performance python rust statistics
Last synced: 23 days ago
JSON representation
A fast and simple library for calculating basic statistics written in Rust and Python
- Host: GitHub
- URL: https://github.com/zachcoleman/fast-stats
- Owner: zachcoleman
- License: apache-2.0
- Created: 2022-05-21T01:07:12.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-05T17:23:48.000Z (over 1 year ago)
- Last Synced: 2024-11-08T11:12:23.850Z (about 2 months ago)
- Topics: performance, python, rust, statistics
- Language: Python
- Homepage: https://zachcoleman.github.io/fast-stats/
- Size: 123 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/zachcoleman/fast-stats/tests.yml?branch=main)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/fast-stats)
![PyPI - Wheel](https://img.shields.io/pypi/wheel/fast-stats)
[![License](https://img.shields.io/badge/license-Apache2.0-green)](./LICENSE)# fast-stats
`fast-stats` is a fast and simple library for calculating basic statistics such as: precision, recall, and f1-score. The library also supports the calculation of confusion matrices. For examples, please look at the `examples/` folder.`fast-stats` is designed and tested against the `scikit-learn` library and provides formatted results to be a drop-in replacement in most cases. There are both generic functions like `fast_stats.precision` that provide significant speedup and specialized binary functions such as `fast_stats.binary_precision` that provide even faster optimal performance for binary data. `fast-stats` was specifically created to provide a limited alternative to `scikit-learn.metrics` for calculating statistics quickly on large multi-dimensional arrays or tensors such as those produced by computer vision models.
[Benchmarks](examples/benchmarks.ipynb) show approximately:
- 100x improvement in binary calculations
- 10x improvement in multiclass calculations
- 2x improvement in computing confusion matrices
- 15% speed-up over an equivalent `numpy` binary calculationThe project was developed using the [maturin](https://maturin.rs) framework.
See docs here: https://zachcoleman.github.io/fast-stats/
## Installation
From PyPI:
```shell
pip install fast-stats
```Build from source:
```
maturin build -r -i=path/to/python
pip install .../fast-stats/target/wheels/.whl
```## Running Tests
Tests are run with `pytest`.