Description Usage Arguments Details Value Author(s) References See Also Examples
Function to plot cost curves using different threshold choice methods
1 2 3 4 5 6 7 8 9 10 | CostCurves(predictions, classes, cost_lines = TRUE,
test_optimal = TRUE, train_optimal = FALSE,
predictionsT = NULL, classesT = NULL,
uniquec=FALSE, uniqueTrain=FALSE, uniquecT=FALSE,
score_driven = FALSE, rate_driven = FALSE,
kendall_curves = FALSE, loss2skew = FALSE,
hold = FALSE, gridOFF = TRUE, pointsOFF = TRUE,
legendOFF = FALSE,
main, xlab, ylab, namesClassifiers, col, lwd,
lty, pch, cex,xPosLegend,yPosLegend, cexL)
|
predictions |
A list with predicted scores |
classes |
A list with labels, (only binary classes). |
cost_lines |
If TRUE Lines cost are displayed |
test_optimal |
Plot cost curves using test optimal threshold choice method. |
train_optimal |
Plot cost curves using train optimal threshold choice method. |
predictionsT |
A list with predicted scores. Required when option train_optimal is TRUE. |
classesT |
A list with labels, (only binary classes). Required when option train_optimal is TRUE. |
uniquec |
If TRUE, the same labels are used for each array in a list predictions. |
uniquecT |
If TRUE, the same array classes is used for each array in a list train predictions. Required when option train_optimal is TRUE. |
uniqueTrain |
If TRUE, the same array of predictionsT and classesT is used for each array in a list predictions. It's necessary only if the option train_optimal is TRUE. |
score_driven |
If TRUE, plot the cost curves using the score driven threshold choice method. |
rate_driven |
If TRUE, plot the cost curves the using rate driven threshold choice method. |
kendall_curves |
If TRUE, plot cost curves using kendall driven threshold choice method. |
loss2skew |
If TRUE, loss by Skew is plotted otherwise loss by cost is plotted. |
hold |
If it is TRUE, the plot is maintained open allowing to plot new curves on the same plot. |
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 point. It is posible select any valid option to the graphics parameters of R. |
This function allows to plot cost curves considering different threshold choice method.
Cost Lines: CostLines
Test Optimal threshold choice method: TestOptimal
Train Optimal threshold choice method: TrainOptimal
Score Driven threshold choice method: BrierCurves
Rate Driven threshold choice method: RateDrivenCurves
Kendall Curves: KendallCurves
A list of arrays with AUCCs of different cost curves selected.
Paulina Morillo: paumoal@inf.upv.es
Drummond, C., & Holte, R. C. (2006). Cost curves: An improved method for visualizing classifier performance.
Fawcett, T. (2006). An introduction to ROC analysis. Pattern recognition letters, 27(8), 861-874.
Ferri, C., Hernandez-orallo, J., & Flach, P. A. (2011). Brier curves: a new cost-based visualisation of classifier performance. In Proceedings of the 28th International Conference on Machine Learning (ICML-11) (pp. 585-592).
Hernandez-Orallo, J., Flach, P., & Ferri, C. (2013). ROC curves in cost space. Machine learning, 93(1), 71-91.
BrierCurves, KendallCurves, predictions, RateDrivenCurves, CostLines, TestOptimal, TP_FP.rates, TrainOptimal
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | #Load data
data(predictions)
#Loss by Skew
R<-CostCurves(list(predictions$A, predictions$B),
list(predictions$classes), uniquec = TRUE, train_optimal = TRUE,
predictionsT = list(predictions$B, predictions$A),
classesT = list(predictions$clases, predictions$classes),
loss2skew = TRUE, test_optimal = FALSE,
rate_driven = FALSE, col=list(c("cyan", "red"), c("gray", "blue")),
pointsOFF = FALSE, cex=1)
R<-CostCurves(list(predictions$B), list(predictions$classes),
rate_driven = TRUE, kendall_curves = TRUE, col=c("gray", "red","green"))
#Loss by Cost
R<-CostCurves(list(predictions$A, predictions$B), list(predictions$classes),
uniquec = TRUE, train_optimal = TRUE,
predictionsT = list(predictions$B, predictions$A),
classesT = list(predictions$classes), uniquecT = TRUE)
R<-CostCurves(list(predictions$A, predictions$B), list(predictions$classes),
uniquec = TRUE, train_optimal = TRUE, predictionsT = list(predictions$B),
classesT = list(predictions$classes), uniqueTrain = TRUE,
kendall_curves = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.