-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathmklkernel.m
More file actions
31 lines (22 loc) · 726 Bytes
/
Copy pathmklkernel.m
File metadata and controls
31 lines (22 loc) · 726 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function K=mklkernel(xapp,InfoKernel,Weight,options,xsup,beta)
if nargin <5
xsup=xapp;
beta=[];
for k=1:length(Weight)
Kr=svmkernel(xapp(:,InfoKernel(k).variable),InfoKernel(k).kernel,InfoKernel(k).kerneloption, xsup(:,InfoKernel(k).variable));
Kr=Kr*Weight(k);
% if options.efficientkernel
% Kr=build_efficientK(Kr);
% end;
K(:,:,k)=Kr;
end;
else
ind=find(beta);
K=zeros(size(xapp,1),size(xsup,1));
for i=1:length(ind);
k=ind(i);
Kr=svmkernel(xapp(:,InfoKernel(k).variable),InfoKernel(k).kernel,InfoKernel(k).kerneloption, xsup(:,InfoKernel(k).variable));
Kr=Kr*Weight(k);
K=K+ Kr*beta(k);
end;
end;