# Binary classification: positive and negative event

Let's consider a binary supervised classification problem. Be "A" and "B" the two classes. Sometimes it is said that it if an individual belongs to one of the two classes, we have a "positive event" while if he belongs to the other class we have a "negative event". I know that what is a "positive event" and what is a "negative event" depends on the specific problem but I don't understand how to recognize them. Can you help me? Thank you.

• What do you mean by recognizing them? positive and negative are just two names you give to the classes. You can name them plus and minus or zero and one. – seteropere Aug 22 '15 at 17:34

As you've said it depends on the problem's definition. So, if you read a paper it has to be stated somewhere what the positive class is. Maybe read up on how a confusion matrix is build and try out the R-function confusionMatrix that comes with the caret package. Said function lets you define what the positive class is and you can see how the evaluation measures change.

library(caret)

lvs <- c("normal", "abnormal")
truth <- factor(rep(lvs, times = c(86, 258)),
levels = rev(lvs))
pred <- factor(
c(
rep(lvs, times = c(54, 32)),
rep(lvs, times = c(27, 231))),
levels = rev(lvs))

xtab <- table(pred, truth)

confusionMatrix(xtab, positive = "abnormal")