Logic Regression Threshold Management at Scikit Learn

I use the LogisticRegression() method in scikit-learn for a highly unbalanced dataset. I even included the class_weight function in auto .

I know that in logistic regression it should be possible to find out what threshold value for a certain pair of classes.

Is it possible to find out what threshold value is in each of the One-vs-All classes developed by the LogisticRegression() method?

I did not find anything on the documentation page.

Does it default to 0.5 as a threshold for all classes, regardless of parameter values?

+7
scikit-learn machine-learning classification logistic-regression
source share
1 answer

Logistic regression selects the class that has the highest probability. In the case of 2 classes, the threshold is 0.5: if P (Y = 0)> 0.5, then, obviously, P (Y = 0)> P (Y = 1). The same applies to setting up multiclasses: again, he selects the class with the highest probability (see, for example, Ng lectures , bottom lines).

The introduction of special threshold values ​​affects only the proportion of false positives / false negatives (and, therefore, a compromise with accuracy / recall), but this is not a parameter of the LR model. See also a similar question .

+8
source share

All Articles