[SciPy-dev] [Scipy-dev] Some code for Gaussian Mixture Model

David Cournapeau david at ar.media.kyoto-u.ac.jp
Thu May 4 04:19:37 EDT 2006


Robert Kern wrote:
> David Cournapeau wrote:
>   
>> Hi,
>>
>>     I recently ported some of my matlab code, itself inspired by code 
>> found on h2m toolbox (http://www.tsi.enst.fr/~cappe/h2m/) for learning 
>> Gaussian Mixtures Models (diagonal and full covariance matrices) with 
>> Expectation Maximization algorithm.
>>     If there is some interest, I would like to give the code to scipy, 
>> but there are some things I am not sure about:
>>
>>     - how to properly "submit" the code ?
>>     
>
>   
Sorry for the delay, but I had problems accessing the web server of my 
university... Anyway, I put the license
of scipy in a small tar.gz available there:

http://www.ar.media.kyoto-u.ac.jp/members/david/gmm.tar.gz

There are basically two files: one for computing multivariate gaussian 
densities, and one for GMM. Both are required. There is no separate doc, 
but I tried to document all relevant functions.

To get a similar picture than

http://www.ar.media.kyoto-u.ac.jp/members/david/gmm.png

you just have to execute the script gmm.py (you need matplotlib for 
that; the helper functions for drawing do not use any plotting package, 
though, so using xplt instead should be trivial)

I started implementing some tests, but I haven't checked how to do it 
properly, and some are just usable by me to check that I get consistent 
results compared to my matlab implementation. I tried to test it for 
general cases, but I don't use it myself in high dimension, so I don't 
guarantee anything !

I am quite new to scipy, so there may have strange ways of doing things; 
I tried to be consistent, though. For the EM algorithm initialization, I 
reimplemented the kmean algorithm which does not seem to be available in 
scipy.

David




More information about the SciPy-Dev mailing list