Member-only story

Linear Regression

Sharat Kedari
6 min readApr 29, 2021

--

It is one of the most widely known modeling techniques. Simple linear regression is useful for finding relationships between two continuous variables. One is a predictor or independent variable and the other is a response or dependent variable. It looks for a statistical relationship but not a deterministic relationship.

Linear Regression establishes a relationship between the dependent variable (Y) and one or more independent variables (X) using a best fit straight line (also known as a regression line).

It is represented by an equation Y=a+b*X + e, where a is the intercept, b is the slope of the line and e is the error term. This equation can be used to predict the value of the target variable based on the given predictor variable(s).

Linear Regression model to predict Insurance cost

This section will learn how to use the Python Scikit-Learn library for machine learning to implement regression functions. We will start with a simple linear regression involving two variables. This regression task will predict the Insurance cost based upon the demographic and bio-graphic metrics like age, sex, BMI, and other behavioral data.

Code:

  1. Importing Libraries

To import necessary libraries for this task, execute the following import statements:

--

--

Sharat Kedari
Sharat Kedari

No responses yet