For Keras, H2O, and MXNet, we will use the adult census dataset, which uses U.S. Census data to predict whether someone makes more or less than USD50,000 a year. We will perform the data preparation for the Keras and MXNet examples here, so we are not repeating the same code in both examples:
- In the following code, we will load the data and label the two datasets to prepare for combining them:
library(tidyverse)
library(caret)
train <- read.csv("adult_processed_train.csv")
train <- train %>% dplyr::mutate(dataset = "train")
test <- read.csv("adult_processed_test.csv")
test <- test %>% dplyr::mutate(dataset = "test")
As a result of running the preceding code, we will now have our libraries loaded and ready to use. We also have the train and test data loaded, which can now be seen in the Environment...