splendid_graphs: Discriminating graphs

Description Usage Arguments Details Value Author(s) References Examples

Description

Graphs a discrimination_plot and reliability_plot based on true classes and predicted class probabilities.

Usage

1
2
3
discrimination_plot(x, pred.probs)

reliability_plot(x, pred.probs)

Arguments

x

true class labels

pred.probs

matrix of predicted class probabilities. Number of rows must equal length of x

Details

A discrimination_plot shows boxplots of the predicted probabilities for each class, separated by panels of the true class labels. The class prevalence is also drawn as a horizontal line for each panel.

A reliability_plot shows mean prediction vs. observed fraction on lowess smoother for each class. A line going thru the origin with slope of 1 serves as a reference for perfect reliability.

Both plots can be called from within evaluation().

Value

ggplot objects for the desired plot

Author(s)

Dustin Johnson, Derek Chiu

References

http://onlinelibrary.wiley.com/doi/10.1002/sim.5321/abstract

Examples

1
2
3
4
5
6
7
8
9
data(hgsc)
class <- attr(hgsc, "class.true")
set.seed(1)
training.id <- sample(seq_along(class), replace = TRUE)
test.id <- which(!seq_along(class) %in% training.id)
mod <- classification(hgsc[training.id, ], class[training.id], "xgboost")
pred <- prediction(mod, hgsc, test.id, class = class)
discrimination_plot(class[test.id], attr(pred, "prob"))
reliability_plot(class[test.id], attr(pred, "prob"))

AlineTalhouk/splendid documentation built on Aug. 30, 2018, 7:54 a.m.