https://github.com/ldanov/pypkg_hmeasure
https://github.com/ldanov/pypkg_hmeasure
evaluation-metrics python3
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ldanov/pypkg_hmeasure
- Owner: ldanov
- License: mit
- Created: 2019-05-30T11:41:51.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-04-01T16:09:17.000Z (over 4 years ago)
- Last Synced: 2025-06-24T22:11:52.876Z (4 months ago)
- Topics: evaluation-metrics, python3
- Language: Python
- Homepage: https://pypi.org/project/hmeasure/
- Size: 3.12 MB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# README
## Description
A Python translation of the R package `hmeasure` ([GitHub](https://github.com/canagnos/hmeasure)) ([CRAN](https://cran.r-project.org/package=hmeasure)).
## Installation
To install the hmeasure library from [PyPI](https://pypi.org/project/hmeasure/) use pip:
```
pip install hmeasure
```
or install directly from source:```
python setup.py install
```## Usage
```
>>> import numpy
>>> from hmeasure import h_score
>>> rng = numpy.random.default_rng(66)
>>> y_true = rng.integers(low=0, high=2, size=10)
>>> y_true
array([1, 1, 0, 1, 1, 0, 1, 1, 1, 0])
>>> # y_pred random sampled in interval [0, 1)
>>> y_pred = (1 - 0) * rng.random(10) + 0
>>> y_pred
array([0.84901876, 0.10282827, 0.43752488, 0.46004468, 0.90878931,
... 0.79177719, 0.5297229 , 0.13803906, 0.73166264, 0.22959056])
>>> h_score(y_true, y_pred)
0.18889596344769588
```
For more examples and information check the [documentation](https://pypkg-hmeasure.readthedocs.io/en/latest/)## Questions and comments
In case of questions or comments, write an email:
`ldanov@users.noreply.github.com`