I have trained an xgboost classifier with categorical features that I have previously one hot encoded. For example, I have a categorical feature 'Year' which takes values between 2014 and 2018. When OHEd I get 5 binary features: Year_2014, Year_2015, Year_2016, Year_2017, Year_2018. What happens if I make a prediction on a sample that has Year=2019 since the feature Year_2019 does not exist?
More generally, what is a robust way to transform data in order to make predictions on a new samples?