[go: nahoru, domu]

Skip to content

Using linear regression to model house prices based on information such as the number of rooms in the house.

Notifications You must be signed in to change notification settings

khyatimahajan/linear-regression-for-house-prices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Linear Regression for House Prices

This notebook uses the house price dataset from Kaggle and models the house prices using linear regression. 2 main concepts are used:

  1. Least Squares: Linear models work by trying to fit a line that can predict the output variable such that the deviation from actual output variable values is the least. This minimization is usually carried out by defining an error function that can account for the amount of errors made while fitting a line to the output variable model. The easiest way to do this is to take the difference of the predicted value and the actual value. However, when the differences could be negative and positive, they can cancel each other out and show a good fit even when the fit is bad. Therefore we need that the error function somehow give us only positive values. A solution to this is using the absolute value of the difference. However, minimizing a value requires its gradient to be known, and derivating an absolute value function is difficult. Therefore the commonly used way to get positive values is to square the difference. This is also helpful because it ends up making an error matter much more than just the value, thereby helping the model evaluate an error more seriously. Finally, it is common to take the mean of all the errors made by the model to evaluate the overall errors it has made. This is known as the Least Sqaures (LS) linear model.
  2. Least Mean Squares: In an online learning environment, we do not have access to all the error terms beforehand. Therefore for online learning, Least Mean Squares (LMS) linear model are more commonly used.

About

Using linear regression to model house prices based on information such as the number of rooms in the house.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published