What Is A Home Worth? A Machine Learning Approach.
We examine a data set of home sales in Aimes, Iowa to determine which features are the most significant in setting a home's price. This information is useful to homeowners, real estate agents, appraisers and insurers.
As with any data science task, our first task was to examine and clean the data. We strongly suspected that the relationship would be linear so our work focused on transforming the data to satisfy the requirements for linear regression. For example, the Sale Price, our dependent variable, was skewed to the right, so we applied a log transformation to bring the distribution closer to normal.
Next, was feature engineering and selection. The data set was rich with features, such as number of half baths and number of full baths. As one may expect, such granular detail was not necessary, so we combined them into a single "number of baths" feature. Furthermore, there were numerous descriptions of the pools available in certain homes. However, the most important element was simply whether there was a pool or not, so we simplified this into a simple binary feature, 1 if there was a pool, 0 otherwise.
For feature selection, we relied on Lasso regression and Variance Inflation Factor analysis. The former was much more effective so we used the suggestions obtained from it.
At this point, we went about tuning our model using Grid Search and selected others including, Ridge, Random Forest and XGBoost.
As expected, we found the linear relationship was the best, so our best results were from Lasso and Ridge. For this reason, Random Forest and XGBoost did not perform as well since they do not assume the underlying relationship is linear.
Model |
Best RMSE Score |
Stacked Model |
0.1169 |
Lasso |
0.1189 |
Ridge |
0.1201 |
XGB |
0.1256 |
VIF |
0.1422 |
Random Forest |
0.1449 |
However, as seen above, once we stacked these models using a weighted average, we were able to improve our performance as measured by RMSE.