%
% Support Vector Machine
% Non Linear 2 dimensional algorithm
% Frédéric Patin
%
clear all;
%on génère les instants d'observation
x = rand(30,1);
x = sort(x);
% on génère les observations bruitées de f
for i=1:30
y(i) = cible(x(i)) + 10*randn(1,1);
original(i) = cible(x(i));
end
% création de la matrice H
for i=1:30
for j=1:30
H(i,j) = (1+x(i)*x(j))^6;
end
end
for i=1:30
for j=31:60
H(i,j) = -(1+x(i)*x(j-30))^6;
end
end
for i=31:60
for j=1:30
H(i,j) = -(1+x(i-30)*x(j))^6;
end
end
for i=31:60
for j=31:60
H(i,j) = (1+x(i-30)*x(j-30))^6;
end
end
评论0