# \donttest{
# Attach packages
library(cvms)
library(dplyr)
# We will use the musicians and predicted.musicians datasets
musicians
predicted.musicians
# Set seed
set.seed(42)
# Create baseline for targets
bsl <- baseline_multinomial(
test_data = musicians,
dependent_col = "Class",
n = 20 # Normally 100
)
# Evaluate predictions grouped by classifier and fold column
eval <- predicted.musicians %>%
dplyr::group_by(Classifier, `Fold Column`) %>%
evaluate(
target_col = "Target",
prediction_cols = c("A", "B", "C", "D"),
type = "multinomial"
)
# Plot density of the Overall Accuracy metric
plot_metric_density(
results = eval,
baseline = bsl$random_evaluations,
metric = "Overall Accuracy",
xlim = c(0,1)
)
# The bulk of classifier results are much better than
# the baseline results
# }
Run the code above in your browser using DataLab