From afb7f3675057613a515263364c6396219b0ce23a Mon Sep 17 00:00:00 2001 From: vslaykovsky <80761478+vslaykovsky@users.noreply.github.com> Date: Sun, 9 May 2021 11:48:21 +0100 Subject: [PATCH] Fixed incorrect feature mismatch error message 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):