class_docstr: A parent class for X-learner classifier classes.
class_docstr_tok: ["A","parent","class","for","X-learner","classifier","classes","."]
docstr: Initialize an X-learner classifier.
  
  Args:
      outcome_learner (optional): a model to estimate outcomes in both the control and treatment groups.
          Should be a classifier.
      effect_learner (optional): a model to estimate treatment effects in both the control and treatment groups.
          Should be a regressor.
      control_outcome_learner (optional): a model to estimate outcomes in the control group.
          Should be a classifier.
      treatment_outcome_learner (optional): a model to estimate outcomes in the treatment group.
          Should be a classifier.
      control_effect_learner (optional): a model to estimate treatment effects in the control group.
          Should be a regressor.
      treatment_effect_learner (optional): a model to estimate treatment effects in the treatment group
          Should be a regressor.
      ate_alpha (float, optional): the confidence level alpha of the ATE estimate
      control_name (str or int, optional): name of control group
docstr_tok: ["Initialize","an","X-learner","classifier",".","Args",":","outcome_learner","(","optional",")",":","a","model","to","estimate","outcomes","in","both","the","control","and","treatment","groups",".","Should","be","a","classifier",".","effect_learner","(","optional",")",":","a","model","to","estimate","treatment","effects","in","both","the","control","and","treatment","groups",".","Should","be","a","regressor",".","control_outcome_learner","(","optional",")",":","a","model","to","estimate","outcomes","in","the","control","group",".","Should","be","a","classifier",".","treatment_outcome_learner","(","optional",")",":","a","model","to","estimate","outcomes","in","the","treatment","group",".","Should","be","a","classifier",".","control_effect_learner","(","optional",")",":","a","model","to","estimate","treatment","effects","in","the","control","group",".","Should","be","a","regressor",".","treatment_effect_learner","(","optional",")",":","a","model","to","estimate","treatment","effects","in","the","treatment","group","Should","be","a","regressor",".","ate_alpha","(","float",",","optional",")",":","the","confidence","level","alpha","of","the","ATE","estimate","control_name","(","str","or","int",",","optional",")",":","name","of","control","group"]
code: def __init__(
      self,
      outcome_learner=None,
      effect_learner=None,
      control_outcome_learner=None,
      treatment_outcome_learner=None,
      control_effect_learner=None,
      treatment_effect_learner=None,
      ate_alpha=0.05,
      control_name=0,
  ):
      """Initialize an X-learner classifier.
  
      Args:
          outcome_learner (optional): a model to estimate outcomes in both the control and treatment groups.
              Should be a classifier.
          effect_learner (optional): a model to estimate treatment effects in both the control and treatment groups.
              Should be a regressor.
          control_outcome_learner (optional): a model to estimate outcomes in the control group.
              Should be a classifier.
          treatment_outcome_learner (optional): a model to estimate outcomes in the treatment group.
              Should be a classifier.
          control_effect_learner (optional): a model to estimate treatment effects in the control group.
              Should be a regressor.
          treatment_effect_learner (optional): a model to estimate treatment effects in the treatment group
              Should be a regressor.
          ate_alpha (float, optional): the confidence level alpha of the ATE estimate
          control_name (str or int, optional): name of control group
      """
      if outcome_learner is not None:
          control_outcome_learner = outcome_learner
          treatment_outcome_learner = outcome_learner
      if effect_learner is not None:
          control_effect_learner = effect_learner
          treatment_effect_learner = effect_learner
  
      super().__init__(
          learner=None,
          control_outcome_learner=control_outcome_learner,
          treatment_outcome_learner=treatment_outcome_learner,
          control_effect_learner=control_effect_learner,
          treatment_effect_learner=treatment_effect_learner,
          ate_alpha=ate_alpha,
          control_name=control_name,
      )
  
      if (
          (control_outcome_learner is None)
          or (treatment_outcome_learner is None)
      ) and (
          (control_effect_learner is None)
          or (treatment_effect_learner is None)
      ):
          raise ValueError(
              "Either the outcome learner or the effect learner pair must be specified."
          )
  
imports: from copy import deepcopy
  import logging
  import numpy
  import pandas
  from tqdm import tqdm
  from scipy.stats import norm
  from causalml.inference.meta.base import BaseLearner
  from causalml.inference.meta.utils import check_treatment_vector, check_p_conditions, convert_pd_to_np
  from causalml.inference.meta.explainer import Explainer
  from causalml.metrics import regression_metrics, classification_metrics
  from causalml.propensity import compute_propensity_score
label_desc: Use image node_id 1 to create a new BaseXClassifier object from inherited base classes: BaseXLearner with example: obj = BaseXClassifier(outcome_learner, effect_learner, control_outcome_learner, treatment_outcome_learner, control_effect_learner, treatment_effect_learner, ate_alpha, control_name)