关于scikit learn:Python:无法导入名称嗯

Python: cannot import name hmm

我无法从sklearn导入hmm模块。

1
from sklearn import hmm

我得到错误:

1
ImportError: cannot import name hmm


我不知道你是否找到了解决问题的办法。

您可以使用hmmlearn安装和实现您的hmm。

它可以用pip install hmmlearn轻松安装。

引用Scikit学习,

Warning The sklearn.hmm module has now been deprecated due to it no
longer matching the scope and the API of the project. It is scheduled
for removal in the 0.17 release of the project. This module has been
moved to a seperate repository: https://github.com/hmmlearn/hmmlearn


根据此处隐藏的Markov模型站点,sklearn.hmm模块已被弃用,并计划在0.17中删除。确认你的scikit-learn至少是0.16.1版本,因为从0.17你不会有sklearn.hmm