资源简介
提供在matlab里面操作lssvm的程序
代码片段和文件信息
function [featureseigveceigvals] = AFEm(Xskernel kernel_parsXtypenbeigveceigvals)
% Automatic Feature Extraction by Nystrom method
%
%
% >> features = AFEm(X kernel sig2 Xt)
%
% Description
% Using the Nystrom approximation method the mapping of data to
% the feature space can be evaluated explicitly. This gives the
% features that one can use for a linear regression or
% classification. The decomposition of the mapping to the feature
% space relies on the eigenvalue decomposition of the kernel
% matrix. The Matlab (‘eigs‘) or Nystrom‘s (‘eign‘) approximation
% using the nb most important eigenvectors/eigenvalues can be
% used. The eigenvalue decomposition is not re-calculated if it is
% passed as an extra argument. This routine internally calls a cmex file.
%
% Full syntax
%
% >> [features U lam] = AFE(X kernel sig2 Xt)
% >> [features U lam] = AFE(X kernel sig2 Xt type)
% >> [features U lam] = AFE(X kernel sig2 Xt type nb)
% >> features = AFE(X kernel sig2 Xt [][] U lam)
%
% Outputs
% features : Nt x nb matrix with extracted features
% U(*) : N x nb matrix with eigenvectors
% lam(*) : nb x 1 vector with eigenvalues
% Inputs
% X : N x d matrix with input data
% kernel : Name of the used kernel (e.g. ‘RBF_kernel‘)
% sig2 : parameter of the used kernel
% Xt : Data from which the features are extracted
% type(*): ‘eig‘(*) ‘eigs‘ or ‘eign‘
% nb(*) : Number of eigenvalues/eigenvectors used in the eigenvalue decomposition approximation
% U(*) : N x nb matrix with eigenvectors
% lam(*) : nb x 1 vector with eigenvalues
%
% See also:
% kernel_matrix RBF_kernel demo_fixedsize
%FS-LSSVMLab
% Copyright (c) 2010 KULeuven-ESAT-SCD License & help @ http://www.esat.kuleuven.be/sista/lssvmlab
N = size(X1);
Nc = size(Xs1);
eval(‘type;‘‘type=‘‘eig‘‘;‘);
if ~(strcmp(type‘eig‘) || strcmp(type‘eigs‘) || strcmp(type‘eign‘) )
error(‘Type needs to be ‘‘eig‘‘ ‘‘eigs‘‘ or ‘‘eign‘‘...‘);
end
% eigenvalue decomposition to do..
if nargin<=7
omega = kernel_matrix(Xs kernel kernel_pars);
if strcmp(type‘eig‘)
[eigveceigvals] = eig(omega+2*eye(size(omega1))); % + jitter factor
eigvals = diag(eigvals);
clear omega
elseif strcmp(type‘eigs‘)
eval(‘nb;‘‘nb=min(size(omega1)10);‘); options.disp = 0;
[eigveceigvals] = eigs(omega+2*eye(size(omega1))nb‘lm‘options); clear omega % + jitter factor
elseif strcmp(type‘eign‘)
eval(‘nb;‘‘nb=min(size(omega1)10);‘);
[eigveceigvals] = eign(omega+2*eye(size(omega1))nb); clear omega % + jitter factor
end
eigvals = (eigvals-2)/Nc;
peff = eigvals>eps;
eigvals = eigvals(peff);
eigvec = eigvec(:peff); clear peff
end
if strcmp(kernel‘RBF_kernel‘)
omegaN = sum(X.^22)*ones(1Nc);
omegaN = omegaN + ones(N1)*sum(Xs.^22)‘;
omegaN = omegaN -2*X*Xs‘; clear X Xs
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3438 2010-05-11 13:52 LSSVMLab 1.6\AFEm.m
文件 5950 2010-05-11 14:01 LSSVMLab 1.6\bay_errorbar.m
文件 2169 2010-05-11 14:01 LSSVMLab 1.6\bay_initlssvm.m
文件 10673 2010-05-11 14:01 LSSVMLab 1.6\bay_lssvm.m
文件 8410 2010-05-11 14:01 LSSVMLab 1.6\bay_lssvmARD.m
文件 9608 2010-05-11 14:01 LSSVMLab 1.6\bay_modoutClass.m
文件 6143 2010-05-11 13:08 LSSVMLab 1.6\bay_optimize.m
文件 4400 2010-05-11 13:56 LSSVMLab 1.6\bay_rr.m
文件 5584 2010-05-11 13:58 LSSVMLab 1.6\changelssvm.m
文件 4371 2010-05-11 14:02 LSSVMLab 1.6\code.m
文件 2186 2010-05-11 14:02 LSSVMLab 1.6\codedist_bay.m
文件 774 2010-05-11 14:03 LSSVMLab 1.6\codedist_hamming.m
文件 2102 2010-05-11 13:59 LSSVMLab 1.6\codedist_loss.m
文件 4273 2010-05-11 13:58 LSSVMLab 1.6\codelssvm.m
文件 5374 2010-05-11 14:02 LSSVMLab 1.6\code_ECOC.m
文件 565 2010-05-11 14:02 LSSVMLab 1.6\code_MOC.m
文件 396 2010-05-11 14:02 LSSVMLab 1.6\code_OneVsAll.m
文件 576 2010-05-11 13:56 LSSVMLab 1.6\code_OneVsOne.m
文件 5302 2010-05-11 13:20 LSSVMLab 1.6\crossvalidate.m
文件 2058 2010-05-11 13:34 LSSVMLab 1.6\crossvalidatelssvm.m
文件 1960 2010-05-11 14:03 LSSVMLab 1.6\deltablssvm.m
文件 3461 2010-05-11 14:03 LSSVMLab 1.6\democlass.m
文件 3972 2010-05-11 13:35 LSSVMLab 1.6\demofun.m
文件 4772 2010-05-11 14:07 LSSVMLab 1.6\demomodel.m
文件 1639 2010-05-11 13:40 LSSVMLab 1.6\demomulticlass.m
文件 2251 2010-05-11 13:06 LSSVMLab 1.6\demo_fixedclass.m
文件 3233 2010-05-11 13:04 LSSVMLab 1.6\demo_fixedsize.m
文件 3447 2010-05-11 13:28 LSSVMLab 1.6\demo_yinyang.m
文件 3598 2010-05-11 14:08 LSSVMLab 1.6\denoise_kpca.m
文件 3787 2010-05-11 13:32 LSSVMLab 1.6\eign.m
............此处省略46个文件信息
- 上一篇:锅炉simuli
nk仿真 - 下一篇:Matlab使用说明书
评论
共有 条评论