Python:无法导入名称hmm

问题描述:

我无法从sklearn导入hmm模块。Python:无法导入名称hmm

from sklearn import hmm 

我得到错误:

ImportError: cannot import name hmm 
+0

的可能重复[导入错误:无法导入名称](http://*.com/questions/17845366/importerror-cannot-import-name) –

按照Hidden Markov Models site here,则sklearn.hmm模块已被取消,并计划在0.17去除。确认您的scikit-learn版本至少为0.16.1,因为从0.17您不会有sklearn.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

+0

嗨@Pragyaditya和@ishmaelMakitla我面临着同样的错误,我尝试'pip安装hmmlearn'但我得到了同样的错误 - 'ImportError:没有名为hmm模块。我甚至更新了所有必需的模块,除此之外,您是否尝试过其他任何内容? – AnkP

+0

@AnkP你在哪个版本的Python上? –