How to do it...

  1. The data is imported using the standard function from R, as shown in the following code. The data is imported using the read.csv file and transformed into the matrix format followed by selecting the features used for the modeling as defined in xFeatures and yFeatures:
# Loading input and test dataxFeatures = c("Temperature", "Humidity", "Light", "CO2", "HumidityRatio")yFeatures = "Occupancy"occupancy_train <-as.matrix(read.csv("datatraining.txt",stringsAsFactors = T))occupancy_test <- as.matrix(read.csv("datatest.txt",stringsAsFactors = T))# subset features for modeling and transform to numeric valuesoccupancy_train<-apply(occupancy_train[, c(xFeatures, yFeatures)], 2, FUN=as.numeric) occupancy_test<-apply(occupancy_test[, ...

Get R Deep Learning Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.