Preparing and preprocessing data

For this example, we will use the Adult dataset. We will walk through the steps to get this dataset in the proper form so that we can train a multilayer perceptron on it:

  1. We will first load the libraries that we need. We will use the mxnet package to train the MLP model, the tidyverse family of packages for our data cleaning and manipulation, and caret to evaluate our model. We load the libraries using the following code:
library(mxnet)library(tidyverse)library(caret)

This code will not produce any output to the console; however, you will see a checkmark next to these libraries in the Packages pane, indicating that the packages are now ready to use. Your Packages pane should look like the following screenshot: ...

Get Hands-On Deep Learning with R 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.