class_docstr: A highly experimental implementation of the counterfactual unit selection
  model proposed by Li and Pearl (2019).
  
  Parameters
  ----------
  learner : object
      The base learner used to estimate the segment probabilities.
  
  nevertaker_payoff : float
      The payoff from targeting a never-taker
  
  alwaystaker_payoff : float
      The payoff from targeting an always-taker
  
  complier_payoff : float
      The payoff from targeting a complier
  
  defier_payoff : float
      The payoff from targeting a defier
  
  organic_conversion : float, optional (default=None)
      The organic conversion rate in the population without an intervention.
      If None, the organic conversion rate is obtained from tne control group.
  
      NB: The organic conversion in the control group is not always the same
      as the organic conversion rate without treatment.
  
  data : DataFrame
      A pandas DataFrame containing the features, treatment assignment
      indicator and the outcome of interest.
  
  treatment : string
      A string corresponding to the name of the treatment column. The
      assumed coding in the column is 1 for treatment and 0 for control.
  
  outcome : string
      A string corresponding to the name of the outcome column. The assumed
      coding in the column is 1 for conversion and 0 for no conversion.
  
  References
  ----------
  Li, Ang, and Judea Pearl. 2019. “Unit Selection Based on Counterfactual
  Logic.” https://ftp.cs.ucla.edu/pub/stat_ser/r488.pdf.
code: def __init__(
      self,
      learner,
      nevertaker_payoff,
      alwaystaker_payoff,
      complier_payoff,
      defier_payoff,
      organic_conversion=None,
  ):
      self.learner = learner
      self.nevertaker_payoff = nevertaker_payoff
      self.alwaystaker_payoff = alwaystaker_payoff
      self.complier_payoff = complier_payoff
      self.defier_payoff = defier_payoff
      self.organic_conversion = organic_conversion
  
file_path: causalml/causalml/optimize/unit_selection.py
imports: import numpy
  import pandas
  from sklearn.base import clone
  import warnings
label_desc: Use image node_id 1 to create a new CounterfactualUnitSelector object  with example: obj = CounterfactualUnitSelector(learner, nevertaker_payoff, alwaystaker_payoff, complier_payoff, defier_payoff, organic_conversion)