Hi all,
This is my first time in a competition. I am wondering what does the classification rate mean?
classification rate = (1/N) * I( y = y_hat )
I don’t understand if y is equal to y_hat, then I( y = y_hat ) return 1 or 0. Or it is the other way around? How can I code this into R?
Thank you so much for helping me in advance. This is my first time in a competition, so I hope I did not sound silly for asking a question like this. Thanks!
It is 1 minus the error rate.
Hey
I coded this in R by looking at the description:
The metric used for this competition is the classification rate, which calculates the percentage of rows where the predicted class y^y^ in the submission matches the actual class, yy in the test set.
In other words, it’s the percentage correctly classified.
I did it like this:
-
Calculate number of rows where your prediction was correct. In my case, I have a data.table with the id,
the predicted
class and the real
class. Then count the number where predicted
== real
,
-
Divide by number of rows on which you predict. ( nrow()
)
Kind regards
Jbnt