LFD Book Forum

LFD Book Forum (http://book.caltech.edu/bookforum/index.php)
-   The Final (http://book.caltech.edu/bookforum/forumdisplay.php?f=138)
-   -   Question 13 - RBF with hard mrgin unable to accurately classifiy (http://book.caltech.edu/bookforum/showthread.php?t=1524)

MLearning 09-14-2012 11:23 AM

Question 13 - RBF with hard mrgin unable to accurately classifiy
I am having difficulty getting SVM with RBF to accurately classify a linearly separable data. I included herein a piece of my code.

N = 100; gamma = 1.5;

X = 2*rand(2,N)-1; %Training data
fx=sign(X(2,:)-X(1,:) + 0.25*sin(pi*X(1,:)));

%Generate Kx(xn,xm)
for n=1:N
for m=1:N

Q=(fx*fx').*Kx; %Q Matrix
... %other input parameters are similarly defined

alpha0=zeros(N,1)% This initialization has no effect

alphan = quadprog(Q,q,[],[],Aeq,beq,lb,ub,alpha0,optimset('maxiter',10000,'la rgescale','off'));


The problem is that all values of alphan are very small (e.g., max(alphan) = 0.0072 in one of the runs). Due to this, gx is either always equal to 1 -1.

Can anyone point out where the error lies in the above piece of code? I really appreciate it.

All times are GMT -7. The time now is 02:03 AM.

Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
The contents of this forum are to be used ONLY by readers of the Learning From Data book by Yaser S. Abu-Mostafa, Malik Magdon-Ismail, and Hsuan-Tien Lin, and participants in the Learning From Data MOOC by Yaser S. Abu-Mostafa. No part of these contents is to be communicated or made accessible to ANY other person or entity.