| predicted.musicians | R Documentation |
Predictions by 3 classifiers of the 4 classes in the
musicians dataset.
Obtained with 5-fold stratified cross-validation (3 repetitions).
The three classifiers were fit using nnet::multinom,
randomForest::randomForest, and e1071::svm.
A data.frame with 540 rows and 10 variables:
The applied classifier.
One of "nnet_multinom", "randomForest", and "e1071_svm".
The fold column name. Each is a unique 5-fold split.
One of ".folds_1", ".folds_2", and ".folds_3".
The fold. 1 to 5.
Musician identifier, 60 levels
The actual class of the musician.
One of "A", "B", "C", and "D".
The probability of class "A".
The probability of class "B".
The probability of class "C".
The probability of class "D".
The predicted class. The argmax of the four probability columns.
Used formula: "Class ~ Height + Age + Drums + Bass + Guitar + Keys + Vocals"
Ludvig Renbo Olsen, r-pkgs@ludvigolsen.dk
musicians
# Attach packages
library(cvms)
library(dplyr)
# Evaluate each fold column
predicted.musicians %>%
dplyr::group_by(Classifier, `Fold Column`) %>%
evaluate(target_col = "Target",
prediction_cols = c("A", "B", "C", "D"),
type = "multinomial")
# Overall ID evaluation
# I.e. if we average all 9 sets of predictions,
# how well did we predict the targets?
overall_id_eval <- predicted.musicians %>%
evaluate(target_col = "Target",
prediction_cols = c("A", "B", "C", "D"),
type = "multinomial",
id_col = "ID")
overall_id_eval
# Plot the confusion matrix
plot_confusion_matrix(overall_id_eval$`Confusion Matrix`[[1]])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.