From 68b6d6bbe2fc8acb84c8a54e5ec28f6f3ff3353c Mon Sep 17 00:00:00 2001 From: Pradipta Ghosh <37842314+pradghos@users.noreply.github.com> Date: Thu, 3 Mar 2022 19:06:29 +0530 Subject: [PATCH] Fix for Feature shape mismatch error (#7715) --- 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 0f528270a..cfe7058b0 100644 --- a/python-package/xgboost/core.py +++ b/python-package/xgboost/core.py @@ -2242,7 +2242,7 @@ class Booster: def num_features(self) -> int: '''Number of features in booster.''' - features = ctypes.c_int() + features = c_bst_ulong() assert self.handle is not None _check_call(_LIB.XGBoosterGetNumFeature(self.handle, ctypes.byref(features))) return features.value