House Price Prediction
Let's solve our first Machine Learning problem: Can we use information about a house to predict its price?
The Problem
Imagine that you are helping someone estimate the price of a house.
You know the size of several houses and you also know how much those houses were sold for.
Now someone shows you a new house and asks:
We don't know the exact price yet. But perhaps the previous houses can help us make a reasonable prediction.
Let's Look at the Data
Suppose we have information about three houses:
| House Size | Actual Price |
|---|---|
| 1,000 sq ft | ₹50 lakh |
| 1,200 sq ft | ₹60 lakh |
| 1,400 sq ft | ₹70 lakh |
Look carefully at the numbers.
As the house size increases, the price also increases.
Can We Find a Pattern?
Instead of immediately using a Machine Learning algorithm, let's try to find the relationship ourselves.
Compare the first two houses.
So an additional 200 square feet is associated with an additional ₹10 lakh in this simple example.
How Much Does 1 Square Foot Add?
We can divide the price increase by the size increase.
₹0.05 lakh is ₹5,000.
We Can Write the Relationship as a Formula
We found that the price increases by ₹0.05 lakh for every additional square foot.
That gives us a simple relationship:
Let's check whether this formula works for our examples.
Now Predict the Price of a New House
Suppose a new house has a size of:
We can use the relationship we found:
We didn't know the actual price of the new house. We used the relationship found from the previous examples to make a prediction.
What Did We Actually Do?
We started with examples where both the house size and price were known.
We used mathematics manually here. Later, we will give the examples to a Machine Learning algorithm and let it learn the relationship for us.
But Real Predictions Aren't Perfect
Our example was deliberately simple.
In the real world, house prices do not depend only on size.
So the formula:
is useful for understanding the basic idea, but it would not be enough to accurately predict every real-world house price.
The model also needs useful information that is related to the thing we are trying to predict.
Machine Learning uses examples to find relationships that can help us predict new values.
In our simple example, we used house size and known prices to find a relationship. We then used that relationship to estimate the price of a new house.