reliability_plot based on true classes
and predicted class probabilities.
1 2 3
true class labels
matrix of predicted class probabilities. Number of rows
must equal length of
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.
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
ggplot objects for the desired plot
Dustin Johnson, Derek Chiu
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"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.