Feature_names mismatch Python

When predicting with XGBoost on python:

y_pred = regressor.predict(X_test)

using the following sample:

array([[14215171477565733550]], dtype=uint64)

I get this error:

ValueError: feature_names mismatch: ['0'] ['f0']
expected 0 in input data
training data did not have the following fields: f0

Any clue?

Which XGBoost version are you using? The feature name is obtained from training data like pandas dataframe. If the training data is structures like np.ndarray, in old version of XGBoost it’s generated while in latest version the booster doesn’t have feature names when training input is np.ndarray.

The XGBoost version is 0.90. And X_test is a np.numpy, should I update XGBoost? Or convert X_test to pandas?

You can specify validate_features to False if you are confident that your input is correct. But upgrading XGBoost is always encouraged. :slight_smile:

how do I use validate_features?