code: def _pred_autocorr(
      pred_label: pd.DataFrame, lag=1, **kwargs
  ) -> tuple:
      pred = pred_label.copy()
      pred["score_last"] = pred.groupby(level="instrument")[
          "score"
      ].shift(lag)
      ac = pred.groupby(level="datetime").apply(
          lambda x: x["score"]
          .rank(pct=True)
          .corr(x["score_last"].rank(pct=True))
      )
      _df = ac.to_frame("value")
      ac_figure = ScatterGraph(
          _df,
          layout=dict(
              title="Auto Correlation",
              xaxis=dict(
                  tickangle=45,
                  rangebreaks=kwargs.get(
                      "rangebreaks", guess_plotly_rangebreaks(_df.index)
                  ),
              ),
          ),
      ).figure
      return (ac_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 4 for calling a global function with example usage: _pred_autocorr(pred_label, lag) and returns: ac_figure