Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn when _validate_features sets feature_names #4937

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions python-package/xgboost/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1819,6 +1819,9 @@ def _validate_features(self, data):
Set feature_names and feature_types from DMatrix
"""
if self.feature_names is None:
warnings.warn("Booster's feature_names did not exist. Booster's "
"feature_names and feature_types are being set to "
"match the data.")
self.feature_names = data.feature_names
self.feature_types = data.feature_types
else:
Expand Down