小编Joe*_*Joe的帖子

AttributeError:'GMM'对象没有属性'covariances_'|| AttributeError:'module'对象没有属性'GaussianMixture'

我有一段代码可以适合我的数据的guassian模型.我从sklearn进口了混合物.然而,即使我使用mixture.GaussianMixture我得到一个错误:AttributeError:'module'对象没有属性'GaussianMixture',如果我使用另一种方式,它会给出一个错误:AttributeError:'GMM'对象没有属性'covariances_'.我甚至尝试导入协方差,但似乎没有用.谁能告诉我如何解决这个错误.

from sklearn import mixture   

# Fit a Gaussian mixture with EM using five components
gmm = mixture.GaussianMixture(n_components=5, covariance_type='full').fit(X) 
gmm = GMM(n_components=3, covariance_type='full')
Run Code Online (Sandbox Code Playgroud)

python scikit-learn

4
推荐指数
1
解决办法
3423
查看次数

标签 统计

python ×1

scikit-learn ×1