Skip to content

Commit

Permalink
Fixed incorrect feature mismatch error message (#6949)
Browse files Browse the repository at this point in the history
data.shape[0] denotes the number of samples, data.shape[1] is the number of features
  • Loading branch information
vslaykovsky committed May 11, 2021
1 parent 90cd724 commit 2a9979e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python-package/xgboost/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1907,7 +1907,7 @@ def inplace_predict(
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):
Expand Down

0 comments on commit 2a9979e

Please sign in to comment.