⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ecov.m

📁 this a SVM toolbox,it is very useful for someone who just learn SVM.In order to be undestood easily,
💻 M
字号:
function [V,eigv]=ecov(X)% ECOV returns non-zero eigenvectors of cov(X).%  [V,eigv]=ecov(X)%% This function uses one-to-one correspondence between% non-zero eigenvalues and eigenevectors of matrices% (Xc * Xc') and (Xc' * Xc), where Xc is centered X.%% Result of this function is the same as eig(cov(X'))% but computation is different. The ecov is more% efficient if data dimension >> number of data.%% Result eigenvectors and eigenvalues are return % descending order.%% Input:%  X [d x l] d-dimensional patterns set of size l.%  % Output:%  V [d x m] eigenvectors of cov(X).%  eigv [1 x m] non-zero eigenvalues.%  
% Statistical Pattern Recognition Toolbox, Vojtech Franc, Vaclav Hlavac% (c) Czech Technical University Prague, http://cmp.felk.cvut.cz.% Modifications:%  21-may-2001, V.Franc, created n=size(X,2);d=size(X,1);% centering dataif n > 1,  mi=mean(X')';  X=X-repmat(mi,1,n);else  mi=zeros(d,1);end% compute matrix KK=X'*X/(n-1);% compute eigenvectors and sort them[U,D]=eig(K);[eigv,inx]=sort(-real(diag(D)));eigv=-eigv;U=U(:,inx);% compute eigenvectors of cov(X)V=[];for i=1:min(d,n),  if eigv(i) > 0,    V=[V,X*U(:,i)/sqrt(eigv(i))];  endendeigv = eigv(1:min(d,n));V = V/norm(V);return;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -