Member-only story

Linear Regression Model — Python Implementation

Prasana V Lakshmi
2 min readSep 23, 2023

--

Performing prediction analysis is interesting and the one of the early stage concepts is regression.

In simpler terms, regression is a statistical model that shows a relationship between two variables, using a linear equation. For organizations who wish to predict or forecast a specific parameter(number of purchase), can see how another parameter (Age) would have effect on the required parameter.

With Python, the data set can understood and visualized, and then predicted for future values.

  1. Read and understand your Data set. Import the necessary libraries and then use info(), and describe() functions.

2. Generate the list of columns and assign “x” and “y” array.

3. Split the data set into training and testing data by importing the function “train_test_split”. Build and train the model by creating an instance of linear regression model.

--

--

Prasana V Lakshmi
Prasana V Lakshmi

Written by Prasana V Lakshmi

Writes, edits and stirs coffee. Drop a message to pensive.scribbler@gmail.com for any collaboration.

No responses yet