How can I use logistic regression in sklearn for continuous but bounded dependent variable?

萝らか妹 提交于 2021-01-27 12:10:25

问题


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:

  1. Stop doing logistic regression on something that is not a binary target
  2. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!