-
-
Save toyeiei/ce136771a9a12f5b2c3c8d7bb4352acd to your computer and use it in GitHub Desktop.
bayes application - cancer detection
This file contains 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
# create confusion matrix | |
result <- matrix(c(99,1,495,9405), ncol=2, byrow=T) | |
colnames(result) <- c("Positive", "Negative") | |
rownames(result) <- c("Cancer", "No Cancer") | |
# see the table | |
result | |
sum(result) # n=10000 | |
# overall accuracy of the medical test | |
(99 + 9405) / 10000 # 0.9504 | |
# p(cancer|+) = true positive / all positives | |
99 / (99 + 495) # 0.1667 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment