Skip to content

Commit

Permalink
Merge pull request #457 from zhupr/fix_XGBoost_predict_error
Browse files Browse the repository at this point in the history
fix XGBoost predict error
  • Loading branch information
you-n-g committed Jun 2, 2021
2 parents 4ff0c4f + b2fe238 commit 6489674
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion qlib/contrib/model/xgboost.py
Expand Up @@ -62,7 +62,7 @@ def predict(self, dataset: DatasetH, segment: Union[Text, slice] = "test"):
if self.model is None:
raise ValueError("model is not fitted yet!")
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:
"""get feature importance
Expand Down

0 comments on commit 6489674

Please sign in to comment.