Interest in //Web //Win //Mobile //Database & //Life

Deep Learning-Beginners Guide using R and H2O

This is a very basic tutorial on Deep Learning using R and H2O. I am going to use the H2O package for R. Please follow this link for all the installation options or you can just install package using this simple line of code.

If you are using R Studio you will get option to install package under Packages tab.

I am going to use the Car Evaluation data set for this tutorial.The model evaluates cars according to the following concept structure:

Data Set Information

CAR car acceptability
. PRICE overall price
. . buying buying price
. . maint price of the maintenance
. TECH technical characteristics
. . COMFORT comfort
. . . doors number of doors
. . . persons capacity in terms of persons to carry
. . . lug_boot the size of luggage boot
. . safety estimated safety of the car

Attribute Information

Class Values:
unacc, acc, good, vgood

buying: vhigh, high, med, low.
maint: vhigh, high, med, low.
doors: 2, 3, 4, 5more.
persons: 2, 4, more.
lug_boot: small, med, big.
safety: low, med, high.

all right, fasten your seat belts, I am going to start the journey.

Using R Studio I have created a new R script with the following code.

This block of code will load H2O package and will initialize H2O. If everything goes fine you are going to see the following message in the console.

Now you will be able use H2O flow in your browser with the following url http://localhost:54321/


The “Assistance” will help you to get started. Use the Import Files option to import your data set in H2O Flow.

H2OFlow-ImportFiles-1 H2OFlow-ImportFiles-2

Click on Parse these files to parse your data set and you will get the option to set up the parsing option.

H2OFlow-Parse H2OFlow-Parse-2

I am going to change the data type for column 3 and 4 from Numeric to String as in our data set Column 3 and 4 represents these following attributes and they contain string value.

doors: 2, 3, 4, 5more.
persons: 2, 4, more.

so after necessary modification the setup will look like the following:


Parse Setup

H2O Flow Parse Result

Parse Result

click on view to see the frame view.


click on Split to split your frame into 75% training data set and 25% test data set(this is the default).H2OFlow-Split


now it’s time to build the model and to do that click on build model. Select the algorithm as Deep Learning. You will find lots of parameters to select for building the model. For this example, I have used the following:




For the rest I kept the default values and clicked on Build.


To see the results click on view. I am presenting some of the outcomes over here.H2O_Model_Confusion_Matrix H2O_Model_LogLoss_MSE


For further research, you can follow these links below:

Deep LearningH2ORR Studio

Md Shiefuzzaman • July 27, 2016

Previous Post

Next Post