1 Star 0 Fork 1

lerchou/gmm

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Gaussian Mixture Models in Python

Author: Jeremy Stober
Contact: stober@gmail.com
Version: 0.01

This is a standalone Pythonic implementation of Gaussian Mixture
Models. Various initialization strategies are included along with a
standard EM algorithm for determining the model parameters based on
data.

Example code for the GMM and Normal classes can be found in the
src/test_*.py files. The GMM and the underlying Normal class both
support conditioning on data and marginalization for any subset of the
variables. This makes this implementation ideal for experimenting with
Gaussian Mixture Regression. For example, the following code learns
the cosine function:


import numpy as np
from gmm import GMM
from plot_gmm import draw2dgmm
from test_func import noisy_cosine
import pylab as pl

x,y = noisy_cosine()
data = np.vstack([x,y]).transpose()
pl.scatter(data[:,0],data[:,1])

gmm = GMM(dim = 2, ncomps = 2, data = data, method = "kmeans")
draw2dgmm(gmm)

nx = np.arange(0,2 * np.pi, 0.1)
ny = []
for i in nx:
    ngmm = gmm.condition([0],[i])
    ny.append(ngmm.mean()) 

pl.plot(nx,ny,color='red')
pl.show()

空文件

简介

Gaussian Mixture Models in Python 展开 收起
Python
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lerchou/gmm.git
git@gitee.com:lerchou/gmm.git
lerchou
gmm
gmm
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385