In [1]:
from sklearn.naive_bayes import GaussianNB
import sys
from time import time
sys.path.append("../tools/")
from email_preprocess import preprocess
In [2]:
features_train, features_test, labels_train, labels_test = preprocess()
In [3]:
clf = GaussianNB()
clf.fit(features_train,labels_train)
Out[3]:
In [4]:
clf.score(features_test,labels_test)
Out[4]:
In [5]:
%timeit clf.fit(features_train,labels_train)
In [6]:
%timeit pred = clf.predict(features_test)
Not shockingly, making predictions is a lot faster.