Home Prices Prediction

King County Washington State

jay Yanamandala

11/5/2021

Description

This presentation is related to predicting home prices in King County Washington State. Since the final assignment is related to Developing Data Products CourseRA course, to keep it simple, prediction is based only on:
1. Sqft Living
2. Number of Bedrooms
3. Number of Bathrooms

This reproducible pitch and Shiny App are presented to showcase the prediction model

Access the shiny app here
Access the github repo that hosts the files here

King County Home Prices Dataset

The dataset was provided for one of the assignments in “Machine Learning Specialization” offered by Univ of Washington, and taught by:
– Emily Fox, Amazon Professor of Machine Learning
– Carlos Guestrin, Amazon Professor of Machine Learning

Dataset Exploration and Setup for Analysis

Before defining Shiny ui.R inputs, we clean the dataset for simple presentation
* Remove columns that are not needed for the current analysis
* Convert integer to numeric
* Update columns that have value ‘0’ with mean of previous five values
* Sort data for sliders in ui.R

Printing first 10 rows, and few columns of dataset

   bedrooms bathrooms sqft_living yr_built zipcode
1         3      1.00        1180     1955   98178
2         3      2.25        2570     1951   98125
3         2      1.00         770     1933   98028
4         4      3.00        1960     1965   98136
5         3      2.00        1680     1987   98074
6         4      4.50        5420     2001   98053
7         3      2.25        1715     1995   98003
8         3      1.50        1060     1963   98198
9         3      1.00        1780     1960   98146
10        3      2.50        1890     2003   98038

Define UI

In our ui.R file we define the following inputs
* slidersqft - Sqft of living space
* sliderbed - Number of Bed rooms
* sliderbath - Number of Bath rooms
* showModel - Radio button to select which ‘lm’ model to plot

In our server.R we capture the input from ui.R and
* Plot a model - default plot is sqft_living + bedrooms + bathrooms
* Print a table of 3 models
1. price -vs- sqft_living
2. price -vs- sqft_living + bedrooms
2. price -vs- sqft_living + bedrooms + bathrooms

Build LM model

Value of Predicted home sqft 2750, bedrooms 5, bathrooms 3.5 is:
$663,160.9764

Plot Linear Regression Model