Python program: prediction with logistic regression