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

📄 kdist.m

📁 this a SVM toolbox,it is very useful for someone who just learn SVM.In order to be undestood easily,
💻 M
字号:
function [d, data2]=kdist(x,data,Alpha,ker,arg, data2)% KDIST distance between vectors in a feature space.% [d]=kdist(x,data,Alpha,ker,arg)% [d]=kdist(x,data,Alpha,ker,arg, data2)% % Computes distance between vectors Phi(x) and % sum( Alpha(i)*Phi(data(:,i))) in a feature space induced% by a given kernel(a,b)=Phi(a)'*Phi(b).%% Inputs:%  x [dim x l] the first vector(s) in the input space.%  data [dim x n] data from the input space describing the second vector %   in the feture space.%  Alpha [1 x n] weights of the data.%  ker [string] kernel identifier; see help kernel.%  arg [...] kernel argument.% % Voluntary input:%  data2 [real] Alpha'*kmatrix(data,ker,arg)*Alpha.%% Output:%  d [1 x l] distance between in the feature space.%  data2 [real] see above.%  % Modifications:%  13-sep-2002, VF%  15-jun-2002, VF[dim,num]=size(x);x2 = diag(kmatrix( x, ker, arg));if nargin < 6,  data2 = Alpha(:)'*kmatrix( data, ker, arg)*Alpha(:);endxdata = kmatrix( x, data, ker, arg);d = sqrt(x2 - 2*xdata*Alpha(:) + repmat(data2,num,1) )';return;

⌨️ 快捷键说明

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