Skip to content

Commit

Permalink
Merge pull request microsoft#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 authored Jun 2, 2021
2 parents b5e5e26 + 514268b commit 5f237c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion qlib/contrib/model/xgboost.py
Original file line number Diff line number Diff line change
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 5f237c9

Please sign in to comment.