class_docstr: BooleanRuleCG is a directly interpretable supervised learning method
  for binary classification that learns a Boolean rule in disjunctive
  normal form (DNF) or conjunctive normal form (CNF) using column generation (CG).
  AIX360 implements a heuristic beam search version of BRCG that is less 
  computationally intensive than the published integer programming version [#NeurIPS2018]_.
  
  References:
      .. [#NeurIPS2018] `S. Dash, O. Günlük, D. Wei, "Boolean decision rules via
         column generation." Neural Information Processing Systems (NeurIPS), 2018.
         <https://papers.nips.cc/paper/7716-boolean-decision-rules-via-column-generation.pdf>`_
docstr: Return rules comprising the model.
  
  Args:
      maxConj (int, optional): Maximum number of conjunctions to show
      prec (int, optional): Number of decimal places to show for floating-value thresholds
  Returns:
      Dictionary containing
      
      * isCNF (bool): flag signaling whether model is CNF or DNF
      * rules (list): selected conjunctions formatted as strings
docstr_tok: ["Return","rules","comprising","the","model",".","Args",":","maxConj","(","int",",","optional",")",":","Maximum","number","of","conjunctions","to","show","prec","(","int",",","optional",")",":","Number","of","decimal","places","to","show","for","floating-value","thresholds","Returns",":","Dictionary","containing","*","isCNF","(","bool",")",":","flag","signaling","whether","model","is","CNF","or","DNF","*","rules","(","list",")",":","selected","conjunctions","formatted","as","strings"]
code: def explain(self, maxConj=None, prec=2):
      """Return rules comprising the model.
  
      Args:
          maxConj (int, optional): Maximum number of conjunctions to show
          prec (int, optional): Number of decimal places to show for floating-value thresholds
      Returns:
          Dictionary containing
  
          * isCNF (bool): flag signaling whether model is CNF or DNF
          * rules (list): selected conjunctions formatted as strings
      """
      # Selected conjunctions
      z = self.z.loc[:, self.w > 0.5]
      truncate = (maxConj is not None) and (z.shape[1] > maxConj)
      nConj = maxConj if truncate else z.shape[1]
  
      """
          if self.CNF:
              print('Predict Y=0 if ANY of the following rules are satisfied, otherwise Y=1:')
          else:
              print('Predict Y=1 if ANY of the following rules are satisfied, otherwise Y=0:')
          """
  
      # Sort conjunctions by increasing order
      idxSort = z.sum().sort_values().index[:nConj]
      # Iterate over sorted conjunctions
      conj = []
      for i in idxSort:
          # MultiIndex of features participating in rule i
          idxFeat = z.index[z[i] > 0]
          # String representations of features
          strFeat = (
              idxFeat.get_level_values(0)
              + " "
              + idxFeat.get_level_values(1)
              + " "
              + idxFeat.get_level_values(2)
              .to_series()
              .apply(
                  lambda x: ("{:." + str(prec) + "f}").format(x)
                  if type(x) is float
                  else str(x)
              )
          )
          # String representation of rule
          strFeat = strFeat.str.cat(sep=" AND ")
          conj.append(strFeat)
  
      return {"isCNF": self.CNF, "rules": conj}
  
file_path: AIX360/aix360/algorithms/rbm/boolean_rule_cg.py
imports: import os
  import numpy
  import pandas
  import cvxpy
  from sklearn.metrics import confusion_matrix, accuracy_score
  from sklearn.base import BaseEstimator, ClassifierMixin
  import time
  from .beam_search import beam_search, beam_search_K1
label_desc: Use image node_id 5 for calling the BooleanRuleCG obj's underlying member method code with example usage: obj.explain(maxConj, prec) and returns: dict