Member-only story

Perform multiple linear regression with weights and biases on the mtcars dataset using Jax

Crystal X
5 min readNov 2, 2023

--

In a recent post I performed simple linear regression on two columns of data in the mtcars dataset, and that post can be found here:- https://tracyrenee61.medium.com/interview-question-perform-simple-linear-regression-on-the-mtcars-dataset-fc997de88660

I thought it would be a good idea to enhance the student’s knowledge of linear regression, so I decided to perform multiple linear regression on the mtcars dataset and compare the technique to simple linear regression.

Sklearn and statsmodels, the libraries that I discussed in my previous post, use the same method for multiple linear regression that they use for simple linear regression, so I decided to use a different model for this post, being a multiple linear regressor made from scratch with weights and biases using the Jax library, which has been produced by Google.

Regression models describe the relationship between variables by fitting a line to the observed data. Linear regression models use a straight line. Regression allows you to estimate how a dependent variable changes as the independent variable(s) change.

The formula for a straight line is:-

Multiple linear regression is a parametric test, meaning that it makes certain…

--

--

Crystal X
Crystal X

Written by Crystal X

I have over five decades experience in the world of work, being in fast food, the military, business, non-profits, and the healthcare sector.

No responses yet