python - 属性错误 : module 'sklearn.mixture' has no attribute 'GMM'

标签 python python-3.x scikit-learn

我正在尝试运行以下 Python 项目:

https://github.com/huanghe314/Text-Independent-Speaker-Indentification-System

这取决于 sklearn.mixture.GMM ,但尽管我有 sklearn 却找不到该模块安装。它给出的错误如下:

Traceback (most recent call last):

File "C:/Users/User/PyCharmApp/Text-Independent-Speaker-Indentification-System-master/Code/main.py", line 85, in <module>
    p_weight[m] = training.Training_feature_Weight(Name[m] + '.wav')


File "C:\Users\User\PyCharmApp\Text-Independent-Speaker-Indentification-System-master\Code\training.py", line 24, in Training_feature_Weight
    Weight_training = Training_info.GMM_Model_Weight()
  File "C:\Users\User\PyCharmApp\Text-Independent-Speaker-Indentification-System-master\Code\GMM.py", line 31, in GMM_Model_Weight
    weight = mixture.GMM(n_components = self.M, min_covar = 0.01, n_init = 10).fit(self.features).weights_

我正在运行 Python 3.6。

最佳答案

sklearn.mixture.GMMsklearn 的当前版本中不再可用,根据 documentation :

Deprecated since version 0.18: This class will be removed in 0.20. Use sklearn.mixture.GaussianMixture instead.



鉴于此,我相信您的选择是更改代码以使用 GaussianMixture或降级 sklearn 的版本.

关于python - 属性错误 : module 'sklearn.mixture' has no attribute 'GMM' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53803775/

相关文章:

python - scikit-learn 中回归交叉验证的递归特征消除

python - 如何使用 statsmodels 中的 Linear_model.OLS 使用 LinearRegression 预测数据

python - 使用内部支持的优化器优化 scikit-learn 中 GPR 的 RBF 内核的内核参数

python - 间接训练前馈神经网络

python - 从 Light Table 运行 Python 3

Python ElementTree 默认命名空间?

python自动重启脚本

python - 从索引为 08 或 09 的列表中获取值时出错

Python 变量范围和 UnboundLocalError

python - GMM 得到不同的结果