From 2a9979e256bbead2f364ac8698a890ba9a1e004a Mon Sep 17 00:00:00 2001 From: vslaykovsky <80761478+vslaykovsky@users.noreply.github.com> Date: Tue, 11 May 2021 06:52:11 +0100 Subject: [PATCH] Fixed incorrect feature mismatch error message (#6949) data.shape[0] denotes the number of samples, data.shape[1] is the number of features --- 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 227f0bdeea43..18090a3acc87 100644 --- a/python-package/xgboost/core.py +++ b/python-package/xgboost/core.py @@ -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):