Last active
March 11, 2016 22:25
-
-
Save joseph-rickert/e49f097e43718aaee0ae 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
set.seed(0) | |
actual = c('a','b','c')[runif(100, 1,4)] # actual labels | |
predicted = actual # predicted labels | |
predicted[runif(30,1,100)] = actual[runif(30,1,100)] # introduce incorrect predictions | |
cm = as.matrix(table(Actual = actual, Predicted = predicted)) # create the confusion matrix | |
cm | |
## Predicted | |
## Actual a b c | |
## a 24 2 1 | |
## b 3 30 4 | |
## c 0 5 31 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment