1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-06-06 05:51:17 +08:00

Update benchmark based on new backtest (#634)

* free random seed

* update model baselines

* more robust for parameters
This commit is contained in:
you-n-g
2021-10-07 22:57:19 +08:00
committed by GitHub
parent 8c8d1336de
commit e99224e5c2
12 changed files with 229 additions and 199 deletions

View File

@@ -195,7 +195,8 @@ class Alpha158Formatter(GenericDataFormatter):
for col in column_names:
if col not in {"forecast_time", "identifier"}:
output[col] = self._target_scaler.inverse_transform(predictions[col])
# Using [col] is for aligning with the format when fitting
output[col] = self._target_scaler.inverse_transform(predictions[[col]])
return output

View File

@@ -311,5 +311,11 @@ class TFTModel(ModelFT):
# self.model.save(path)
# save qlib model wrapper
self.model = None
drop_attrs = ["model", "tf_graph", "sess", "data_formatter"]
orig_attr = {}
for attr in drop_attrs:
orig_attr[attr] = getattr(self, attr)
setattr(self, attr, None)
super(TFTModel, self).to_pickle(path)
for attr in drop_attrs:
setattr(self, attr, orig_attr[attr])