class_docstr: Average and standardize a dict of same shape dataframe like `prediction` or `IC` into an ensemble.
  
  NOTE: The values of dict must be pd.DataFrame, and have the index "datetime". If it is a nested dict, then flat it.
  
  When calling this class:
  
      Args:
          ensemble_dict (dict): a dict like {"A": pd.DataFrame, "B": pd.DataFrame}.
          The key of the dict will be ignored.
  
      Returns:
          pd.DataFrame: the complete result of averaging and standardizing.
class_docstr_tok: ["Average","and","standardize","a","dict","of","same","shape","dataframe","like","`","prediction","`","or","`","IC","`","into","an","ensemble",".","NOTE",":","The","values","of","dict","must","be","pd.DataFrame",",","and","have","the","index","``","datetime","''",".","If","it","is","a","nested","dict",",","then","flat","it",".","When","calling","this","class",":","Args",":","ensemble_dict","(","dict",")",":","a","dict","like","{","``","A","''",":","pd.DataFrame",",","``","B","''",":","pd.DataFrame","}",".","The","key","of","the","dict","will","be","ignored",".","Returns",":","pd.DataFrame",":","the","complete","result","of","averaging","and","standardizing","."]
docstr: 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
docstr_tok: ["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"]
code: 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)
      get_module_logger("AverageEnsemble").info(
          f"keys in group: {list(ensemble_dict.keys())}"
      )
      values = list(ensemble_dict.values())
      # NOTE: this may change the style underlying data!!!!
      # from pd.DataFrame to pd.Series
      results = pd.concat(values, axis=1)
      results = results.groupby("datetime").apply(
          lambda df: (df - df.mean()) / df.std()
      )
      results = results.mean(axis=1)
      results = results.sort_index()
      return results
  
file_path: qlib/qlib/model/ens/ensemble.py
imports: from typing import Union
  import pandas
  from qlib.utils import FLATTEN_TUPLE, flatten_dict
  from qlib.log import get_module_logger
label_desc: Use image node_id 1 for calling the AverageEnsemble obj's underlying member method code with example usage: obj.__call__(ensemble_dict) and returns: results