Display performance metrics for a classification model

fdPanelClassificationMetrics(actual, predicted, metrics = c("Accuracy",
  "Recall", "Precision", "F1_Score"))

computeClassificationMetrics(actual, predicted, metrics = c("Precision",
  "Recall", "F1_Score", "Accuracy"))

Arguments

actual
vector of actual values
predicted
vector of predicted values
metrics
vector of metrics to compute. See MLmetrics for list of potential metrics

See also

Other classification: fdPanelClassificationMetricsByClass

Examples

library(flightdeck)
library(rpart)
data(ptitanic, package = 'rpart.plot')
fit <- rpart(survived ~ ., data = ptitanic)
actual <- ptitanic$survived
predicted <- predict(fit, type = 'class')

computeClassificationMetrics(actual = actual, predicted = predicted)

if (interactive()){
  fdPanelClassificationMetrics(actual = actual, predicted = predicted) %>%
    fdPreview("Classification Metrics")
}