function f = svm_discrim_func(Xnew, AlphaY, SVs, Bias,Parameters, nSV, nLabel)

Gamma = Parameters(3);
if Parameters(1) == 0
    K = sum(diag(AlphaY)* (SVs'*Xnew)) - Bias;
    f = K';
elseif Parameters(1) == 1
    Degree = Parameters(2);
    Coefficient = Parameters(4);
    K = sum(diag(AlphaY)* ((Gamma*(SVs'*Xnew)+Coefficient).^Degree)) - Bias;
    f = K';
elseif Parameters(1) == 2
    for i = 1:size(Xnew,2)
        K(i) = 0;
        for j = 1:size(SVs,2)
            K(i) = K(i) + AlphaY(j)* exp(-Gamma*norm(Xnew(:,i)-SVs(:,j))^2);
        end
        K(i) = K(i) - Bias;
    end
    f = K;
end
