Skip to Content
R Deep Learning Cookbook
book

R Deep Learning Cookbook

by PKS Prakash, Achyutuni Sri Krishna Rao
August 2017
Intermediate to advanced
288 pages
8h 6m
English
Packt Publishing
Content preview from R Deep Learning Cookbook

How to do it...

The section will demonstrate steps to build the GLM model using H2O.

  1. Now, load the occupancy train and test datasets in R:
# Load the occupancy data occupancy_train <-read.csv("C:/occupation_detection/datatraining.txt",stringsAsFactors = T)occupancy_test <- read.csv("C:/occupation_detection/datatest.txt",stringsAsFactors = T)
  1. The following independent (x) and dependent (y) variables will be used to model GLM:
# Define input (x) and output (y) variables"x = c("Temperature", "Humidity", "Light", "CO2", "HumidityRatio")y = "Occupancy"
  1. Based on the requirement for H2O, convert the dependent variables into factors as follows:
# Convert the outcome variable into factoroccupancy_train$Occupancy <- as.factor(occupancy_train$Occupancy) ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Deep Learning with R Cookbook

Deep Learning with R Cookbook

Swarna Gupta, Rehan Ali Ansari, Dipayan Sarkar
The Deep Learning with Keras Workshop

The Deep Learning with Keras Workshop

Matthew Moocarme, Mahla Abdolahnejad, Ritesh Bhagwat
Deep Learning for Chest Radiographs

Deep Learning for Chest Radiographs

Yashvi Chandola, Jitendra Virmani, H.S Bhadauria, Papendra Kumar

Publisher Resources

ISBN: 9781787121089Supplemental Content