Reputation: 1
I am trying binary classification using multilayer perceptron.
It's basically sentiment analysis of sentences. Only binary at the moment. positive vs negative (there's no neutral in my data currently), so it's binary.
One thing weird I found is that the performances (accuracy, recall, precision, f1-score) are significantly different when positive is encoded 1 (positive=1, negative=0) and when negative is encoded 1 (positive=0, negative=1). of course I used the same X dataset and the same model (architecture). only label encoding was changed.
when positive cases are encoded 1, average f1 score is about 89. (I ran the same model 10 times) when negative cases are encoded 1, average f1 score is about 50. (I ran the same model 10 times)
I am quite confused with this result. I think there shouldn't be any significant difference.
Upvotes: 0
Views: 199
Reputation: 338
F1-score is the harmonic mean of the precision and recall and his formula is given by :
TP/(TP + 1/2(FP + FN)).More details here: https://en.wikipedia.org/wiki/F-score .
So as you can observe there is not much symmetry in the formula and is biased towards the True Positives. What about accuracy ?
Upvotes: 1