function [y,z] = svmPredict(x,tx,ty,alpha,b,kernelFunction,kernelPar)
% z is the prediction Wx+b.
% y = sign(z).
% x = input.
% tx,ty are the training data.

if nargin<6,
  kernelFunction = 'polyK'; % default polynomial kernel
end;
z = feval(kernelFunction,x,tx,kernelPar) * (alpha.*ty) + b;
y = sign(z);
