Skip to content

Commit 0863761

Browse files
authored
Update Bernoulli_naive_bayes.py
1 parent c71dbe8 commit 0863761

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Bernoulli_naive_bayes.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#Code has some logical error.
2+
3+
14
from os import name
25
from Bag_of_words import y, ham, spam
36
from Bernoulli import bernoulli, bernoulli_test
@@ -49,8 +52,8 @@ def numerator_values():
4952

5053
def predict():
5154
# Defining the list of path where all the test data files are stored.
52-
filePaths = (list(paths.list_files("enron1/test/ham")) + list(paths.list_files("enron4/test/ham")) + list(paths.list_files("hw1/test/ham"))
53-
+ list(paths.list_files("enron1/test/spam")) + list(paths.list_files("enron4/test/spam")) + list(paths.list_files("hw1/test/spam")))
55+
filePaths = (list(paths.list_files("Datasets/enron1/test/ham")) + list(paths.list_files("Datasets/enron4/test/ham")) + list(paths.list_files("Datasets/hw1/test/ham"))
56+
+ list(paths.list_files("Datasets/enron1/test/spam")) + list(paths.list_files("Datasets/enron4/test/spam")) + list(paths.list_files("Datasets/hw1/test/spam")))
5457

5558
# Creating a test dataset using BOW_test method of Bag_of_words.py file.
5659
test_data, true_y = bernoulli_test(filePaths)

0 commit comments

Comments
 (0)