After using the linear model to generate housing price predictions, I plotted the predicted results and the associated residual on a residual plot, which showed non-linear patterns (i.e. the blue line does not match up with the red line)
Residual plot for values fitted with linear regression
After that, I decided to use GAM to model the housing price for more accurate predictions. In order to do that effectively, I used LASSO to pick out the top predictors that have the most impact on the housing price.
Picking the most optimal penalty for LASSO
Top 6 predictors using LASSO at the most optimal penalty
Finally, after using GAM, the residual plot is improved significantly since the GAM model captures the non-linearity in using the top 6 variables to predict house prices in Melbourne.
Using GAM to capture the non-linearity in housing price prediction