Problems with Matlab Projects? You may face many Problems, but do not worry we are ready to solve your Problems. All you need to do is just leave your Comments. We will assure you that you will find a solution to your project along with future tips. On Request we will Mail you Matlab Codes for Registered Members of this site only, at free service...Follow Me.

svm using matlab

2 comments:

Unknown said...

can I please get the svm dual for non-linearly separable cases in matlab?
email- sharmi.banerji@gmail.com
Thanks so much

Unknown said...

Hi Sir,

Can you please help me with the plotting of results with the Kernel SVM code-
clc;
close all;
clear all;
N1=50;
N2=50;
C=1;
m1=[1 1];
m2=[4 4];
c1=[1.2 0;0 1.2];
c2=[1.5 0;0 1.5];
w1=mvnrnd(m1,c1,N1);
w2=mvnrnd(m2,c2,N2);
temp = cat(1,ones(N1,3),-ones(N2,3));
temp(1:N1,1:2)=w1;
temp(N1+1:N1+N2,1:2)=-w2;
data_set=temp;
g = @(x,y) (x*y'+1).^2;
X_data = cat(1,data_set(1:N1,1:2),-data_set(N1+1:N1+N2,1:2));
y = data_set(:,3);
H = (y*y').*g(X_data,X_data);
f=-ones(N1+N2,1);
Aeq=y';
beq=0;
lb=zeros(N1+N2,1);
ub=C*ones(N1+N2,1);
lambda=quadprog(H,f,[],[],Aeq,beq,lb,ub);

lambda(floor(10000*abs(lambda))==0)=0;
s =g(X_data,X_data);
% weight vector
w = g(data_set,data_set)*(y.*lambda);
q=find(lambda>0 & lambda<C-.000001);
for i=1:N1+N2
yi=(y.*lambda)*g(data_set(i,:),data_set);
end
yi(floor(10000*abs(yi))==0)=0;
figure
surf(yi);


I want to plot the data set and the decision surface together, but i am not sure about the axes so I just used the surf function.

Thanks,
Sharmi
sharmi.banerji@gmail.com

Post a Comment

Recent Comments

Popular Matlab Topics

Share your knowledge - help others

Crazy over Matlab Projects ? - Join Now - Follow Me

Sites U Missed to Visit ?

Related Posts Plugin for WordPress, Blogger...

Latest Articles

Special Search For Matlab Projects

MATLAB PROJECTS

counter

Bharadwaj. Powered by Blogger.