logo

Orhan Yavuz

Data Scientist & Software Engineer



Linear-Regression-2

Part 2 - How to use it


meme

This part will focus on how to use a linear regression model.
We are going to skip the process of training the model and treat it as a black box.
Instead, in this part we will see what to do after the model has been created and we want to predict new variables,

This is a typical workflow to follow when trying to train and use a model.
We use our data to train the model. After that, we can use the model to predict new values

Using a method called least squares, we can estimate the best values for m and n in order to best fit our data.
For now, we won't worry about the method itself and focus on the resulting model.

Parameters

Parameters are tricky because they mean different things in different parts of the process.
when training the model,

The parameters are values we want to find using the explanatory and response variables.

y = mx + b
This formula is deeply important when we are talking about regression because any model we end up creating with linear regression will use this formula with the parameters it has learned. This process is called training the model.

Models have parameters which they use to calculate the predicted response.
In the case of linear regression, we have 2 parameters: the slope (m), and the intercept (b).
These are also the 2 constant values we need in our well known equation y = mx + b