class_docstr: Args
  ----
  treatment : array, shape = (num_samples, )
      An array of treatment group indicator values.
  
  control_name : string
      The name of the control condition as a string. Must be contained in the treatment array.
  
  treatment_names : list, length = cate.shape[1]
      A list of treatment group names. NB: The order of the items in the
      list must correspond to the order in which the conditional average
      treatment effect estimates are in cate_array.
  
  y_proba : array, shape = (num_samples, )
      The predicted probability of conversion using the Y ~ X model across
      the total sample.
  
  cate : array, shape = (num_samples, len(set(treatment)))
      Conditional average treatment effect estimations from any model.
  
  value : array, shape = (num_samples, )
      Value of converting each unit.
  
  conversion_cost : shape = (num_samples, len(set(treatment)))
      The cost of a treatment that is triggered if a unit converts after having been in the treatment, such as a promotion code.
  
  impression_cost : shape = (num_samples, len(set(treatment)))
     The cost of a treatment that is the same for each unit whether or not they convert, such as a cost associated with a promotion channel.
  
  
  Notes
  -----
  Because we get the conditional average treatment effects from
  cate-learners relative to the control condition, we subtract the
  cate for the unit in their actual treatment group from y_proba for that
  unit, in order to recover the control outcome. We then add the cates
  to the control outcome to obtain y_proba under each condition. These
  outcomes are counterfactual because just one of them is actually
  observed.
docstr: Get an array of counterfactual outcomes based on control outcome and
  the array of conditional average treatment effects.
docstr_tok: ["Get","an","array","of","counterfactual","outcomes","based","on","control","outcome","and","the","array","of","conditional","average","treatment","effects","."]
code: def _get_counterfactuals(self):
      """
      Get an array of counterfactual outcomes based on control outcome and
      the array of conditional average treatment effects.
      """
      conditions = self.treatment_names.copy()
      conditions.insert(0, self.control_name)
      cates_with_control = np.c_[
          np.zeros(self.cate.shape[0]), self.cate
      ]
      cates_flat = cates_with_control.flatten()
  
      cates_filt = [
          actual_group == poss_group
          for actual_group in self.treatment
          for poss_group in conditions
      ]
  
      control_outcome = self.y_proba - cates_flat[cates_filt]
      self.counterfactuals = (
          cates_with_control + control_outcome[:, None]
      )
  
imports: import numpy
label_desc: Use image node_id 4 for calling the CounterfactualValueEstimator obj's underlying member method code with example usage: obj._get_counterfactuals() without return types