【源码】高斯混合模型的EM算法(EM GMM)

在这里插入图片描述
该软件包采用期望最大化(EM)算法拟合高斯混合模型(GMM),适用于任意维的数据集。

This package fits Gaussian mixture model (GMM) by expectation maximization (EM) algorithm.It works on data set of arbitrary dimensions.

在计算高维数据概率时,为了避免经常出现的浮点数下溢现象,采用了对数域计算概率等方法来提高数值稳定性。

Several techniques are applied to improve numerical stability, such as computing probability in logarithm domain to avoid float number underflow which often occurs when computing probability of high dimensional data.

该代码经过了精心设计,以利用向量化和矩阵分解来提高计算效率。

The code is also carefully tuned to be efficient by utilizing vertorization and matrix factorization.

这种算法被广泛使用。具体细节可以在教科书“模式识别与机器学习”或wiki页面中找到。

This algorithm is widely used. The detail can be found in the great textbook “Pattern Recognition and Machine Learning” or the wiki page

http://en.wikipedia.org/wiki/Expectation-maximization_algorithm

该函数是鲁棒且高效的,但是代码结构是经过特别组织的,以便于阅读。请尝试使用以下代码进行演示:

This function is robust and efficient yet the code structure is organized so that it is easy to read. Please try following code for a demo:

close all; clear;

d = 2;

k = 3;

n = 500;

[X,label] = mixGaussRnd(d,k,n);

plotClass(X,label);

m = floor(n/2);

X1 = X(:,1:m);

X2 = X(:,(m+1):end);

% train

[z1,model,llh] = mixGaussEm(X1,k);

figure;

plot(llh);

figure;

plotClass(X1,z1);

% predict

z2 = mixGaussPred(X2,model);

figure;

plotClass(X2,z2);

源码下载地址:

http://page5.dfpan.com/fs/7lac2j2232d16229169/

更多精彩文章请关注微信号:在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值