Title: | Generates a Visualization of Classifier Performance as a Grid of Diagnostic Plots |
---|---|
Description: | Generates a visualization of binary classifier performance as a grid of diagnostic plots with just one function call. Includes ROC curves, prediction density, accuracy, precision, recall and calibration plots, all using ggplot2 for easy modification. Debug your binary classifiers faster and easier! |
Authors: | Aaron Defazio [aut, cre], Huw Campbell [aut] |
Maintainer: | Aaron Defazio <[email protected]> |
License: | BSD 3-clause License + file LICENSE |
Version: | 1.4.0 |
Built: | 2025-03-02 05:35:21 UTC |
Source: | https://github.com/adefazio/classifierplots |
Returns a ggplot2 plot object containing an accuracy @ percentile plot
accuracy_plot(test.y, pred.prob, granularity = 0.02, show_numbers = T)
accuracy_plot(test.y, pred.prob, granularity = 0.02, show_numbers = T)
test.y |
List of know labels on the test set |
pred.prob |
List of probability predictions on the test set |
granularity |
Default 0.02, probability step between points in plot. |
show_numbers |
Show values as numbers above the plot line |
Compute auc from predictions and truth
calculate_auc(test.y, pred.prob)
calculate_auc(test.y, pred.prob)
test.y |
List of know labels on the test set |
pred.prob |
List of probability predictions on the test set |
auc
Returns a ggplot2 plot object containing a smoothed propensity @ prediction level plot
calibration_plot(test.y, pred.prob)
calibration_plot(test.y, pred.prob)
test.y |
List of know labels on the test set |
pred.prob |
List of probability predictions on the test set |
classifierplots
or classifierplots_folder
.The main functions you want are classifierplots
or classifierplots_folder
.
Produce a suit of classifier diagnostic plots
classifierplots(test.y, pred.prob)
classifierplots(test.y, pred.prob)
test.y |
List of know labels on the test set |
pred.prob |
List of probability predictions on the test set |
## Not run: classifierplots(example_predictions$test.y, example_predictions$pred.prob) ## End(Not run)
## Not run: classifierplots(example_predictions$test.y, example_predictions$pred.prob) ## End(Not run)
Produce a suit of classifier diagnostic plots, saving to disk.
classifierplots_folder(test.y, pred.prob, folder, height = 5, width = 5)
classifierplots_folder(test.y, pred.prob, folder, height = 5, width = 5)
test.y |
List of know labels on the test set |
pred.prob |
List of probability predictions on the test set |
folder |
Directory to save plots into |
height |
height of separately saved plots |
width |
width of separately saved plots |
Returns a ggplot2 plot object containing a score density plot.
density_plot(test.y, pred.prob)
density_plot(test.y, pred.prob)
test.y |
List of know labels on the test set |
pred.prob |
List of probability predictions on the test set |
Generated using the gen_example included in the github source
Returns a ggplot2 plot object containing an precision @ percentile plot
lift_plot(test.y, pred.prob, granularity = 0.02, show_numbers = T)
lift_plot(test.y, pred.prob, granularity = 0.02, show_numbers = T)
test.y |
List of know labels on the test set |
pred.prob |
List of probability predictions on the test set |
granularity |
Default 0.02, probability step between points in plot. |
show_numbers |
Show numbers at deciles T/F default T. |
Produces some definitions as a grid.
notation_key_plot()
notation_key_plot()
Returns a ggplot2 plot object containing an positives-per-decile plot.
positives_plot(test.y, pred.prob)
positives_plot(test.y, pred.prob)
test.y |
List of know labels on the test set |
pred.prob |
List of probability predictions on the test set |
Returns a ggplot2 plot object containing an precision @ percentile plot
precision_plot(test.y, pred.prob, granularity = 0.02, show_numbers = T)
precision_plot(test.y, pred.prob, granularity = 0.02, show_numbers = T)
test.y |
List of know labels on the test set |
pred.prob |
List of probability predictions on the test set |
granularity |
Default 0.02, probability step between points in plot. |
show_numbers |
Show numbers at deciles T/F default T. |
Returns a ggplot2 plot object containing an propensity @ percentile plot
propensity_plot(test.y, pred.prob, granularity = 0.02)
propensity_plot(test.y, pred.prob, granularity = 0.02)
test.y |
List of know labels on the test set |
pred.prob |
List of probability predictions on the test set |
granularity |
Default 0.02, probability step between points in plot. |
Returns a ggplot2 plot object containing an sensitivity @ percentile plot
recall_plot(test.y, pred.prob, granularity = 0.02, show_numbers = T)
recall_plot(test.y, pred.prob, granularity = 0.02, show_numbers = T)
test.y |
List of know labels on the test set |
pred.prob |
List of probability predictions on the test set |
granularity |
Default 0.02, probability step between points in plot. |
show_numbers |
Show numbers at deciles T/F default T. |
Produces a smoothed ROC curve as a ggplot2 plot object. A confidence interval is produced using bootstrapping, although it is turned off by default if you have a large dataset.
roc_plot(test.y, pred.prob, resamps = 2000, force_bootstrap = NULL)
roc_plot(test.y, pred.prob, resamps = 2000, force_bootstrap = NULL)
test.y |
List of know labels on the test set |
pred.prob |
List of probability predictions on the test set |
resamps |
How many bootstrap samples to use |
force_bootstrap |
True/False to force or force off bootstrapping. |
Logistic sigmoid function, that maps any real number to the [0,1] interval. Supports vectors of numeric.
sigmoid(x)
sigmoid(x)
x |
data |