6.1 实验概要

通过EM算法解决部分观测数据的参数估计问题,使用sklearn提供的EM模块和高斯混合模型数据集,实验EM算法的实际效果

6.2 实验输入描述

本次实验使用仿真数据集,该数据集有300条数据构成,每个样本为3维。假定该数据由两个高斯分布混合得到。

[六]机器学习之EM算法

6.3 实验步骤

导入数据:

import numpy as np
data = np.loadtxt('gmm.csv',dtype=float,delimiter=',')

 

EM算法核心部分:

from sklearn.mixture import GMM

g = GMM(n_components=2,covariance_type='full',n_iter=1000)
g.fit(data)
print g.weights_
print g.means_, '\n'
print g.covars_, '\n'

6.4 实验结果及分析

[六]机器学习之EM算法

 

相关文章:

  • 2021-12-27
  • 2021-04-12
  • 2021-05-06
  • 2021-05-18
  • 2021-11-01
  • 2021-11-13
猜你喜欢
  • 2021-12-01
  • 2021-04-25
相关资源
相似解决方案