Learn R Programming

MAVE (version 1.3.12)

kc_house_data: House price in King County, USA

Description

A data set contains 21613 obervations with 19 features plus house price. The names of the columns are given below.

  • id

  • date: Date house was sold(String)

  • price: Price of the sold house

  • bedrooms: Numer of Bedrooms

  • bathrooms: Numer of bathrooms

  • sqft_living: Square footage of the living room

  • sqrt_log: Square footage of the log

  • floors: Total floors in the house

  • waterfront: Whether the house has a view a waterfront(1: yes, 0: not)

  • view: unknown

  • condtion: Condition of the house

  • grade: unknown

  • sqft_above: Square footage of house apart from basement

  • sqft_basement: Square footage of the basement

  • yr_built: Built year

  • yr_renovated: Year when the house was renovated

  • zipcode: zipcode of the house

  • lat: Latitude coordinate

  • long Longitude coordinate

  • sqft_living15: Living room area in 2015(implies some renovations)

  • sqrt_lot15: Lot area in 2015(implies some renovations)

Arguments

Format

A data frame with 21613 rows and 19 variables

Examples

Run this code
data(kc_house_data)
#convert date in string to date in numeric value
kc_house_data[,2]=sapply(kc_house_data[,2],as.double)
train = sample(1:21613)[1:1000]
x.train = as.matrix(kc_house_data[train,c(2,4:21)]) #exclude id, house price
y.train = as.matrix(kc_house_data[train,3]) # house price
x.test  = as.matrix(kc_house_data[-train,c(2,4:21)])
y.test  = as.matrix(kc_house_data[-train,3])

Run the code above in your browser using DataLab