Simple Linear Regression
In my previous article, i used a business problem to introduce linear regression problems. In this article, i explore in detail how simple linear regression technique is implemented using code.
Using a hypothetical use case, we will assume XYZ Company dealing in advertises in radio, tv and newspaper. As the manager of this company you wish to analyze the relationship between amount spent on TV and the Sales
Sample Data
If you need further information on sampling, visit my article Sampling your Data and learn more on this topic.
Simple Linear Regression Data Split
If you need further understanding on how the data splitting works. Visit my previous article on Splitting your Dataset
Train your model using Ordinary Least Squares Method
If you need an in-depth understanding of what it means to train a model, please my previous article on "What is Training"
Checking for Bias-Variance Tradeoff
To get more information on Bias-Variance Tradeoff, please visit my previous article by clicking Bias-Variance Tradeoff
Get the parameters of the model
View the Evaluation Metrics for the Model
Make the predictions from the test set
Check how the model performs on the testing dataset
Check how the model performs on the validation dataset
Sources