Simple Linear Regression
Simple Linear Regression is used when we want to predict one numerical value using one input feature.
One input → one numerical prediction.
Simple Linear Regression learns a straight-line relationship between one input variable and one numerical output.
A Simple Example
Suppose we want to predict a student's exam score based only on how many hours they studied.
Here, we have only one input: Study Hours.
We want to predict one output: Exam Score.
Why Is It Called "Simple"?
It is called Simple Linear Regression because there is only one input feature.
There can be many training rows, but there is only one input feature used to make the prediction.
See the Relationship
If we put the data on a graph, we can see that exam scores generally increase as study hours increase.
Simple Linear Regression tries to find a straight line that represents this relationship.
The Formula
Simple Linear Regression can be represented using:
The model learns b₀ and b₁ from the training data.
After learning them, the model can use a new value of x to calculate a prediction.
A Numerical Example
Suppose the model has learned this equation:
Now suppose a student studies for 4 hours.
So the model predicts an exam score of 75.
What Does the Slope Tell Us?
In our example:
The number 10 is the slope.
It tells us how much the predicted score changes when study hours increase by one hour.
The slope describes the direction and rate of the relationship represented by the fitted line.
Making a New Prediction
After training, we can give the model a study time it has not seen before.
The model uses the learned relationship to estimate the score for the new student.
Another Real-World Example
The same idea can be used to predict house prices from house size.
Example: 1,500 sq ft
Learns size → price relationship
Example: ₹70 lakh
Again, there is only one input feature: House Size.
Simple Linear Regression vs Multiple Linear Regression
This distinction is important because the next topic is Multiple Linear Regression.
Study Hours → Exam Score
Size + Bedrooms + Location → House Price
The key difference is the number of input features.
The Complete Idea
Simple Linear Regression = One Input → One Numerical Output.
The model learns a straight-line relationship from training data. Once the line is learned, a new input can be given to the model to produce a numerical prediction.
Which One Is Simple Linear Regression?
The first two are examples of Simple Linear Regression because each uses one input feature. The third uses multiple input features, so it belongs to Multiple Linear Regression.