diff --git a/python-package/xgboost/core.py b/python-package/xgboost/core.py index 8f6e560e4a8c..dff608ce1ff6 100644 --- a/python-package/xgboost/core.py +++ b/python-package/xgboost/core.py @@ -3129,7 +3129,7 @@ def _validate_features(self, feature_names: Optional[FeatureNames]) -> None: if feature_names is None and self.feature_names is not None: raise ValueError( - "training data did not have the following fields: " + "data did not contain feature names, but the following fields are expected: " + ", ".join(self.feature_names) )