1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-16 17:12:20 +08:00

fix model when using single feature

This commit is contained in:
Dong Zhou
2020-11-24 21:03:52 +08:00
parent 73b280754d
commit e819879232
3 changed files with 4 additions and 4 deletions

View File

@@ -61,4 +61,4 @@ class XGBModel(Model):
if self.model is None:
raise ValueError("model is not fitted yet!")
x_test = dataset.prepare("test", col_set="feature")
return pd.Series(self.model.predict(xgb.DMatrix(np.squeeze(x_test.values))), index=x_test.index)
return pd.Series(self.model.predict(xgb.DMatrix(x_test.values)), index=x_test.index)