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
评论列表
文章目录