I have trained an XGBoostRegressor model. When I have to use this trained model for predicting for a new input, the predict() function throws a feature_names mismatch error,
From what I could find, the predict function does not take the DataFrame (or a sparse matrix) as input. It is one of the bugs which can be found here https://github.com/dmlc/xgboost/issues/1238
In order to get around this issue, use as_matrix() function in case of a DataFrame or toarray() in case of a sparse matrix.
This is the only workaround till the bug is fixed or the feature is implemented in a different manner.