def information_gain(self): from nltk_contrib.classifier import entropy_of_key_counts return entropy_of_key_counts(self.root) - self.mean_information()
def entropy(self, attr_value): """ Returns the entropy of class disctribution for a particular attribute value """ from nltk_contrib.classifier import entropy_of_key_counts return entropy_of_key_counts(self.counts[attr_value])