The code we are implementing is
from NaiveBayes import Pool
import os
DClasses = ["python", "java", "hadoop", "django", "datascience", "php"]
base = "learn/"
p = Pool()
for i in DClasses:
p.learn(base + i, i)
base = "test/"
for i in DClasses:
dir = os.listdir(base + i)
for file in dir:
res = p.Probability(base + i + "/" + file)
print(i + ": " + file + ": " + str(res))
but we are getting error like no module found like naivebayes.
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-21-30788f518a4c> in <module>()
----> 1 from NaiveBayes import Pool
2 import os
3
4 DClasses = ["python", "java", "hadoop", "django", "datascience", "php"]
5
ModuleNotFoundError: No module named 'NaiveBayes'
Help to eradicate this error.Thanks.