Skip to content

Latest commit

 

History

History
33 lines (26 loc) · 2.21 KB

File metadata and controls

33 lines (26 loc) · 2.21 KB

Linear Regression

Linear regression models are used to show or predict the relationship between two variables or factors. There are 2 types of Linear Regressions.

  • Single Linear Regression
    (single independent variable (input) and a corresponding dependent variable (output))
  • Multiple Linear Regression
    (one continuous dependent variable and two or more independent variables)

Single Linear Regression attempts to find the relationship between a single independent variable (input) and a corresponding dependent variable (output). This can be expressed in the form of a straight line.

Multiple Linear Regression attempts to model the relationship between two or more features and a response by fitting a linear equation to observed data. The steps to perform multiple linear Regression are almost similar to that of single linear Regression. The Difference Lies in the evaluation. We can use it to find out which factor has the highest impact on the predicted output and now different variable relate to each other. We are required to rescale our data, when some values are way different than other values, this can lead to that the average value is not average on the graph (brouder explanation)

To understand Linear Regression it would be nice to read first how Gradient Descent is working.

Code

python3 sample_single.py
python3 sample_multiply.py

Resources: