mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-14 16:26:55 +08:00
Merge pull request #457 from zhupr/fix_XGBoost_predict_error
fix XGBoost predict error
This commit is contained in:
@@ -62,7 +62,7 @@ class XGBModel(Model, FeatureInt):
|
|||||||
if self.model is None:
|
if self.model is None:
|
||||||
raise ValueError("model is not fitted yet!")
|
raise ValueError("model is not fitted yet!")
|
||||||
x_test = dataset.prepare(segment, col_set="feature", data_key=DataHandlerLP.DK_I)
|
x_test = dataset.prepare(segment, col_set="feature", data_key=DataHandlerLP.DK_I)
|
||||||
return pd.Series(self.model.predict(xgb.DMatrix(x_test.values)), index=x_test.index)
|
return pd.Series(self.model.predict(xgb.DMatrix(x_test)), index=x_test.index)
|
||||||
|
|
||||||
def get_feature_importance(self, *args, **kwargs) -> pd.Series:
|
def get_feature_importance(self, *args, **kwargs) -> pd.Series:
|
||||||
"""get feature importance
|
"""get feature importance
|
||||||
|
|||||||
Reference in New Issue
Block a user