CMSC_828C_Project1/bayes.py
def prior(self, labels):
        """
        this function calculates the priors for each category
        :param labels: category labels
        :return: None
        """
        for category in labels:
            self.priors[category] = {len(labels[labels == category]) / len(labels)}
        return 0

        this function calculates the priors for each category
        :param labels: category labels
        :return: None
        
this function calculates the priors for each category
this function calculates the priors for each category
def prior(self, labels):
        for category in labels:
            self.priors[category] = {len(labels[labels == category]) / len(labels)}
        return 0
def prior ( self , labels ) : for category in labels : self . priors [ category ] = { len ( labels [ labels == category ] ) / len ( labels ) } return 0
this function calculates the priors for each category
this function calculates the priors for each category
"""
        this function calculates the priors for each category
        :param labels: category labels
        :return: None
        """
None
self
labels
None