code: def _pruning_optimization(pos_prune, neg_prune, rule, rules, index):
      """
      Pruning rules in a rule list for the optimization step
  
      Parameters
      ----------
      pos_prune : const double[::1, :]
          Positive instances of data set
      neg_prune : const double[::1, :]
          Negative instances of data set
      rule: list
          Selected rule
      rules: list
          The rest of rules in that rule list
  
      Returns
      -------
      double
          Pruned rule
      """
      return min(
          __last_sequences(rule, True, False),
          key=lambda rule_iter: __error_rate_rule_list(
              pos_prune,
              neg_prune,
              rules[:index] + [rule_iter] + rules[index + 1 :]
              if len(rule_iter) > 0
              else rules[:index] + rules[index + 1 :],
          ),
      )
  
file_path: AIX360/aix360/algorithms/rule_induction/ripper/pruning.py
imports: import numba
  import numpy
  from aix360.algorithms.rule_induction.ripper.binding import _rule_predict, _rule_list_predict
  from aix360.algorithms.rule_induction.ripper.mdl import _mdl
label_desc: Use image node_id 7 for calling a global function with example usage: _pruning_optimization(pos_prune, neg_prune, rule, rules, index) and returns: min