From 374648c21aa1212c17af0e6299bb13474da3e49f Mon Sep 17 00:00:00 2001 From: mitama <33838461+nigimitama@users.noreply.github.com> Date: Sun, 10 Nov 2019 02:58:14 +0900 Subject: [PATCH] Add better error message for invalid feature names (#5024) --- python-package/xgboost/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-package/xgboost/core.py b/python-package/xgboost/core.py index 8387fcf98..444d36ece 100644 --- a/python-package/xgboost/core.py +++ b/python-package/xgboost/core.py @@ -999,7 +999,7 @@ class DMatrix(object): if not all(isinstance(f, STRING_TYPES) and not any(x in f for x in set(('[', ']', '<'))) for f in feature_names): - raise ValueError('feature_names may not contain [, ] or <') + raise ValueError('feature_names must be string, and may not contain [, ] or <') else: # reset feature_types also self.feature_types = None