10/14/2017

Introduction

This application estimates the price of your dream home, if it were located in King County, Washington. Using a data set of 21,612 homes, the application builds a prediction model to estimate the price of a fictional home, based on your inputs.

How It Works

  1. Use the sliders, text boxes, and dropdown menus in the grey panel on the left to build your dream home.
  2. When you're satisfied with your choices, click the Apply Changes button to generate an estimation. It will appear beneath the interactive map.
  3. After you settle on a price point, use the interactive map to explore your surroundings. The Quick Facts box on the right will tell you how your dream home compares to other homes in your new zip code. And the different map layers will show you how homes in your new zip code compare to those in others.

Building the Prediction Algorithm

## Read and clean the data
housing <- read.csv("https://github.com/tyler-richardett/DevelopingDataProjects_CourseProject/raw/master/kc_house_data.csv")
housing <- housing[-15871, c(3:8, 11:12, 15, 17)]
housing$zipcode <- as.factor(housing$zipcode)

## Build generalized linear model
pred <- glm(price ~ ., data = housing)

## Prediction example
dream.home <- data.frame(bedrooms = 4, bathrooms = 2.5, 
                         floors = 2, sqft_living = 3000, 
                         sqft_lot = 5000, condition = 4, grade = 8, 
                         yr_built = 1982, zipcode = as.factor(98001))

predict(pred, dream.home)[[1]]
## [1] 549886.7

Explore the Map