XGBoost categorical missing values with one-hot-encoding

I am unclear on how to let XGBoost handle missing categorical data. I can’t have null values when I one-hot-encode the data. How can I use one-hot-encoding and let XGBoost handle the NaN values.

To encode a missing value for a categorical value, you should set all of the corresponding binary dummy variables as missing.

2 Likes