# Lessons Learned in the 2016 Kaggle Home Data Competition

Our team had two prevailing theories concerning the ultimate goal of the “Kaggle Zillow Challenge” going into this project.

(1) The challenge site describes how exploring the error can unmask useful insights about a model. So maybe, predictions relating to the error would help the Zillow home site to tune their model (adjusting for the results of this competition). But this first theory would make more sense if we were predicting error, not “log error” as calculated by:

Log(Zestimate) - Log(SalesPrice) = LogError

(2) Zillow was being secretive and protective of their data and using this phase one of the competition as a litmus test to weed people out during phase one of the Kaggle competition before providing access to better data in phase two. With 1.2 Million in prize money at stake, you have to figure there is a logic to what they were doing. But after testing a myriad of linear models and having them all fail on the assumptions of “no collinearity” or normality of the distributions, it was easy to think that maybe they were just messing with us.

Initially, we spent days on data cleaning. Looking at the data provided, this begged the question, “is anything not missing?” The answer was a resounding “no”. The only fields where the data was 100% present were the parcelID (unique identifier for each house) and the log error / transaction dates provided in the training data.

A few highlights from our data munging experiments:

- TaxDelinquencyYear: the field contained a 1 to 2 digit year that was first converted to a standard 4-digit year. Then a calculation was run to engineer a feature representing how many years delinquent a property was in its taxes (if any). NA was assumed to be 0. The data was all from 2016 so if the delinquency year was 2016, then it got a 1 for first year of delinquency, 2 for second if 2015 and so on …
- Corplots established the appearance of linear relationships between fields. This led to a slew of linear model imputation experiments. However, all of these produced R squared values that were so poor, they almost resembled significant p-values (many decimals places below 1%). But not surprisingly, our team did get one such model to work establishing a 90% R square value on a significant p-value for a model predicting taxes paid in terms of tax dollar value for the property. This model was then used to impute missing values for that field.

These are just a few highlights. A great deal of effort went into analyzing every field, coming up with a strategy, and imputing or dropping the field as appropriate. In the end, it is questionable how much bang we actually got for our buck with respect to all the work that went into this. Then the real analytical experimentation began.

Our team explored linear models and linear models with transformation including the “Yeo Johnson” transformation. This transformation was selected because it could address the issue that Box-Cox can’t handle negative values.

With high hopes, our team added to these experiments with regularization using Ridge, Lasso, and Elastic Net. The team also ran random forest, gradient boosting and XGBoost models as well. A point of humor among the team was in connection with one of the first models we tried to test the Kaggle submission process. Dubbed “Will’s Stupid Model", it was a simplistic linear model calculating logerror in terms of just two fields: calculated finished square feet, and year built. As poor as this model did, it set our high score on Kaggle that we were almost unable to beat by any other experiment we tried until almost the end. And in the end when we finally did beat it, it was only by combining the results of this very same model with GBM by averaging the predictions of the two models together. This final experiment raised our ranking in the Kaggle competition by 95 places boosting us to 1297th place. Million dollar prize money here we come!

Educationally, as data scientists, this experience was an opportunity to experiment and try many different things even if at times it felt like the deck was stacked against us in terms of producing truly meaningful results. Along the way, our EDA meandered into exploring the question of missingness itself as a predictor of logerror.

Though this experiment did not bear fruit in terms of producing a viable model, it was an interesting exploration of the data (as shown above). So what’s the number one thing we learned from this whole experience?

Though Data Science is about finding statistically significant evidence within the data, maybe it still pays to trust your instincts. From the very beginning, this whole competition felt like a fool's errand. The one team at the Academy who truly produced the best and most interesting results, chose to ignore what the Kaggle contest was all about, and just attempt to predict home value from the data points given.