code: def cumulative_effect_curve(
      df: pd.DataFrame,
      treatment: str,
      outcome: str,
      prediction: str,
      min_rows: int = 30,
      steps: int = 100,
      effect_fn: EffectFnType = linear_effect,
  ) -> np.ndarray:
      """
      Orders the dataset by prediction and computes the cumulative effect curve according to that ordering
  
      Parameters
      ----------
      df : Pandas' DataFrame
          A Pandas' DataFrame with target and prediction scores.
  
      treatment : Strings
          The name of the treatment column in `df`.
  
      outcome : Strings
          The name of the outcome column in `df`.
  
      prediction : Strings
          The name of the prediction column in `df`.
  
      min_rows : Integer
          Minimum number of observations needed to have a valid result.
  
      steps : Integer
          The number of cumulative steps to iterate when accumulating the effect
  
      effect_fn : function (df: pandas.DataFrame, treatment: str, outcome: str) -> int or Array of int
          A function that computes the treatment effect given a dataframe, the name of the treatment column and the name
          of the outcome column.
  
  
      Returns
      ----------
      cumulative effect curve: Numpy's Array
          The cumulative treatment effect according to the predictions ordering.
      """
  
      size = df.shape[0]
      ordered_df = df.sort_values(
          prediction, ascending=False
      ).reset_index(drop=True)
      n_rows = list(range(min_rows, size, size // steps)) + [size]
      return np.array(
          [
              effect_fn(ordered_df.head(rows), treatment, outcome)
              for rows in n_rows
          ]
      )
  
file_path: fklearn/src/fklearn/causal/validation/curves.py
imports: from typing import List
  import numpy
  import pandas
  from toolz import curry, partial
  from fklearn.types import EffectFnType
  from fklearn.causal.effects import linear_effect
label_desc: Use image node_id 2 for calling a global function with example usage: cumulative_effect_curve(df, treatment, outcome, prediction, min_rows, steps, effect_fn) and returns: np