逻辑回归用于二元分类。
在线性回归中,结果是连续的,而在逻辑回归中,结果是离散的(不连续)。
为了执行线性回归,我们需要因变量和自变量之间的线性关系。但是,为了执行逻辑回归,我们不需要因变量和自变量之间的线性关系。
线性回归是将一条直线拟合到数据中,而逻辑回归是将一条曲线拟合到数据中。
线性回归是机器学习中的回归算法,而逻辑回归是机器学习中的分类算法。
线性回归假设因变量服从高斯(或正态)分布。逻辑回归假设因变量服从二项式分布。
| Basis | Linear | Logistic |
|-----------------------------------------------------------------|--------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|
| Basic | The data is modelled using a straight line. | The probability of some obtained event is represented as a linear function of a combination of predictor variables. |
| Linear relationship between dependent and independent variables | Is required | Not required |
| The independent variable | Could be correlated with each other. (Specially in multiple linear regression) | Should not be correlated with each other (no multicollinearity exist). |