Member-only story
Machine Learning: Evaluate your Linear Regression model
With methods such as the Mean squared error and coefficient of determination.
Introduction
A linear regression model attempts to find a linear relationship between the dependent and independent variables.
Mostly, it is to predict a value based on historical data.
Before that, you need to build a model, train and test it.
We will dive into the methodologies to test your linear regression model. Note the tools used may serve other models.
This article’s purpose is to explain how to estimate your model quality.
It does not detail the build and train model steps.
Prerequisites
First of all, we have to install some tools.
matplotlib is a Python library to trace and visualise data.
You can install it with the following.
pip install matplotlib
scikit-learn is a machine learning library built besides SciPy providing model fitting, data preprocessing, model selection and whatnot.
pip install -U scikit-learn
Then Jupyter Notebook to code in Python