Professional Documents
Culture Documents
:
Date :
Problem Statement:
Predicting the cost of homes in any rural area has become a significant difficulty for construction
companies.In order to anticipate the cost of dwellings in Coimbatore for a specific square foot, the
least squares method must be used.
Problem Analysis:
Here, we will create and assess a model that was trained and tested using information gathered from
homes in the outskirts of Coimbatore.We will use this model to forecast the financial worth of a house
in every area of Coimbatore once we have a good fit.For real estate brokers and construction
businesses, where they could use the data provided on a regular basis, a model like this would be
highly helpful.Two columns and twenty rows (Area, Price) make up our data collection.Due to the
nature of basic linear regression, this is a small dataset.Using the least squares method to the provided
dataset, we analyse the issue.The dataset is divided into training and test sets.
Dataset:
Code:
(a) Using Simple Linear Regressison From Scratch:
Output:
Slope : 85.70540588654167
Intercept : 3505.4143425112743
The equation is : y = 85.70540588654167 x + 3505.4143425112743
Inference:
The equation we obtain here is y = 85.70540588654167 x + 3505.4143425112743. The graph also
proves that there is no much deviation in the values. This model can be used further by training it with
a large data.
Output:
lr_model.coef_ : array([85.70540589])
lr_model.intercept_ : 3505.414342511275
Inference:
The equation we obtain here is y = 85.70540588654167 x + 3505.4143425112743. The graph also
proves that there is no much deviation in the values. This model can be used further by training it with
a large data.