def set_parameters(self, X):
# number of possible rules, i.e. rule space italic(A) prior
self.patternSpace = np.ones(self.maxlen+1)
# This patternSpace is an approximation
# because the original code allows
# the following situation, take tic-tac-toe
# 1_O == 1 and 1_O_neg == 1, which is impossible
numAttributes = len(X.columns)
for i in range(1, self.maxlen+1):
tmp = 1
for j in range(numAttributes-i+1,numAttributes+1):
tmp *= j
self.patternSpace[i] = tmp / math.factorial(i)
if self.alpha_l == None:
self.alpha_l = [1 for i in range(self.maxlen+1)]
if self.beta_l == None:
self.beta_l = [(self.patternSpace[i]*100+1) for i in range(self.maxlen+1)]
评论列表
文章目录