Predicting Life Expectancy w/ Regression

Terence Shin, MSc, MBA
The Startup
Published in
5 min readDec 30, 2019

--

Week 5 of 52

Linear regression is one of the most widely used approaches used to model the relationship between two or more variables. It can be applied anywhere, from forecasting sales for inventory planning to determine the impact of greenhouse gases on global temperatures to predicting crop yield based on rainfall.

In this post, we’ll go over what linear regression is, how it works, and create a machine learning model to predict the average life expectancy of a person based on a number of factors.

What is Linear Regression?

According to Wikipedia, linear regression is a linear approach to modeling the relationship between a dependent variable and one or more independent variables. In simpler terms, it is the ‘line of best fit’ that represents a dataset.

Below is an example of a line that best fits the data points. By creating a line of best fit, you can predict where future points may be and identify outliers. For example, assume that this graph represents the price of diamonds based on weight. If we look at the red dot, we can see that this particular diamond is overvalued because it costs much more given the same weight as other diamonds. Similarly, the green dot is undervalued because it costs much less than other diamonds with similar weights.

--

--