# ML | Linear Regression vs Logistic Regression

**Linear Regression** is a machine learning algorithm based on **supervised regression algorithm**. Regression models a target prediction value based on independent variables. It is mostly used for finding out the relationship between variables and forecasting. Different regression models differ based on – the kind of relationship between the dependent and independent variables, they are considering and the number of independent variables being used.**Logistic regression** is basically a **supervised classification algorithm**. In a classification problem, the target variable(or output), y, can take only discrete values for a given set of features(or inputs), X.

Linear Regression | Logistic Regression |
---|---|

Linear Regression is a supervised regression model. | Logistic Regression is a supervised classification model. |

In Linear Regression, we predict the value by an integer number. | In Logistic Regression, we predict the value by 1 or 0. |

Here no activation function is used. | Here activation function is used to convert a linear regression equation to the logistic regression equation |

Here no threshold value is needed. | Here a threshold value is added. |

Here we calculate Root Mean Square Error(RMSE) to predict the next weight value. | Here we use precision to predict the next weight value. |

Here dependent variable should be numeric and the response variable is continuous to value. | Here the dependent variable consists of only two categories. Logistic regression estimates the odds outcome of the dependent variable given a set of quantitative or categorical independent variables. |

It is based on the least square estimation. | It is based on maximum likelihood estimation. |

Here when we plot the training datasets, a straight line can be drawn that touches maximum plots. | Any change in the coefficient leads to a change in both the direction and the steepness of the logistic function. It means positive slopes result in an S-shaped curve and negative slopes result in a Z-shaped curve. |

Linear regression is used to estimate the dependent variable in case of a change in independent variables. For example, predict the price of houses. | Whereas logistic regression is used to calculate the probability of an event. For example, classify if tissue is benign or malignant. |

Linear regression assumes the normal or gaussian distribution of the dependent variable. | Logistic regression assumes the binomial distribution of the dependent variable. |

Attention reader! Don’t stop learning now. Get hold of all the important Machine Learning Concepts with the **Machine Learning Foundation Course** at a student-friendly price and become industry ready.