Python: cannot import name hmm

匿名 (未验证) 提交于 2019-12-03 02:33:02

问题:

I cant import hmm module from sklearn.

from sklearn import hmm 

I get error :

ImportError: cannot import name hmm 

回答1:

According to the Hidden Markov Models site here, the sklearn.hmm module has been deprecated and is scheduled for removal in the 0.17. Confirm that your scikit-learn is at least version 0.16.1 because from 0.17 you won't have sklearn.hmm.



回答2:

I don't know if you found a solution to your problem.

You can install and implement your HMM using hmmlearn.

It can be installed easily with a pip install hmmlearn.

To quote Scikit-learn,

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



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!