Skip to content
Quantoros

Fraud is encoded as 0 rather than 1. What can go wrong when tuning a threshold with the default F1 scorer?

Classic MLLevel: IntermediatePositive label configuration

Fraud is encoded as 0 rather than 1. What can go wrong when tuning a threshold with the default F1 scorer?

Hints
  • A numeric code is not business meaning.
  • The scorer carries its own label convention.

Answer

The scorer may optimize the wrong positive class. Build a scorer with the intended pos_label and confirm that decision scores and probabilities are interpreted consistently.

Source and licence: scikit-learn 1.7.2 — classification threshold · BSD-3-Clause · answer: Quantoros editorial

Related questions