Skip to content

Commit

Permalink
Update ensemble.py (microsoft#560)
Browse files Browse the repository at this point in the history
  • Loading branch information
demon143 authored Aug 14, 2021
1 parent 7ecba43 commit f5fb8bc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions qlib/model/ens/ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,20 @@ class AverageEnsemble(Ensemble):
"""

def __call__(self, ensemble_dict: dict) -> pd.DataFrame:
"""using sample:
from qlib.model.ens.ensemble import AverageEnsemble
pred_res['new_key_name'] = AverageEnsemble()(predict_dict)
Parameters
----------
ensemble_dict : dict
Dictionary you want to ensemble
Returns
-------
pd.DataFrame
The dictionary including ensenbling result
"""
# need to flatten the nested dict
ensemble_dict = flatten_dict(ensemble_dict, sep=FLATTEN_TUPLE)
values = list(ensemble_dict.values())
Expand Down

0 comments on commit f5fb8bc

Please sign in to comment.