Skip to content

Commit

Permalink
fix XGBoost predict error
Browse files Browse the repository at this point in the history
  • Loading branch information
zhupr committed Jun 1, 2021
1 parent ef11a9d commit b2fe238
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 b2fe238

Please sign in to comment.