View source: R/classification_report.R
classification_report | R Documentation |
Create a table giving precision, recall and F1-scores.
classification_report(pred, true, exclude = NULL)
cr(pred, true, exclude = NULL)
## S3 method for class 'cr'
print(x, digits = 3, ...)
pred |
vector of predicted classes. |
true |
vector of true classes. |
exclude |
vector of classes to exclude for average metrics computation.
They are then marked by a |
x |
output of |
digits |
number of digits to display for each number in the report. |
... |
passed to |
A data.frame with global and per class metrics.
# fit and predict a classifier
res <- mutate(mtcars, cyl=factor(cyl)) %>%
resample_cv(k=3) %>%
xgb_fit(resp="cyl", expl=c("mpg", "hp", "qsec"), nrounds=30) %>%
xgb_predict(fns=NULL)
res
classification_report(res$pred, res$cyl)
classification_report(res$pred, res$cyl, exclude=8)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.