python - 当我尝试以朴素的贝叶斯分类器形式https://github.com/muatik/naive-bayes-classifier我得到错误

标签 python hadoop machine-learning data-science

ModuleNotFoundError
Traceback (most recent call last)
<ipython-input-13-93a644f2878c> in <module>()
      3 import operator
      4 from functools import reduce
----> 5 from ExceptionNotSeen import NotSeen
      6 from naiveBayesClassifier.trainedData import TrainedData
      7 from naiveBayesClassifier import tokenizer

ModuleNotFoundError: No module named 'ExceptionNotSeen'

我该如何解决这个问题?

转到此文件夹/Library/Frameworks/Python.framework/Versions/3.5/lib/py>thon3.5/site-packages/naive Bayes分类器将ExceptionNotSeen.py复制到当前项目路径(在其中运行主python程序,还有他们,但我只得到这样的错误

最佳答案

该项目的GitHub问题页上列出了其他人遇到的问题。此解决方案适用于以下个人:

seems there is something wrong with the install import or python path in system variable. Solve it this way

Go to this folder /Library/Frameworks/Python.framework/Versions/3.5/lib/py>thon3.5/site-packages/naiveBayesClassifier Copy ExceptionNotSeen.py to your current project path(where you run your main python program It solved that issue for me.


如果失败,则应验证ExceptionNotSeen.py的位置(如其他人所指出的那样),该错误似乎仅在虚拟环境中运行时发生。
最后,我建议您对Naive Bayes分类实现使用一个更完善的库。看看经常使用的sklearn软件包。

关于python - 当我尝试以朴素的贝叶斯分类器形式https://github.com/muatik/naive-bayes-classifier我得到错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52173968/

相关文章:

python - 如何使用 Openpyxl 的表模块创建表?

Python - 用于字符列表的 Sum() 函数

Hadoop 先生 : better to have compressed input files or raw files?

scala - 尝试写入 hdfs : Server IPC version 9 cannot communicate with client version 4 时出错

python - 使用 tf Estimator 和 export_savedmodel 函数导出模型

python - 通过机器学习从网页中提取信息

tensorflow - 在使用 per_image_standardization 之前我是否还应该标准化图像数据(除以 255)?

python - Tensorflow 中的平均欧氏距离

python - 内存游戏,检测两个图像相同的问题

java - 从 eclipse 运行 hadoop(Cloudera-2.0.0-cdh4.4.0) 作业时出错?