function [ypred, values] = predictSVMB(Xtrain, ytrain, Xtest, s, C, B, t)

% SVM + Band-removal

if(~exist('s','var'))
    s = 1;
end

if(~exist('C','var'))
    C = 1;
end

if(~exist('B','var'))
    B = -1;
end

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

params = sprintf('-s %d -c %f -B %f -q',s,C,B);

classes = size(ytrain,2);

ypred = zeros(size(Xtest,1),classes);
values = zeros(size(Xtest,1),classes);
trvalues = zeros(size(Xtrain,1),classes);

for i=1:classes
    model = train(full(ytrain(:,i)), Xtrain, params);
    [~,~,trvalues(:,i)] = predict(zeros(size(Xtrain,1),1), Xtrain, model);
end

Xtrain = Xtrain(~any(abs(trvalues)<t,2)',:);
ytrain = ytrain(~any(abs(trvalues)<t,2)',:);

for i=1:classes
    model = train(full(ytrain(:,i)), Xtrain, params);
    [ypred(:,i),~,values(:,i)] = predict(zeros(size(Xtest,1),1), Xtest, model);
end