RateDrivenCurves: Plotting the lower envelope of Cost Curves using the Rate...

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Function to plot Cost Curves using Rate Driven threshold Choice

Usage

1
2
3
4
RateDrivenCurves(predictions, classes, uniquec=FALSE, loss2skew=FALSE, hold=FALSE,
                 plotOFF=FALSE, gridOFF=TRUE, pointsOFF=TRUE, legendOFF=FALSE,
                 main, xlab, ylab, namesClassifiers, col, lwd, lty, pch, cex,
                 xPosLegend,yPosLegend, cexL)

Arguments

predictions

A list with predicted scores.

classes

A list with labels, (only binary classes).

uniquec

If it is TRUE, the same array classes is used for each array in a list predictions.

loss2skew

If it is TRUE, loss by Skew is plotted otherwise loss by cost is plotted.

hold

If it is TRUE, the view is maintained to plot a new curve above the current curve.

plotOFF

Disable/enable plot visualization, only return AUC values.

gridOFF

Disable/enable grid visualization.

pointsOFF

Disable/enable point marks visualization.

legendOFF

Disable/enable legend visualization.

main

title.

xlab

x label.

ylab

y label.

namesClassifiers

An array with names of each classifier

lwd

Line width.

lty

Line type.

col

Line color.

pch

Point type.

cex

Size point.

xPosLegend

x coordinate to be used to position the legend.

yPosLegend

y coordinate to be used to position the legend.

cexL

size of box legend.

Details

The rate-driven threshold choice method is a natural way of choosing the thresholds, especially when we only have a ranking or a poorly calibrated probabilistic caddifier.

The rate driven cost curves by cost is defined as a plot of:

2(c*pi0(1-F0((R^-1(c))))+(1-c)pi1*F1((R^-1(c))))

on the axis y against cost c

The rate driven cost curves by skew is defined as a plot of:

z(1-F0(R^-1(c)))+(1-z)F1(R^-1(c)))

on the axis y against skew z

and

R(t)=pi0*F0(t)+pi1*F1(t), by c

R(t)=(F0(t)+F1(t))/2, by z

Where:

c: cost values of x_axis between [0, 1].
z: skew values of x_axis between [0, 1].
t: threshold t=R^-1(c) or t=R^-1(c) as appropriate, and c=R(t)
pi0: negative class proportion (Y==0)/length(Y).
pi1: positive class proportion (Y==1)/length(Y).
F1(t): false positive rate of specific threshold.
1-F0(t): true positive rate of specific threshold.
R(c): recall that the predicted positive rate.

Value

An array with AUKC (Area Under Kendall Curve) for each test.

Author(s)

Paulina Morillo: paumoal@inf.upv.es

References

Hernandez-Orallo, J., Flach, P., & Ferri, C. (2013). ROC curves in cost space. Machine learning, 93(1), 71-91.

See Also

BrierCurves, CostCurves, CostLines, KendallCurves, predictions, TestOptimal, TP_FP.rates, TrainOptimal

Examples

1
2
3
4
5
6
7
8
9
#Load data
data(predictions)

#Loss by cost
R<-RateDrivenCurves(list(predictions$A, predictions$B),list(predictions$classes), uniquec=TRUE)

#Loss by skew
R<-RateDrivenCurves(list(predictions$A, predictions$B), list(predictions$classes), uniquec=TRUE,
	loss2skew = TRUE)

paumoal/costcurvespkg documentation built on May 30, 2019, 4:05 p.m.