docstr: Learn support and overlap rules.
  
  :param backdoor_vars: List of backdoor variables. Support and overlap rules will only be learned with respect to
  these variables
  :type backdoor_vars: List[str]
  :param treatment_name: Treatment name
  :type treatment_name: str
  :param: cat_feats: List[str]: List of categorical features, all others will be discretized
  :param: support_config: SupportConfig: DataClass with configuration options for learning support rules
  :param: overlap_config: OverlapConfig: DataClass with configuration options for learning overlap rules
  :param: overrule_verbose: bool: Enable verbose logging of optimization output, defaults to False
  :param prop_estimator: Propensity score estimator, defaults to RandomForestClassifier learned via GridSearchCV
  :type prop_estimator: Optional[Union[BaseEstimator, GridSearchCV]], optional
  :param: overlap_eps: float: Defines the range of propensity scores for a point to be considered in the overlap
      region, with the range defined as `(overlap_eps, 1 - overlap_eps)`, defaults to 0.1
  :param support_only: Only fit the support region, not the overlap, defaults to False
  :type support_only: bool, optional
  :param overlap_only: Only fit the overlap region, not the support, defaults to False
  :type overlap_only: bool, optional
  :param verbose: Verbose optimization output, defaults to False
  :type verbose: bool, optional
docstr_tok: ["Learn","support","and","overlap","rules",".",":","param","backdoor_vars",":","List","of","backdoor","variables",".","Support","and","overlap","rules","will","only","be","learned","with","respect","to","these","variables",":","type","backdoor_vars",":","List","[","str","]",":","param","treatment_name",":","Treatment","name",":","type","treatment_name",":","str",":","param",":","cat_feats",":","List","[","str","]",":","List","of","categorical","features",",","all","others","will","be","discretized",":","param",":","support_config",":","SupportConfig",":","DataClass","with","configuration","options","for","learning","support","rules",":","param",":","overlap_config",":","OverlapConfig",":","DataClass","with","configuration","options","for","learning","overlap","rules",":","param",":","overrule_verbose",":","bool",":","Enable","verbose","logging","of","optimization","output",",","defaults","to","False",":","param","prop_estimator",":","Propensity","score","estimator",",","defaults","to","RandomForestClassifier","learned","via","GridSearchCV",":","type","prop_estimator",":","Optional","[","Union","[","BaseEstimator",",","GridSearchCV","]","]",",","optional",":","param",":","overlap_eps",":","float",":","Defines","the","range","of","propensity","scores","for","a","point","to","be","considered","in","the","overlap","region",",","with","the","range","defined","as","`","(","overlap_eps",",","1","-","overlap_eps",")","`",",","defaults","to","0.1",":","param","support_only",":","Only","fit","the","support","region",",","not","the","overlap",",","defaults","to","False",":","type","support_only",":","bool",",","optional",":","param","overlap_only",":","Only","fit","the","overlap","region",",","not","the","support",",","defaults","to","False",":","type","overlap_only",":","bool",",","optional",":","param","verbose",":","Verbose","optimization","output",",","defaults","to","False",":","type","verbose",":","bool",",","optional"]
code: def __init__(
      self,
      backdoor_vars: List[str],
      treatment_name: str,
      cat_feats: Optional[List[str]] = None,
      support_config: Optional[SupportConfig] = None,
      overlap_config: Optional[OverlapConfig] = None,
      prop_estimator: Optional[
          Union[BaseEstimator, GridSearchCV]
      ] = None,
      overlap_eps: float = 0.1,
      support_only: bool = False,
      overlap_only: bool = False,
      verbose: bool = False,
  ):
      """
      Learn support and overlap rules.
  
      :param backdoor_vars: List of backdoor variables. Support and overlap rules will only be learned with respect to
      these variables
      :type backdoor_vars: List[str]
      :param treatment_name: Treatment name
      :type treatment_name: str
      :param: cat_feats: List[str]: List of categorical features, all others will be discretized
      :param: support_config: SupportConfig: DataClass with configuration options for learning support rules
      :param: overlap_config: OverlapConfig: DataClass with configuration options for learning overlap rules
      :param: overrule_verbose: bool: Enable verbose logging of optimization output, defaults to False
      :param prop_estimator: Propensity score estimator, defaults to RandomForestClassifier learned via GridSearchCV
      :type prop_estimator: Optional[Union[BaseEstimator, GridSearchCV]], optional
      :param: overlap_eps: float: Defines the range of propensity scores for a point to be considered in the overlap
          region, with the range defined as `(overlap_eps, 1 - overlap_eps)`, defaults to 0.1
      :param support_only: Only fit the support region, not the overlap, defaults to False
      :type support_only: bool, optional
      :param overlap_only: Only fit the overlap region, not the support, defaults to False
      :type overlap_only: bool, optional
      :param verbose: Verbose optimization output, defaults to False
      :type verbose: bool, optional
      """
      self.X_cols = backdoor_vars
      self.t_col = treatment_name
      if support_config is None:
          support_config = SupportConfig()
      if overlap_config is None:
          overlap_config = OverlapConfig()
  
      if not isinstance(support_config, SupportConfig):
          raise ValueError("support_config not a SupportConfig class")
  
      if not isinstance(overlap_config, OverlapConfig):
          raise ValueError("overlap_config not a OverlapConfig class")
  
      if overlap_only and support_only:
          raise ValueError(
              "Only one of `overlap_only` and `support_only` can be True"
          )
  
      self._overlap_only = overlap_only
      self._support_only = support_only
      if overlap_only:
          self.RS_support_estimator = None
      else:
          self.RS_support_estimator = BCSRulesetEstimator(
              cat_cols=cat_feats,
              silent=not verbose,
              verbose=verbose,
              **asdict(support_config),
          )
  
      if support_only:
          self.RS_overlap_estimator = None
          self.overlap_eps = None
      else:
          self.RS_overlap_estimator = BCSRulesetEstimator(
              cat_cols=cat_feats,
              silent=not verbose,
              verbose=verbose,
              n_ref_multiplier=0.0,
              **asdict(overlap_config),
          )
          self.overlap_eps = overlap_eps
  
      if prop_estimator is None:
          param_grid = {
              "max_depth": [4, 8],
              "min_samples_leaf": [0.01, 0.1],
              "n_estimators": [200],
          }
          estimator = RandomForestClassifier(
              criterion="log_loss", random_state=0
          )
          prop_estimator = GridSearchCV(
              estimator=estimator, param_grid=param_grid
          )
  
      if not isinstance(
          prop_estimator, BaseEstimator
      ) and not isinstance(prop_estimator, GridSearchCV):
          raise ValueError(
              "Propensity estimator is not an sklearn estimator"
          )
  
      self.prop_estimator = prop_estimator
      self.is_fitted = False
  
imports: from dataclasses import asdict, dataclass
  from typing import Dict, List, Optional, Union
  import numpy
  import pandas
  from sklearn.base import BaseEstimator
  from sklearn.ensemble import RandomForestClassifier
  from sklearn.model_selection import GridSearchCV, cross_val_predict
  from dowhy.causal_refuters.overrule.ruleset import BCSRulesetEstimator
  from dowhy.causal_refuters.overrule.utils import fatom
label_desc: Use image node_id 1 to create a new OverruleAnalyzer object  with example: obj = OverruleAnalyzer(backdoor_vars, treatment_name, cat_feats, support_config, overlap_config, prop_estimator, overlap_eps, support_only, overlap_only, verbose)