Computing the posterior probabilities to make predictions on test data and model evaluation