class_docstr: Bayesian or-of-and algorithm.
  Generates patterns that satisfy the minimum support and maximum length and then select the Nrules rules that have the highest entropy.
  In function SA_patternbased, each local maximum is stored in maps and the best BOA is returned.
  Remember here the BOA contains only the index of selected rules from Nrules self.rules_
class_docstr_tok: ["Bayesian","or-of-and","algorithm",".","Generates","patterns","that","satisfy","the","minimum","support","and","maximum","length","and","then","select","the","Nrules","rules","that","have","the","highest","entropy",".","In","function","SA_patternbased",",","each","local","maximum","is","stored","in","maps","and","the","best","BOA","is","returned",".","Remember","here","the","BOA","contains","only","the","index","of","selected","rules","from","Nrules","self.rules_"]
docstr: Compute the rule space from the levels in each attribute
          
docstr_tok: ["Compute","the","rule","space","from","the","levels","in","each","attribute"]
code: def _set_pattern_space(self):
      """Compute the rule space from the levels in each attribute"""
      # add feat_neg to each existing feature feat
      for item in self.attr_names:
          self.attr_level_num[item + "_neg"] = self.attr_level_num[item]
      tmp = [item + "_neg" for item in self.attr_names]
      self.attr_names.extend(tmp)
  
      # set up pattern_space
      self.pattern_space = np.zeros(self.maxlen + 1)
      for k in range(1, self.maxlen + 1, 1):
          for subset in combinations(self.attr_names, k):
              tmp = 1
              for i in subset:
                  tmp = tmp * self.attr_level_num[i]
              # print('subset', subset, 'tmp', tmp, 'k', k)
              self.pattern_space[k] = self.pattern_space[k] + tmp
  
imports: import itertools
  import operator
  import os
  import warnings
  from os.path import join
  from bisect import bisect_left
  from collections import defaultdict
  from copy import deepcopy
  from itertools import combinations
  from random import sample
  import numpy
  import pandas
  from mlxtend.frequent_patterns import fpgrowth
  from numpy.random import random
  from pandas import read_csv
  from scipy.sparse import csc_matrix
  from sklearn.base import BaseEstimator, ClassifierMixin
  from sklearn.ensemble import RandomForestClassifier
  from sklearn.utils.multiclass import check_classification_targets
  from sklearn.utils.validation import check_X_y, check_is_fitted
  from imodels.rule_set.rule_set import RuleSet
  from imodels.util.arguments import check_fit_arguments
label_desc: Use image node_id 6 for calling the BayesianRuleSetClassifier obj's underlying member method code with example usage: obj._set_pattern_space() without return types