Linear Regression with multiple variables is implemented to predict the prices of houses using size of the house (in square feet) and number of rooms as features. Suppose you are selling your house and you want to know what a good market price would be.
Feature normalization is performed since size of houses and number of bedrooms are on different scales. This helps in making gradient descent converge faster.
- Subtracted the mean value of each feature from the dataset.
- After subtracting the mean, additionally, the features are divided by their respective “standard deviations.”
Vectorized implementation of the cost function and gradient descent has been done.
The cost versus iterations was plotted to identify the best value of alpha.
The prediction can also be done using Normal Equation instead of gradient descent. It does not require feature scaling as well. The formula of the normal equations is shown in Fig. below:
📦Multivariate-Linear-Regression ┣ 📂Dataset ┃ ┗ 📜ex1data2.txt ┣ 📂Documents ┃ ┗ 📜Linear Regression.docx ┣ 📂Resources ┃ ┣ 📜learning-rate.PNG ┃ ┗ 📜normal-equation.PNG ┣ 📜A1_Q1_Part_2.ipynb ┗ 📜README.md