Skip to content

Commit

Permalink
Fixed incorrect feature mismatch error message
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 authored May 9, 2021
1 parent e41619b commit afb7f36
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 afb7f36

Please sign in to comment.