September 2019
Intermediate to advanced
420 pages
10h 29m
English
The following steps will help you build a Naive Bayes classifier:
In [13]: from sklearn import naive_bayes... model_naive = naive_bayes.GaussianNB()
In [14]: model_naive.fit(X_train, y_train)Out[14]: GaussianNB(priors=None)
In [15]: model_naive.score(X_test, y_test)Out[15]: 1.0
In [16]: yprob = model_naive.predict_proba(X_test) ...
Read now
Unlock full access