calculate model accuracy on the training set