Skip to content

Commit 9e7b64e

Browse files
authored
Create ClassifyNB.py
0 parents  commit 9e7b64e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

ClassifyNB.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
def classify(features_train, labels_train):
2+
### import the sklearn module for GaussianNB
3+
### create classifier
4+
### fit the classifier on the training features and labels
5+
### return the fit classifier
6+
7+
8+
### your code goes here!
9+
from sklearn.naive_bayes import GaussianNB
10+
clf = GaussianNB()
11+
clf.fit(features_train,labels_train)
12+
pred = clf.predict(features_train)
13+
return clf

0 commit comments

Comments
 (0)