1
$\begingroup$

For each predicted value in a logistic model, is there any way of also obtaining a "probability score"? I'm using Python's SKLearn library to create a logistic regression model that either predicts either 1 or 0 and I would like to have another column indicating how "sure" the model is of the particular outcome. The closest that I've come is using a Linear Regression Model instead, which comes out with a number between 0 and 1. Not sure whether this is a good "probability" to use. Also, there are outcomes outside the range. Is there any way to do this or a better method for this type of analysis?

Thank you!

$\endgroup$
  • $\begingroup$ There is a predict_proba method. $\endgroup$ – Matthew Drury May 23 '17 at 0:32
1
$\begingroup$

I don't have experience with SKLearn, but a logistic regression model per se actually provides a probability of class membership. The classification comes at a later stage when you specify a probability cutoff (typically 1/2, but that can be adjusted if, for example, different misclassification errors have different costs). I would recommend looking into the SKLearn documentation for how to get the probability values from the program.

$\endgroup$
  • 1
    $\begingroup$ It just doesn't seem like the OP'er is looking at it the right way. I have never used SKLearn, but a quick search produced this Jupyter Notebook example with a clear probability of log odds ratio (I don't know). $\endgroup$ – Antoni Parellada May 23 '17 at 0:27
  • $\begingroup$ @ Antoni Parellada, it looks like I just had to use predict_proba. Thanks! $\endgroup$ – minnymate May 24 '17 at 17:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.