function perf = pred_perf(Atest, btest, w, loss_function)
    switch lower(loss_function)
        case 'logistic'
            perf = sum(sign(Atest * w)==btest)/length(btest); 
        otherwise %'least_squares'
            perf = norm(Atest * w - btest)^2/length(btest);
    end
end