hw2/hw2_submission.py
def predict(self, x):
        """
        Use the acquired mean and std for each class to predict class for input x.
        Inputs:

        Returns:
        - prediction: Predicted labels for the data in x. prediction is (N, C) dimensional array, for N samples and C classes.
        """

        n = len(x)
        num_class = len(np.unique(self.y))
        prediction = np.zeros((n, num_class))

        ############################################################
        ############################################################
        # BEGIN_YOUR_CODE
        # calculate naive bayes probability of each class of input x

        pass
        # END_YOUR_CODE
        ############################################################
        ############################################################

        return prediction

        Use the acquired mean and std for each class to predict class for input x.
        Inputs:

        Returns:
        - prediction: Predicted labels for the data in x. prediction is (N, C) dimensional array, for N samples and C classes.
        
Use the acquired mean and std for each class to predict class for input x.
Inputs.
Use the acquired mean and std for each class to predict class for input x . Inputs .
def predict(self, x):
        n = len(x)
        num_class = len(np.unique(self.y))
        prediction = np.zeros((n, num_class))
        pass
        return prediction
def predict ( self , x ) : n = len ( x ) num_class = len ( np . unique ( self . y ) ) prediction = np . zeros ( ( n , num_class ) ) pass return prediction
Use the acquired mean and std for each class to predict class for input x.
Inputs:
Use the acquired mean and std for each class to predict class for input x . Inputs :
"""
        Use the acquired mean and std for each class to predict class for input x.
        Inputs:

        Returns:
        - prediction: Predicted labels for the data in x. prediction is (N, C) dimensional array, for N samples and C classes.
        """ ############################################################ ############################################################ # BEGIN_YOUR_CODE # calculate naive bayes probability of each class of input x # END_YOUR_CODE ############################################################ ############################################################
None
self
x