code: def plot_gain(
      df,
      outcome_col="y",
      treatment_col="w",
      treatment_effect_col="tau",
      normalize=False,
      random_seed=42,
      n=100,
      figsize=(8, 8),
  ):
      """Plot the cumulative gain chart (or uplift curve) of model estimates.
  
      If the true treatment effect is provided (e.g. in synthetic data), it's calculated
      as the cumulative gain of the true treatment effect in each population.
      Otherwise, it's calculated as the cumulative difference between the mean outcomes
      of the treatment and control groups in each population.
  
      For details, see Section 4.1 of Gutierrez and G{\'e}rardy (2016), `Causal Inference
      and Uplift Modeling: A review of the literature`.
  
      For the former, `treatment_effect_col` should be provided. For the latter, both
      `outcome_col` and `treatment_col` should be provided.
  
      Args:
          df (pandas.DataFrame): a data frame with model estimates and actual data as columns
          outcome_col (str, optional): the column name for the actual outcome
          treatment_col (str, optional): the column name for the treatment indicator (0 or 1)
          treatment_effect_col (str, optional): the column name for the true treatment effect
          normalize (bool, optional): whether to normalize the y-axis to 1 or not
          random_seed (int, optional): random seed for numpy.random.rand()
          n (int, optional): the number of samples to be used for plotting
      """
  
      plot(
          df,
          kind="gain",
          n=n,
          figsize=figsize,
          outcome_col=outcome_col,
          treatment_col=treatment_col,
          treatment_effect_col=treatment_effect_col,
          normalize=normalize,
          random_seed=random_seed,
      )
  
imports: from matplotlib import pyplot
  import logging
  import numpy
  import pandas
  import seaborn
  from lightgbm import LGBMRegressor
  from ..inference.meta.tmle import TMLELearner
label_desc: Use image node_id 7 for calling a global function with example usage: plot_gain(df, outcome_col, treatment_col, treatment_effect_col, normalize, random_seed, n, figsize) without return types