I am trying to implement one class svm as defined developed by Scholkopf http://rvlasveld.github.io/blog/2013/07/12/introduction-to-one-class-support-vector-machines/ I am implementing the dual problem. Can anyone check why it is not working properly? I am getting positive number for non-class data.
C=1/(v*m); % m is the number of training samples.
alphaLagrange <= C;
alphaLagrange >= 0;
totalSum = 0;
totalSum = totalSum + alphaLagrange(i)*input(i,:);
weights = totalSum;
The kernel ‘K’ is correct as I have used it other code and works perfectly. The value of ‘rho’ is defined as ‘paperRow’ as below.
paperRow=0; for i=1:m paperRow = paperRow + sum(alpha.*kernel(input,Xdata(k,:),type)); end
% input is all data;
% Xdata(k, ) is a particular sample.
and finally I am using if the data is of the class or outlier by the function:
But I get positive number for any kind of ‘someData’. Any sugesstion why?