O'Reilly logo

R Deep Learning Cookbook by Achyutuni Sri Krishna Rao, Dr. PKS Prakash

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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[, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required