View source: R/confusion_matrix.R
plot.cm | R Documentation |
Plot a confusion matrix
## S3 method for class 'cm'
plot(x, trans = "log1p", ...)
x |
a confusion matrix built by |
trans |
transformation function for the color scale. |
... |
passed to |
A ggplot object showing a heatmap with true values in lines and predicted values in columns.
res <- mutate(mtcars, cyl=factor(cyl)) %>%
resample_split(p=0.5) %>%
xgb_fit(resp="cyl", expl=c("mpg", "hp", "qsec"), nrounds=20) %>%
xgb_predict(fns=NULL)
plot(confusion_matrix(res$pred, res$cyl))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.