Regression analysis is an important tool in data science, which enables us to analyze the relationship between variables and draw…