Welcome to Machinfy Academy

blog image

Here we go again talking about machine learning models. When we hear the word of REGRESSION, lots of thinks come and go through our minds is it a supervised type ! how it works !, so let’s clarify regression types and how it works !

before we get through in more details regarding the mechanism of regression, we should know the types of Regression because it’s consisting of many types which are used separately for different objectives.

  • Linear Regression
    • Single Linear Regression
    • Multiple Linear Regression
  • Polynomial Regression
  • Ridge Regression & Lasso Regression
  • Logistic Regression

Linear Regression

The Linear Regression is a statistical machine supervised learning method which is used for prediction continuous values like in finance, salaries, weather forecasting and these types of prediction problems, by modelling a relationship between dependent variable and independent variable (independent variables can be single or multiple).

Let’s Keep it SIMPLE !

when we hear (LINEAR) word, the first thing should we think about is the linear equation for any line within two axis (x,y).

Y= Dependent variable (predicted), ß0 = Y- intercept , ß1= slope of line , X= Independent variables (input), E= Error
*the equation of single linear regression

And we can express this linear equation (first degree of Polynomial functions) in next graph that every value in x axis has got only one value in y axis, but y axis values can equal multiple values of x values (Rules of Functions)

x = height , y = weight , we can see the points which get (x,y) value for each point in scatter plot graph

so from the previous paragraph we can know the mechanism of linear regression that the model is creating the line through many times until it finds the best fit line with the lowest amount of errors between the predicted values and the actual values.

Now I’ll show you a simple example about salary and year experience data, at first figure part of the data and the second one is the regression graph.

Linear regression assumes 2 assumptions, the first is the relationship between x and y values is linear !, EVEN IF it’s not ! and that’s the point of applying different regression models on data to find out the best model with highest accuracy. The Second is the data is normal distributed.

Polynomial Regression

The Polynomial Regression is a form of regression analysis that it models the exponent degree of x, if you remember for example the parabola graph which is model of 2ed degree order equation (x2).

The advantage of Polynomial Regression is the reduction of prediction errors and the increasing of evaluation but in the other hand it’s very sensitive to the outliers !!

before the end I’ll give you a hint about the relationship (correlation) for more clarification about the linear relationship.

So at the end, see you next time and talking about Ridge & Lasso Regression.

Have a good coding night !

Leave a Reply

Your email address will not be published. Required fields are marked *