class_docstr: A parent class for T-learner regressor classes.
  
  A T-learner estimates treatment effects with two machine learning models.
  
  Details of T-learner are available at Kunzel et al. (2018) (https://arxiv.org/abs/1706.03461).
class_docstr_tok: ["A","parent","class","for","T-learner","regressor","classes",".","A","T-learner","estimates","treatment","effects","with","two","machine","learning","models",".","Details","of","T-learner","are","available","at","Kunzel","et","al",".","(","2018",")","(","https",":","\/\/arxiv.org\/abs\/1706.03461",")","."]
docstr: Initialize a T-learner.
  
  Args:
      learner (model): a model to estimate control and treatment outcomes.
      control_learner (model, optional): a model to estimate control outcomes
      treatment_learner (model, optional): a model to estimate treatment outcomes
      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","a","T-learner",".","Args",":","learner","(","model",")",":","a","model","to","estimate","control","and","treatment","outcomes",".","control_learner","(","model",",","optional",")",":","a","model","to","estimate","control","outcomes","treatment_learner","(","model",",","optional",")",":","a","model","to","estimate","treatment","outcomes","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,
      learner=None,
      control_learner=None,
      treatment_learner=None,
      ate_alpha=0.05,
      control_name=0,
  ):
      """Initialize a T-learner.
  
      Args:
          learner (model): a model to estimate control and treatment outcomes.
          control_learner (model, optional): a model to estimate control outcomes
          treatment_learner (model, optional): a model to estimate treatment outcomes
          ate_alpha (float, optional): the confidence level alpha of the ATE estimate
          control_name (str or int, optional): name of control group
      """
      assert (learner is not None) or (
          (control_learner is not None)
          and (treatment_learner is not None)
      )
  
      if control_learner is None:
          self.model_c = deepcopy(learner)
      else:
          self.model_c = control_learner
  
      if treatment_learner is None:
          self.model_t = deepcopy(learner)
      else:
          self.model_t = treatment_learner
  
      self.ate_alpha = ate_alpha
      self.control_name = control_name
  
imports: from copy import deepcopy
  import logging
  import numpy
  from packaging import version
  from scipy.stats import norm
  import sklearn
  from sklearn.exceptions import ConvergenceWarning
  from sklearn.neural_network import MLPRegressor
  from tqdm import tqdm
  from xgboost import XGBRegressor
  from causalml.inference.meta.base import BaseLearner
  from causalml.inference.meta.utils import check_treatment_vector, convert_pd_to_np
  from causalml.metrics import regression_metrics, classification_metrics
label_desc: Use image node_id 1 to create a new BaseTLearner object from inherited base classes: BaseLearner with example: obj = BaseTLearner(learner, control_learner, treatment_learner, ate_alpha, control_name)