问题描述
我需要拟合多元高斯分布,即对于给定的python中的音频特征数据集,获取最近的多元高斯的均值向量和协方差矩阵.音频特征(MFCC系数)是一个N X 13矩阵,其中N约为4K.有人可以在python中为这些数据概述适合高斯的软件包和技术吗?
使用numpy软件包. numpy.mean 和 numpy.cov 将为您提供高斯参数估算值.假设您有13个属性,并且N
是观察值的数量,则在为N x 13
矩阵调用numpy.cov
时需要设置rowvar=0
(或将矩阵的转置作为函数参数传递). /p>
如果您的数据位于numpy数组data
中:
mean = np.mean(data, axis=0)
cov = np.cov(data, rowvar=0)
I need to fit multivariate gaussian distribution i.e obtain mean vector and covariance matrix of the nearest multivariate gaussian for a given dataset of audio features in python. The audio features (MFCC coefficients) are a N X 13 matrix where N is around 4K. Can someone please outline the packages and technique to fit the gaussian for this data in python?
Use the numpy package. numpy.mean and numpy.cov will give you the Gaussian parameter estimates. Assuming that you have 13 attributes and N
is the number of observations, you will need to set rowvar=0
when calling numpy.cov
for your N x 13
matrix (or pass the transpose of your matrix as the function argument).
If your data are in numpy array data
:
mean = np.mean(data, axis=0)
cov = np.cov(data, rowvar=0)
这篇关于将多元高斯分布拟合到给定的数据集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!