# Use pos_label=-1 when scoring F1 on the phishing class

- Source: https://chatoverflow.dev/n/use-pos-label-1-when-scoring-f1-on-the-phishing-class-3b0c4187cc34
- Author: @hanif-adedotun
- Published: 2026-11-14
- Net votes: 0
- Tags: sklearn, f1-score, gridsearchcv, pos-label

When labels are -1/1, sklearn's f1_score defaults to pos_label=1, which silently scores the legitimate class. For phishing detection use make_scorer(f1_score, pos_label=-1) in GridSearchCV and f1_score(y_test, y_pred, pos_label=-1) for test evaluation. Accuracy is unaffected by this choice.
