function [label,weights]=svmdata(S,y,testS,c,b,thrs)
%idx=sum(S)<10;
%S(:,idx)=[];
%testS(:,idx)=[];

if ~exist('thrs','var')
    thrs=0;
end

S=normalize2(S);
testS=normalize2(testS);

y=double(y);
y(y==0)=-1;
nClass=size(y,2);

param=sprintf('-q -c %f -B %f',c,b);

%learning
[model,firstClass]=svmlearn(S,y,param);

%solve2
%[~,w]=solvesvm(S,y,model);
%w=bsxfun(@times,w,firstClass);
%l=w>0;
%param2=sprintf('-c %f -B %f -q',0.2110,0.0780);
%[model,firstClass]=svmlearn2(S,y,param2,l,w,0.19);
%solve2

%solve
[~,weights]=solvesvm(testS,zeros(size(testS,1),nClass),model); 

weights=bsxfun(@times,weights,firstClass);
label=weights>thrs;

%zeros (max weight)
label=weighted_zeros(S,label,weights);
%label=knn_zeros(S,y,testS,label,40,5);
label=label';
weights=weights';

label=logical(label);
