code: def _pred_ic(
      pred_label: pd.DataFrame = None,
      methods: Sequence[Literal["IC", "Rank IC"]] = ("IC", "Rank IC"),
      **kwargs,
  ) -> tuple:
      """
  
      :param pred_label: pd.DataFrame
      must contain one column of realized return with name `label` and one column of predicted score names `score`.
      :param methods: Sequence[Literal["IC", "Rank IC"]]
      IC series to plot.
      IC is sectional pearson correlation between label and score
      Rank IC is the spearman correlation between label and score
      For the Monthly IC, IC histogram, IC Q-Q plot.  Only the first type of IC will be plotted.
      :return:
      """
      _methods_mapping = {"IC": "pearson", "Rank IC": "spearman"}
  
      def _corr_series(x, method):
          return x["label"].corr(x["score"], method=method)
  
      ic_df = pd.concat(
          [
              pred_label.groupby(level="datetime")
              .apply(partial(_corr_series, method=_methods_mapping[m]))
              .rename(m)
              for m in methods
          ],
          axis=1,
      )
      _ic = ic_df.iloc(axis=1)[0]
  
      _index = (
          _ic.index.get_level_values(0)
          .astype("str")
          .str.replace("-", "")
          .str.slice(0, 6)
      )
      _monthly_ic = _ic.groupby(_index).mean()
      _monthly_ic.index = pd.MultiIndex.from_arrays(
          [
              _monthly_ic.index.str.slice(0, 4),
              _monthly_ic.index.str.slice(4, 6),
          ],
          names=["year", "month"],
      )
  
      # fill month
      _month_list = pd.date_range(
          start=pd.Timestamp(f"{_index.min()[:4]}0101"),
          end=pd.Timestamp(f"{_index.max()[:4]}1231"),
          freq="1M",
      )
      _years = []
      _month = []
      for _date in _month_list:
          _date = _date.strftime("%Y%m%d")
          _years.append(_date[:4])
          _month.append(_date[4:6])
  
      fill_index = pd.MultiIndex.from_arrays(
          [_years, _month], names=["year", "month"]
      )
  
      _monthly_ic = _monthly_ic.reindex(fill_index)
  
      ic_bar_figure = ic_figure(
          ic_df, kwargs.get("show_nature_day", False)
      )
  
      ic_heatmap_figure = HeatmapGraph(
          _monthly_ic.unstack(),
          layout=dict(
              title="Monthly IC",
              xaxis=dict(dtick=1),
              yaxis=dict(tickformat="04d", dtick=1),
          ),
          graph_kwargs=dict(xtype="array", ytype="array"),
      ).figure
  
      dist = stats.norm
      _qqplot_fig = _plot_qq(_ic, dist)
  
      if isinstance(dist, stats.norm.__class__):
          dist_name = "Normal"
      else:
          dist_name = "Unknown"
  
      _ic_df = _ic.to_frame("IC")
      _bin_size = ((_ic_df.max() - _ic_df.min()) / 20).min()
      _sub_graph_data = [
          (
              "IC",
              dict(
                  row=1,
                  col=1,
                  name="",
                  kind="DistplotGraph",
                  graph_kwargs=dict(bin_size=_bin_size),
              ),
          ),
          (_qqplot_fig, dict(row=1, col=2)),
      ]
      ic_hist_figure = SubplotsGraph(
          _ic_df.dropna(),
          kind_map=dict(kind="HistogramGraph", kwargs=dict()),
          subplots_kwargs=dict(
              rows=1,
              cols=2,
              print_grid=False,
              subplot_titles=["IC", "IC %s Dist. Q-Q" % dist_name],
          ),
          sub_graph_data=_sub_graph_data,
          layout=dict(
              yaxis2=dict(title="Observed Quantile"),
              xaxis2=dict(title=f"{dist_name} Distribution Quantile"),
          ),
      ).figure
  
      return ic_bar_figure, ic_heatmap_figure, ic_hist_figure
  
file_path: qlib/qlib/contrib/report/analysis_model/analysis_model_performance.py
imports: from functools import partial
  import pandas
  import plotly.graph_objs
  import statsmodels.api
  import matplotlib.pyplot
  from scipy import stats
  from typing import Sequence
  from qlib.typehint import Literal
  from ..graph import ScatterGraph, SubplotsGraph, BarGraph, HeatmapGraph
  from ..utils import guess_plotly_rangebreaks
label_desc: Use image node_id 3 for calling a global function with example usage: _pred_ic(pred_label, methods) and returns: ic_bar_figure,  ic_heatmap_figure,  ic_hist_figure, x