Fixed incorrect feature mismatch error message (#6949)

data.shape[0] denotes the number of samples, data.shape[1] is the number of features
This commit is contained in:
vslaykovsky 2021-05-11 06:52:11 +01:00 committed by GitHub
parent 90cd724be1
commit 2a9979e256
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1907,7 +1907,7 @@ class Booster(object):
if len(data.shape) != 1 and self.num_features() != data.shape[1]:
raise ValueError(
f"Feature shape mismatch, expected: {self.num_features()}, "
f"got {data.shape[0]}"
f"got {data.shape[1]}"
)
if isinstance(data, np.ndarray):