class_docstr: Ruleset estimator based on Boolean Rules with Column Generation.
  
  Operates according to an scikit-learn interface with a few additional methods.
class_docstr_tok: ["Ruleset","estimator","based","on","Boolean","Rules","with","Column","Generation",".","Operates","according","to","an","scikit-learn","interface","with","a","few","additional","methods","."]
docstr: Return rules learned by the estimator.
  
  :param as_str: Return a string if True, otherwise a dictionary, defaults to False
  :type as_str: bool, optional
  :param transform: A function that takes key-value pairs for rules and thresholds and transforms the value.
      This function is used to re-scale standardized data, defaults to None
  :type transform: Optional[Callable[[str, float], float]], optional
  :param fmt: Formatting string for float values, for printing rules with thresholds, defaults to "%.3f"
  :type fmt: str, optional
  :param labels: Dictionary mapping from original feature names to display names when printing rules, any
      feature not specified here will default to the original name, defaults to {}
  :type labels: Dict[str, str], optional
docstr_tok: ["Return","rules","learned","by","the","estimator",".",":","param","as_str",":","Return","a","string","if","True",",","otherwise","a","dictionary",",","defaults","to","False",":","type","as_str",":","bool",",","optional",":","param","transform",":","A","function","that","takes","key-value","pairs","for","rules","and","thresholds","and","transforms","the","value",".","This","function","is","used","to","re-scale","standardized","data",",","defaults","to","None",":","type","transform",":","Optional","[","Callable","[","[","str",",","float","]",",","float","]","]",",","optional",":","param","fmt",":","Formatting","string","for","float","values",",","for","printing","rules","with","thresholds",",","defaults","to","``","%",".3f","''",":","type","fmt",":","str",",","optional",":","param","labels",":","Dictionary","mapping","from","original","feature","names","to","display","names","when","printing","rules",",","any","feature","not","specified","here","will","default","to","the","original","name",",","defaults","to","{","}",":","type","labels",":","Dict","[","str",",","str","]",",","optional"]
code: def rules(
      self,
      as_str: bool = False,
      transform: Optional[Callable[[str, float], float]] = None,
      fmt: str = "%.3f",
      labels: Dict[str, str] = {},
  ):
      """
      Return rules learned by the estimator.
  
      :param as_str: Return a string if True, otherwise a dictionary, defaults to False
      :type as_str: bool, optional
      :param transform: A function that takes key-value pairs for rules and thresholds and transforms the value.
          This function is used to re-scale standardized data, defaults to None
      :type transform: Optional[Callable[[str, float], float]], optional
      :param fmt: Formatting string for float values, for printing rules with thresholds, defaults to "%.3f"
      :type fmt: str, optional
      :param labels: Dictionary mapping from original feature names to display names when printing rules, any
          feature not specified here will default to the original name, defaults to {}
      :type labels: Dict[str, str], optional
      """
      w, z = (self.M.w, self.M.z)
      w_sel = np.where(w)[0]
  
      def t_(k, v):
          return v if transform is None else transform(k, v)
  
      C = []
      for j in w_sel:
          index_j = z[z[j] == 1][j].index
          f = index_j.get_level_values(0).values
          o = index_j.get_level_values(1).values
          v = index_j.get_level_values(2).values
  
          l = [labels.get(a, a) for a in f]
  
          dis_j = [(l[i], o[i], t_(f[i], v[i])) for i in range(len(f))]
          C.append(dis_j)
  
      if as_str:
          return rule_str(C, fmt=fmt)
      else:
          return C
  
file_path: dowhy/dowhy/causal_refuters/overrule/ruleset.py
imports: from typing import Callable, Dict, List, Optional
  import numpy
  import pandas
  from .BCS.load_process_data_BCS import FeatureBinarizer
  from .BCS.overlap_boolean_rule import OverlapBooleanRule
  from .utils import rule_str, sample_reference
label_desc: Use image node_id 8 for calling the BCSRulesetEstimator obj's underlying member method code with example usage: obj.rules(as_str, transform, fmt, labels) and returns: unknown, rule_str, C