Skip to content

Instantly share code, notes, and snippets.

@rvndbalaji
Created July 24, 2018 14:33
Show Gist options
  • Save rvndbalaji/2bd06a7d86b8799584f6e408502e9a32 to your computer and use it in GitHub Desktop.
Save rvndbalaji/2bd06a7d86b8799584f6e408502e9a32 to your computer and use it in GitHub Desktop.
#Install the package, if you havn't already done so.
install.packages('psych')
#Randomply sample the data into two parts with replacement and probability
ind = sample(2,nrow(room_n),replace = TRUE,prob = c(0.8,0.2))
train = room_n[ind==1,]
test = room_n[ind==2,]
#Predictors
X = as.matrix(train[,-6])
#Add 1 to column
X = cbind(1,X)
#Response
Y = as.numeric(as.matrix(train[,6]))
#Plot the correlation graph. THIS WILL TAKE A LOT OF TIME. 20K rows after all
pairs.panels(room)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment