function for predcitons and probabilities added