Member-only story
Linear Regression Model — Python Implementation
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.
- 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.