Skip to content
Quantoros

A binary XGBoost service returns values below zero with outputmargin=True. Is the probability model necessarily broken?

Classic MLLevel: IntermediateXGBoost · Prediction

A binary XGBoost service returns values below zero with output_margin=True. Is the probability model necessarily broken?

Hints
  • Ask which space the output lives in.
  • The objective determines the link.

Answer

No: margins are pre-link scores and can be negative. Apply the objective-appropriate link, such as sigmoid for standard binary logistic loss; custom objectives may require a different transformation.

Source and licence: XGBoost · Prediction · Apache-2.0 · answer: Quantoros editorial

Related questions