`def ensemble_predict(self, X):
pred = 0
pred = self.models.predict(X)
return pred`
when I run this code, it says an error that
File “C:UsersA701DesktopInteractive_BrokersoptBacktest.py”, line 107, in ensemble_predict
pred = self.models.predict(X)
^^^^^^^^^^^^^^^^^^^^^^
File “C:UsersA701AppDataLocalProgramsPythonPython312Libsite-packageslightgbmsklearn.py”, line 934, in predict
X = _LGBMCheckArray(X, accept_sparse=True, force_all_finite=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: ‘NoneType’ object is not callable
where self.models is the model that I loaded like below
filename = r'C:UsersA701DesktopInteractive_BrokersoptIB_modelslightgbm_gbdt.pkl' primary_model_gbdt = pickle.load(open(filename, 'rb'))
and X doesn’t contain None, they are all ndarry.
X is [2.6159766716111363, 2.4483956767568733, 2.692917925657378, 2.5808175637375217, 127.89875813800386, 0.5692777893421993, 0.9088064930300315, 0.5526142101612531, 0.6500143468826425, 0.6504005704144723, 0.4884784774903833, 2.8744331824520826, 0.6913665974219791, 0.6715723399768349, 0.7953029386800459, 2.057442547135793, 1.2525877211668754, 1.5806353474541444, 2.559484010975871, 2.5704646661063477, 7.490915881539134, 6.889795848464637, 8.735770671088861, 5.946552444885259, 8.250904837475264, 10.79290567766621, 12.826471599022632, 1.8729948357836845, 2.008380927141882, 1.1591949941204602, 2.5520400572250783, 2.5575418970780657, 1.7277785590416246, 1.761068514135367, 0.9868421052631579, 0, 0.9933774834437086, 0.0, 1.9867549668874172, 0.9803921568627451, 0.2341261667647434, 35.35533905932738, 0.23101943403004202, 0.22958012376186607, 0.7024239548210738, 0.23704401899359276, 1.359465128474043, 0.1119234953202089, -0.025364428965838154, -0.06851617594215026, -0.06495664074127402, -0.13863726972216345, 0.2218149697875059, -0.011183236829457146, 0.19314074533054254, -0.10453918119902789, 0.26280343112688276, 0.15756671592458402, -0.23361545795444705, -0.2735355010207475, 0.1802530896270063, 0.027922834247546015, 0.29305972443439504, 0.02317306503436231, -0.009131398721373685, -0.31469458492473973, 0.804435395372057, 0.679436753682727, 0.8142124513700574, 0.8435987557567071, 136.3638003033591, 1.1546752407662528, 0.673958910693411, 1.3146591102846445, 1.363800525370234, 3.4663615834903503, 3.8167556284590405, 2.2101766736852015, 1.5677956316141306, 0.28807979232320546, 0.5761595846464109, 7.778154392726547]
my lightgbm version is 4.3.0 and my python version is 3.11.9