Please see http://www.cs.bris.ac.uk/~flach/PRGcurves/.
This package provides an example script and the following 5 functions:
precision_gain(TP,FN,FP,TN)
recall_gain(TP,FN,FP,TN)
create_prg_curve(labels,pos_scores)
calc_auprg(prg_curve)
plot_prg(prg_curve)
This package can be used by copying the files to your computer:
svn checkout https://github.com/meeliskull/prg/trunk/Matlab_package/prg
The example usage in Matlab is as follows:
%% Creating data
labels = [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]
scores = 1-(1:25)/25
%% Creating the PRG-curve
prg_curve = create_prg_curve(labels,scores)
%% Calculating area under the PRG-curve
auprg = calc_auprg(prg_curve)
%% Plotting the PRG-curve
plot_prg(prg_curve)
This package has been written by Meelis Kull, based on work by Peter Flach and Meelis Kull, see http://www.cs.bris.ac.uk/~flach/PRGcurves/.