Last active
April 6, 2020 05:53
-
-
Save monogenea/d1f9de7b2bd5e03af9863b08a9004dd3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Test set prediction | |
predXProb <- predict(model, test$X) | |
predXClass <- speciesClass[apply(predXProb, 1, which.max)] | |
trueXClass <- speciesClass[apply(test$Y, 1, which.max)] | |
# Plot confusion matrix | |
confMatTest <- confusionMatrix(data = factor(predXClass, levels = speciesClass), | |
reference = factor(trueXClass, levels = speciesClass)) | |
pheatmap(confMatTest$table, cluster_rows = F, cluster_cols = F, | |
border_color = NA, show_colnames = F, | |
labels_row = speciesClass, | |
color = cols(max(confMatTest$table)+1)) | |
# Accuracy in test set | |
mean(predXClass == trueXClass) # 0.7364 | |
# Write sessioninfo | |
writeLines(capture.output(sessionInfo()), "sessionInfo") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment