class_docstr: A parent class for S-learner classes.
  An S-learner estimates treatment effects with one machine learning model.
  Details of S-learner are available at Kunzel et al. (2018) (https://arxiv.org/abs/1706.03461).
class_docstr_tok: ["A","parent","class","for","S-learner","classes",".","An","S-learner","estimates","treatment","effects","with","one","machine","learning","model",".","Details","of","S-learner","are","available","at","Kunzel","et","al",".","(","2018",")","(","https",":","\/\/arxiv.org\/abs\/1706.03461",")","."]
docstr: Initialize an S-learner.
  Args:
      learner (optional): a model to estimate the treatment effect
      control_name (str or int, optional): name of control group
docstr_tok: ["Initialize","an","S-learner",".","Args",":","learner","(","optional",")",":","a","model","to","estimate","the","treatment","effect","control_name","(","str","or","int",",","optional",")",":","name","of","control","group"]
code: def __init__(self, learner=None, ate_alpha=0.05, control_name=0):
      """Initialize an S-learner.
      Args:
          learner (optional): a model to estimate the treatment effect
          control_name (str or int, optional): name of control group
      """
      if learner is not None:
          self.model = learner
      else:
          self.model = DummyRegressor()
      self.ate_alpha = ate_alpha
      self.control_name = control_name
  
imports: import logging
  import numpy
  from tqdm import tqdm
  from scipy.stats import norm
  from sklearn.dummy import DummyRegressor
  import statsmodels.api
  from copy import deepcopy
  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 BaseSLearner object from inherited base classes: BaseLearner with example: obj = BaseSLearner(learner, ate_alpha, control_name)