testing accuracy using training set