Creates the Precision-Recall-Gain curve and calculates the area under the curve
Project description
What are the Precision-Recall-Gain curves?
Please see http://www.cs.bris.ac.uk/~flach/PRGcurves/.
Contents
This package provides the following 6 functions:
precision_gain(TP,FN,FP,TN) recall_gain(TP,FN,FP,TN) create_prg_curve(labels,pos_scores) calc_auprg(prg_curve) prg_convex_hull(prg_curve) plot_prg(prg_curve)
Installation
This package can be installed using pip from command line:
pip install pyprg
Usage
Detailed information about the usage can be seen in the manual pages of the individual functions, e.g. by typing ?prg.create_prg_curve after importing with from prg import prg. The example usage is as follows:
from prg import prg
import numpy as np
labels = np.array([1,1,1,0,1,1,1,1,1,1,0,1,1,1,0,1,0,0,1,0,0,0,1,0,1], dtype='int')
scores = np.arange(1,26)[::-1]
prg_curve = prg.create_prg_curve(labels, scores, create_crossing_points=True)
auprg = prg.calc_auprg(prg_curve)
print(auprg)
prg.plot_prg(prg_curve)
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
pyprg-0.1.1b2.tar.gz
(6.0 kB
view hashes)
Built Distribution
Close
Hashes for pyprg-0.1.1b2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6bdee84995af42e16d49539147e9690f25c7bc94a8680f8a05c45111b6277768 |
|
MD5 | c2b365b10343ba1e5291bd9d3f6856fe |
|
BLAKE2b-256 | 1d3cf4211262d9d7e79a0c4b77a10adee23e8c25d16c40834255d9bb38b4dbd0 |