What is simple linear regression and why?

It is also a linear regression model with one dependant and independent variable which can be used to predict data using linearity.

Simple linear regression is used to generate a linear function like y=mx+c for a dataset considering one data type as x values and another data type as y values.

If you have a linear function, you just need to provide your x values, it will provide y values to you. Similarly, after creating the linear model (simply linear function) you can predict the y values by providing x values as the independent variable.


1. Importing all the python modules that we use in this section.

Nuwan Abeynayake

Undergraduate at Department of Computer Science & Engineering, University of Moratuwa.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store