Complete the code to import the Naive Bayes classifier from scikit-learn.
from sklearn.naive_bayes import [1]
The Naive Bayes classifier for continuous data in scikit-learn is GaussianNB.
Complete the code to create a Gaussian Naive Bayes model instance.
model = [1]()To create a Naive Bayes model, instantiate GaussianNB().
Fix the error in the code to train the Naive Bayes model on features X_train and labels y_train.
model.[1](X_train, y_train)predict instead of fit to train the model.transform which is not for training.The fit method trains the model on the training data.
Fill both blanks to predict labels for X_test and calculate accuracy score.
predictions = model.[1](X_test) accuracy = accuracy_score(y_test, [2])
fit instead of predict for predictions.accuracy_score.Use predict to get predictions, then pass them to accuracy_score to compute accuracy.
Fill all three blanks to create a dictionary of class prior probabilities from the trained model.
class_priors = {cls: prob for cls, prob in zip(model.[1], model.[2])}
print(class_priors[[3]])predict instead of attributes for class labels or priors.classes_ holds class labels, class_prior_ holds prior probabilities, and 'spam' is an example class label to access its prior.
