predicted.musicians {cvms}R Documentation

Predicted musician groups

Description

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.

Format

A data.frame with 540 rows and 10 variables:

Classifier

The applied classifier. One of "nnet_multinom", "randomForest", and "e1071_svm".

Fold Column

The fold column name. Each is a unique 5-fold split. One of ".folds_1", ".folds_2", and ".folds_3".

Fold

The fold. 1 to 5.

ID

Musician identifier, 60 levels

Target

The actual class of the musician. One of "A", "B", "C", and "D".

A

The probability of class "A".

B

The probability of class "B".

C

The probability of class "C".

D

The probability of class "D".

Predicted Class

The predicted class. The argmax of the four probability columns.

Details

Used formula: "Class ~ Height + Age + Drums + Bass + Guitar + Keys + Vocals"

Author(s)

Ludvig Renbo Olsen, r-pkgs@ludvigolsen.dk

See Also

musicians

Examples

# 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]])


[Package cvms version 1.3.3 Index]