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.
docstr: Fits two classifiers to estimate conversion probabilities conditional
  on the treatment.
docstr_tok: ["Fits","two","classifiers","to","estimate","conversion","probabilities","conditional","on","the","treatment","."]
code: def _fit_condprob_models(self, data, treatment, outcome):
      """
      Fits two classifiers to estimate conversion probabilities conditional
      on the treatment.
      """
  
      trt_learner = clone(self.learner)
      ctr_learner = clone(self.learner)
  
      treated = data[treatment] == 1
  
      X = data.drop([treatment, outcome], axis=1)
      y = data[outcome]
  
      self.trt_model = trt_learner.fit(X[treated], y[treated])
      self.ctr_model = ctr_learner.fit(X[~treated], y[~treated])
  
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 7 for calling the CounterfactualUnitSelector obj's underlying member method code with example usage: obj._fit_condprob_models(data, treatment, outcome) without return types