Add better error message for invalid feature names (#5024)
This commit is contained in:
parent
7663de956c
commit
374648c21a
@ -999,7 +999,7 @@ class DMatrix(object):
|
|||||||
if not all(isinstance(f, STRING_TYPES) and
|
if not all(isinstance(f, STRING_TYPES) and
|
||||||
not any(x in f for x in set(('[', ']', '<')))
|
not any(x in f for x in set(('[', ']', '<')))
|
||||||
for f in feature_names):
|
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:
|
else:
|
||||||
# reset feature_types also
|
# reset feature_types also
|
||||||
self.feature_types = None
|
self.feature_types = None
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user