📅  最后修改于: 2020-09-28 05:52:10             🧑  作者: Mango
线性回归和逻辑回归是受监督学习技术的两种著名的机器学习算法。由于这两种算法本质上都是受监督的,因此这些算法使用标记的数据集进行预测。但是它们之间的主要区别在于它们的使用方式。线性回归用于解决回归问题,而逻辑回归用于解决分类问题。两种算法的描述以及差异表在下面给出。
在上图中,因变量在Y轴(薪水)上,自变量在x轴(经验)上。回归线可以写成:
其中,a0和a1是系数,而ε是误差项。
线性回归和逻辑回归之间的区别:
Linear Regression | Logistic Regression |
---|---|
Linear regression is used to predict the continuous dependent variable using a given set of independent variables. | Logistic Regression is used to predict the categorical dependent variable using a given set of independent variables. |
Linear Regression is used for solving Regression problem. | Logistic regression is used for solving Classification problems. |
In Linear regression, we predict the value of continuous variables. | In logistic Regression, we predict the values of categorical variables. |
In linear regression, we find the best fit line, by which we can easily predict the output. | In Logistic Regression, we find the S-curve by which we can classify the samples. |
Least square estimation method is used for estimation of accuracy. | Maximum likelihood estimation method is used for estimation of accuracy. |
The output for Linear Regression must be a continuous value, such as price, age, etc. | The output of Logistic Regression must be a Categorical value such as 0 or 1, Yes or No, etc. |
In Linear regression, it is required that relationship between dependent variable and independent variable must be linear. | In Logistic regression, it is not required to have the linear relationship between the dependent and independent variable. |
In linear regression, there may be collinearity between the independent variables. | In logistic regression, there should not be collinearity between the independent variable. |