Chinaunix首页 | 论坛 | 博客
  • 博客访问: 712308
  • 博文数量: 98
  • 博客积分: 3257
  • 博客等级: 中校
  • 技术积分: 966
  • 用 户 组: 普通用户
  • 注册时间: 2008-07-15 17:19
文章存档

2020年(1)

2018年(1)

2017年(1)

2016年(2)

2015年(2)

2013年(3)

2012年(24)

2011年(28)

2010年(4)

2009年(9)

2008年(23)

我的朋友

分类: 大数据

2017-08-31 10:22:11

尝试采用GMM进行聚类研究,在执行过程中出现问题,
经查询,mathworks官方支持论坛有很好的解决建议。特此记录一下:
原文网址:

I am trying to generate the Gaussian mixture parameter estimates from a dataset using the GMDISTRIBUTION.FIT function in Statistics Toolbox 7.1 (R2009a)by executing the following line of code.

obj = gmdistribution.fit(testdata,2);

Here, 'testdata' is the dataset that I load from a MAT file.

However, after executing the above line of code, I receive the following error message.

 
 ??? Error using ==> gmcluster at 181
 Ill-conditioned covariance created at iteration 53.
 Error in ==> gmdistribution.fit at 199
     [S,NlogL,optimInfo] =...
 Error in ==> test_stats at 2
 obj = gmdistribution.fit(testdata,2);

My intention is to fit a 2 component Gaussian mixture model to this dataset.


官网回答解决方案:

This error message is expected because the GMDISTRIBUTION.FIT function is not able to fit a 2 component Gaussian mixture model to the dataset in Statistics Toolbox 7.1 (R2009a).

As a general guideline to Gaussian Mixture Model(GMM) fitting, the GMDISTRIBUTION function may converge to a solution where one or more of the components has an ill-conditioned or singular covariance matrix.

The following issues may result in an ill-conditioned covariance matrix:

1. The number of dimensions of your data is relatively high and there are not enough observations.

2. Some of the features (variables) of your data are highly correlated.

3. Some or all the features are discrete.

4. You tried to fit the data to too many components.

In general, you can avoid getting ill-conditioned covariance matrices by using one of the following precautions:

1.Pre-process your data to remove correlated features. 如果是属性有相关性导致,可以进行预处理

2.Set 'SharedCov' to true to use an equal covariance matrix for every component. 将参数设为true

3.Set 'CovType' to 'diagonal'.

4.Use 'Regularize' to add a very small positive number to the diagonal of every covariance matrix.  采用Regularize参数添加一个小的非零数值。

5.Try another set of initial values.


阅读(3444) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~