Skip to content

Instantly share code, notes, and snippets.

@mmuratarat
Last active September 14, 2017 07:15
Show Gist options
  • Save mmuratarat/ee5bcb76b20ece6b117e177f2b6b1c9d to your computer and use it in GitHub Desktop.
Save mmuratarat/ee5bcb76b20ece6b117e177f2b6b1c9d to your computer and use it in GitHub Desktop.
housing <- read.csv("https://goo.gl/eYbv9F",
header = TRUE,
sep = "," )
normalized <- apply(housing[ , -3 ], 2, scale)
normalized_data <- data.frame(cbind(normalized, price = housing$price))
model <- lm( price ~ ., data = normalized_data)
model
#
#Call:
# lm(formula = price ~ ., data = normalized_data)
#
#Coefficients:
# (Intercept) area bedrooms
# 340413 110631 -6649
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment