问题
How can I use logistic regression in sklearn for continiuos but bounded (0<=y<=1) dependent variable? If it's not possible in sklearn, with what library can I do it?
回答1:
See the discussion here: https://scikit-learn-general.narkive.com/4dSCktaM/using-logistic-regression-on-a-continuous-target-variable
There are two suggestions:
- Stop doing logistic regression on something that is not a binary target
- Use statsmodels https://www.statsmodels.org
回答2:
It completly depends on your distribution of your problem.
This two pictures are explainining the difference between linear and logistic regression, there are also other regression types (e.g. polynomial regression), depending on your data points (here in red), you need to search for the right approach.
Here is the overview from scikit: https://scikit-learn.org/stable/supervised_learning.html#supervised-learning
来源:https://stackoverflow.com/questions/57887904/how-can-i-use-logistic-regression-in-sklearn-for-continuous-but-bounded-dependen