Linear regression is probably the first statistical approach that you’ll ever encounter when you’re learning data science and machine learning. So, I’d take my chance to guess that this is not the first time you’re dealing with linear regression. Thus in this article, I want to talk about probabilistic linear regression instead of the typical/deterministic linear regression.

But before that, let’s briefly discuss the concept of deterministic linear regression to get us up to the speed to the main talking point of this article.

Linear regression is a fundamental statistical approach to model the linear relationship between one or multiple input variables (or independent variables) with one or multiple output variables (or dependent variables).

Image for post

In the above equation, a is called the intercept, and b is called the slope. x is our independent variable, and y is our dependent variable, which the value we try to predict.

The value for and b need to be optimized with a gradient descent algorithm. Then, we obtain a regression line that shows the best fit between independent and dependent variables. With the regression line, we can predict the value of ywith any given input of x . Those are the steps on how the typical or deterministic linear regression algorithm is normally built.
However, this deterministic linear regression algorithm doesn’t really tell the complete story of both the data and the model. Why is that?

In reality, there are two types of uncertainty that arise when we do linear regression analysis:

  • Aleatoric uncertainty, which is the uncertainty that arises from the data.
  • Epistemic uncertainty, which is the uncertainty that arises from the regression model.

I’m going to elaborate more on these uncertainties as we go through the article. To take these uncertainties into account, probabilistic linear regression should be used instead of deterministic linear regression.

In this article, we will talk about probabilistic linear regression and how it differs from the deterministic linear regression. We will first see how deterministic linear regression is built in TensorFlow, and then we will move on to build a probabilistic linear regression model with TensorFlow probability.

First, let’s start with loading the dataset that we will use in this article.

#statistics #regression #bayesian-statistics #data-science #machine-learning

Probabilistic Linear Regression with Weight Uncertainty
1.90 GEEK