MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   用mvnpdf MATLAB分类 (https://www.labfans.com/bbs/showthread.php?t=26694)

poster 2019-12-14 20:46

用mvnpdf MATLAB分类
 
我将具有2 features和2000 rows数据xtrain matrix分类为训练,因此维数为2 ,μ是2元素向量,危是协方差矩阵2x2:

xtrain = 0.3630 1.6632 -0.0098 1.8526 -0.0424 1.6840 -0.1565 2.1187 0.5720 -2.7282 -0.7808 1.1357 0.5212 -0.6858 0.1038 1.4735 ... mu = 0.3486 0.8327

sigma = 1.1163 0.0452 0.0452 1.5669 我正在做类似的事情:

mu = mean(xtrain) sigma = cov(xtrain) % 1/y^2 = (2 pi)^p |\Sigma| exp { (x-\mu)' inv(\Sigma) (x-\mu) } p = mvnpdf (xtrain, mu, sigma); 然后计算:

pdfgauss =... 问题是如何使用xtest matrix测试分类器的结果?

I was reading this and it says: To classify data using Bayesian classifier we already know `Prior(w)` and need to compute `p(x/w)`. When `p` is multidimensioanl Gaussian, we can use Matlab internal function "`mvnpdf`". 示例) mvnpdf(X,Mean,Cov)


X


所有时间均为北京时间。现在的时间是 01:09

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.