code: def plot_lift(df_list, colors, title):
      fig = go.Figure()
      grid_points = 101
      idx = np.arange(
          df_list[0].shape[0],
          step=int(df_list[0].shape[0] / grid_points),
      )
      _temp_df = pd.concat(df_list)
      max_lift = _temp_df.y.sum() / _temp_df.shape[0]
  
      for i, _df in enumerate(df_list):
          _df = _df.sort_values("y_hat", ascending=False)
          n = _df.shape[0]
          lift = np.cumsum(_df.y) / n
          pr = np.linspace(0, 1, n)
          _df = _df.assign(lift=lift / pr, pr=pr)
          if _df.shape[0] > grid_points:
              _df = _df.iloc[idx, :].sort_values("pr", ascending=True)
  
          fig.add_scatter(
              x=_df.pr,
              y=_df.lift / max_lift,
              line_shape="hv",
              name=_df.iloc[0, _df.columns.get_loc("label")],
              marker=dict(color=colors[i]),
          )
  
      fig.update_yaxes(
          {
              "type": "linear",
              "gridwidth": 2,
              "zeroline": False,
              "automargin": True,
              "ticks": "outside",
              "tickcolor": "white",
              "ticklen": 10,
              "fixedrange": True,
              "title_text": "Lift",
          }
      )
  
      fig.update_xaxes(
          {
              "type": "linear",
              "gridwidth": 2,
              "zeroline": False,
              "automargin": True,
              "ticks": "outside",
              "tickcolor": "white",
              "ticklen": 10,
              "fixedrange": True,
              "title_text": "Positive rate",
          }
      )
      title = "LIFT chart" if title is None else title
      fig.update_layout(
          title_text=title,
          title_x=0.15,
          font={"color": "#371ea3"},
          template="none",
          margin={"t": 78, "b": 71, "r": 30},
      )
  
      return fig
  
imports: import numpy
  import pandas
  import plotly.graph_objects
label_desc: Use image node_id 4 for calling a global function with example usage: plot_lift(df_list, colors, title) and returns: fig