optimise testing method of SVM classifier