From 002f88fb33b7b1e41451c9e1ba41725343d7e7b9 Mon Sep 17 00:00:00 2001 From: samanvay-winner <62996293+samanvay-winner@users.noreply.github.com> Date: Tue, 9 Jun 2020 23:19:00 +0530 Subject: [PATCH] Update nb_author_id.py --- naive_bayes/nb_author_id.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/naive_bayes/nb_author_id.py b/naive_bayes/nb_author_id.py index f69d57d8408..98d9c8910d6 100644 --- a/naive_bayes/nb_author_id.py +++ b/naive_bayes/nb_author_id.py @@ -26,8 +26,13 @@ ######################################################### ### your code goes here ### +from sklearn.naive_bayes import GaussianNB +clf = GaussianNB() +clf.fit(features_train, features_test) +yhat = clf.predict(labels_train) - +from sklearn.metrics import accuracy_score +print(accuracy_score(yhat, labels_test)) #########################################################