Why are negative or fractional category IDs risky when passed to LightGBM as categorical features?
Classic MLLevel: IntermediateLightGBM · Advanced topics
Why are negative or fractional category IDs risky when passed to LightGBM as categorical features?
Hints
- Inspect conversion before the split algorithm sees values.
- Two inputs may map to one code.
Answer
Negative IDs are treated as missing, and fractional values are truncated toward zero. Distinct intended categories can collapse or disappear; validate nonnegative integer codes and their supported range.
Source and licence: LightGBM · Advanced topics · MIT · answer: Quantoros editorial