A feature engineering pipeline includes missing values in numerical and categorical columns. Which preprocessing choice is generally appropriate for categorical variables before training a tree-based model like XGBoost?

Answer

Use a strategy that converts categories to numeric representations (e.g., ordinal encoding) and handle missing explicitly

Explanation

Tree models require numeric inputs; encoding categoricals and treating missing values consistently prevents errors and improves learning stability.

Last reviewed: October 2026

Reviewed by FirstInTest Editorial Team

Report an error
QuestionBack to list