当我们必须预测分类(或离散)结果的值时,我们使用逻辑回归。我相信我们使用线性回归来预测给定输入值的结果值。
那么,这两种方法有什么不同呢?
当我们必须预测分类(或离散)结果的值时,我们使用逻辑回归。我相信我们使用线性回归来预测给定输入值的结果值。
那么,这两种方法有什么不同呢?
当前回答
| 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). |
其他回答
| 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). |
简而言之: 线性回归给出连续的输出。即在一个值范围内的任何值。 逻辑回归给出离散的输出。即Yes/No, 0/1类型的输出。
非常同意以上的评论。 除此之外,还有一些不同之处
在线性回归中,残差被假设为正态分布。 在逻辑回归中,残差需要是独立的,但不是正态分布。
线性回归假设解释变量值的恒定变化导致响应变量的恒定变化。 如果响应变量的值代表概率(在逻辑回归中),则此假设不成立。
广义线性模型(GLM)不假设因变量和自变量之间存在线性关系。但在logit模型中,它假设link函数与自变量之间是线性关系。
在线性回归中,结果是连续的,而在逻辑回归中,结果只有有限数量的可能值(离散的)。
例子: 在一种情况下,x的给定值是一个地块的平方英尺大小,然后预测y的比率是在线性回归下。
相反,如果你想根据面积预测地块是否会以超过30万卢比的价格出售,你将使用逻辑回归。可能的输出是Yes,该地块的售价将超过30万卢比,或者No。
基本区别:
线性回归基本上是一个回归模型,这意味着它将给出一个函数的非离散/连续输出。这个方法给出了值。例如,给定x, f(x)是多少
例如,给定一个由不同因素组成的训练集和训练后的房地产价格,我们可以提供所需的因素来确定房地产价格。
逻辑回归基本上是一种二元分类算法,这意味着这里函数的输出值是离散的。例如:对于给定的x,如果f(x)>阈值将其分类为1,否则将其分类为0。
例如,给定一组脑瘤大小作为训练数据,我们可以使用大小作为输入来确定它是良性肿瘤还是恶性肿瘤。因此这里的输出不是0就是1。
这里的函数基本上是假设函数