Why is strictshape useful when one serving wrapper supports both binary and multiclass XGBoost models?
Classic MLLevel: IntermediateXGBoost · Prediction
Why is strict_shape useful when one serving wrapper supports both binary and multiclass XGBoost models?
Hints
- A one-class-width axis may otherwise disappear.
- Stable tensor rank is part of the API contract.
Answer
It makes output axes explicit, avoiding accidental squeezing of the group/class dimension. Still validate the expected number of groups and special prediction mode; a consistent rank does not guarantee correct label mapping.
Source and licence: XGBoost · Prediction · Apache-2.0 · answer: Quantoros editorial