Evaluating your Regression Model in Python
Step-by-step follow along | Data Series | Episode 10.2
In the previous episode we discussed multiple methods in which you can evaluate your regression model. At the end of the episode we also discussed a general method which you can apply.
This article is split into two parts:
Part 1 builds a multiple linear regression model to predict fish weight given the vertical length, diagonal length, cross length, height and width of the fish in cm.
Part 2 focusses on evaluating and improving the regression model.
You can view and use the code and data used in this episode here: Link
1. Building the Regression Model
The first step is to build the regression model which we can evaluate.
For this we are going to be using fish data from: https://www.kaggle.com/aungpyaeap/fish-market to predict the weight of a fish given multiple variables.
# Import Pandas Library, used for data manipulation
# Import matplotlib, used to plot our data
# Import nump for mathematical operations
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
# Import our fish data and store it in the variable fish_data
fish_data =…