script for ClassifyNB.py - technology blog

Breaking

Wednesday, 26 December 2018

script for ClassifyNB.py

def classify(features_train, labels_train):
### import the sklearn module for GaussianNB
from sklearn.naive_bayes import GaussianNB
### create classifier
clf = GaussianNB()
### fit the classifier on the training features and labels
clf.fit(features_train, labels_train)
### return the fit classifier
return clf
### your code goes here!