Generative Model, Walkthrough, Data Science.
return normalized_p y_prob = posterior_probabilities(x_train, means, covariances, priors) y_hat = class_labels[np.argmax(y_prob, axis=1)] accuracy = np.mean(y_hat==y_train) print(accuracy) Doing so, we get an accuracy of 95% on the training data (I’m not going to do a train/val/test split for the