class_docstr: An estimator that supports building rules as described in
  A Simple, Fast, and Effective Rule Learner (1999). Intended to be used
  as part of the SlipperRulesClassifier.
class_docstr_tok: ["An","estimator","that","supports","building","rules","as","described","in","A","Simple",",","Fast",",","and","Effective","Rule","Learner","(","1999",")",".","Intended","to","be","used","as","part","of","the","SlipperRulesClassifier","."]
docstr: Remove conditions from greedily built rule until
  objective does not improve
docstr_tok: ["Remove","conditions","from","greedily","built","rule","until","objective","does","not","improve"]
code: def _prune_rule(self, X, y, rule):
      """Remove conditions from greedily built rule until
      objective does not improve
      """
      stop_condition = False
      curr_rule = rule.copy()
  
      while not stop_condition:
          candidate_rules = []
  
          if len(curr_rule) == 1:
              return curr_rule
  
          candidate_rules = [
              self._pop_condition(curr_rule, condition)
              for condition in curr_rule
          ]
  
          prune_objs = [
              self._prune_rule_obj(X, y, rule) for x in candidate_rules
          ]
          best_prune = candidate_rules[
              prune_objs.index(min(prune_objs))
          ]
  
          if self._prune_rule_obj(X, y, rule) > self._prune_rule_obj(
              X, y, rule
          ):
              curr_rule = best_prune.copy()
          else:
              stop_condition = True
  
      return curr_rule
  
imports: import random
  import numpy
  from sklearn.base import BaseEstimator, ClassifierMixin
  from sklearn.model_selection import train_test_split
  from imodels.util.arguments import check_fit_arguments
label_desc: Use image node_id 9 for calling the SlipperBaseEstimator obj's underlying member method code with example usage: obj._prune_rule(X, y, rule) and returns: curr_rule, curr_rule