View source: R/confusion_matrix.R
confusion_matrix | R Documentation |
Build a confusion matrix
confusion_matrix(pred, true)
cm(pred, true)
pred |
vector of predicted classes. |
true |
vector of true classes. |
A table object 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)
confusion_matrix(res$pred, res$cyl)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.