naiveBayesClassifier.py 文件源码

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

项目:AIclass 作者: mttk 项目源码 文件源码
def calculateLogJointProbabilities(self, instance):
        """
        Returns the log-joint distribution over legal labels and the instance.
        Each log-probability should be stored in the log-joint counter, e.g.
        logJoint[3] = <Estimate of log( P(Label = 3, instance) )>

        To get the list of all possible features or labels, use self.features and
        self.legalLabels.
        """
        logJoint = util.Counter()

        for label in self.legalLabels:
            #calculate the log joint probabilities for each class
            "*** YOUR CODE HERE ***"

            pass    

        return logJoint
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号