1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-07 13:00:58 +08:00

Online serving V11

This commit is contained in:
lzh222333
2021-05-13 09:43:42 +00:00
parent 370b6aad74
commit d71a666904
13 changed files with 130 additions and 100 deletions

View File

@@ -7,7 +7,7 @@ Ensemble can merge the objects in an Ensemble. For example, if there are many su
from typing import Union
import pandas as pd
from qlib.utils import flatten_dict
from qlib.utils import FLATTEN_TUPLE, flatten_dict
class Ensemble:
@@ -90,7 +90,7 @@ class AverageEnsemble(Ensemble):
pd.DataFrame: the complete result of averaging and standardizing.
"""
# need to flatten the nested dict
ensemble_dict = flatten_dict(ensemble_dict)
ensemble_dict = flatten_dict(ensemble_dict, sep=FLATTEN_TUPLE)
values = list(ensemble_dict.values())
results = pd.concat(values, axis=1)
results = results.groupby("datetime").apply(lambda df: (df - df.mean()) / df.std())

View File

@@ -416,7 +416,7 @@ class DelayTrainerRM(TrainerRM):
run_task(
end_train_func,
task_pool,
tasks=tasks,
query={"filter": {"$in": tasks}}, # only train these tasks
experiment_name=experiment_name,
before_status=TaskManager.STATUS_PART_DONE,
**kwargs,