__init__.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:bayesianRuleSet 作者: zli37 项目源码 文件源码
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)]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号