Return to page

BLOG

Random Forest Measurements for the MNIST Dataset

 headshot

By H2O.ai Team | minute read | August 08, 2013

Category: Uncategorized
Blog decorative banner image

This post discusses the performance of H2O’s Random Forest  [5]  algorithm. We compare different versions of H2O as well as the RF implementation by wise.io . We use wall-clock time to measure work flows that match up with the user experience. A link to the scripts used is available here [1] .

Specifications

Hardware

  • Amazon EC2 in US-EAST-1
  • M2 High-Memory Quadruple Extra Large EC2 (m2.4xlarge)
  • 26 ECUs, 8 vCPUs, 68.4 GB RAM
  • We used a 100 GB EBS mount to host the code and data.
  • No additional swap volume was needed.

Software

  • Software environment:
  • Ubuntu Server 12.04 LTS (64 bit)
  • Oracle Java 1.7.0_25
  • Bash 4
  • d3.js
  • Software under test:
  • H2O-Fourier-1 (60GB Heap)
  • H2O-Fourier-6 (60GB Heap)
  • WiseRF 1.5.9

Test Notes

  • 0xdata recommends using the Oracle JDK/JRE.
  • No swapping occurred.
  • EC2 has variable performance and results are aggregate scores over many runs.
  • We used H2O’s REST API. This API is intended for customer use.
  • Caches were dropped before each run (“sudo bash -c “sync; echo 3 > /proc/sys/vm/drop_caches”)

Data

The original MNIST data (60,000 28×28 images of hand-written digits) was expanded into 8.1 million instances by thickening, dilating, skewing, and contracting the original images as described here [2] .

This expanded  MNIST dataset is available here [3] . There are 784 features with values in the range 0 – 255. This data was split into testing and training sets following the methodology described here [4] .

Dataset Name: mnist8m
Number of Features: 784</code></li>
Number of Training Observations: 7,000,000
Number of Testing Observations: 1,100,000
Number of Classes: 10

Parameters & Methodology

The following parameters were used for comparing the H2O RF and WiseRF algorithms. These parameters were chosen using the methodology described here [4] .

This methodology was previously shown to produce very low error rates when predicting on the test data (less than one-tenth of one percent in all cases).
Tests were performed on an Amazon EC2 instance. Since individual runs in EC2 can experience variability, each configuration was run 10 times. The graphs in the “Speed” section below show box plots for each configuration (each box represents 10 runs).

Config:

H2O

  • mtry: 37
  • sample: 100
  • ntree: 10
  • criteria: entropy

Defaults:

  • seed: 784834182943470027
  • depth: 2147483647 (no limit)
  • bin limit: 1024
  • parallel: 1

WiseRF

  • mtry: 33
  • lambda: 1
  • ntree: 10
  • criteria: infogain
  • bootstrap: false

Defaults:

  • seed: 1
  • max depth: 0 (no limit)
  • min node size: 1
  • threads: 10
  • feature type: uchar, float, double

Speed

The following graphs show the measurements for H2O’s RF and WiseRF. All measurements are wall clock times. The graphs are broken down into overall run time, the time to parse the training file, the time to train the model, and the time to parse and score a test file. Note: Graphs are annotated with median times. 

graph with small images graph with small images

The graphs show that H2O’s RF performance improved significantly from Fourier-1 to Fourier-6. The reader can see that overall  the Wise RF algorithm performs roughly equivalently to H2O when the dataset values do not fit perfectly within a single byte. Also note that, once a model is built, both H2O and WiseRF-uchar parse and score the test data in nearly the same amount of time.

Memory Usage

The graph shows memory utilization (RSS) for each algorithm over time. These values were collected over one additional independent run for each algorithm. Note that none of the algorithms required swap to run.

Memory used graph Memory used graph

Conclusions

H2O’s Random Forest is open source and continuously improving . 0xdata invites everyone to download the source code  and contribute improvements to the algorithm and harness.

Reproducing These Results

Scripts and Steps to reproduce the data are available here . Directions in the README.
Data used to generate charts above available here  and also below in the tables (memory tables excluded).

References

[1] Data and Scripts 
[2] Bottou et al. MNIST8M Origination (pdf) 
[3] MNIST8M in libsvm format 
[4] wise.io blog 
[5] Random Forest is a trademark of Salford Systems, Inc.

Tables

WiseRF-double Speed Summary

trainfile_parse.minutes8.550.7
train_time.minutes.14.710.06
test_time.seconds.94.53.1
overall_time.minutes.25.370.7

 

WiseRF-float Speed Summary

trainfile_parse.minutes.8.41.41
train_time.minutes.11.730.51
test_time.seconds.91.012.71
overall_time.minutes.22.031.6

 

WiseRF-uchar Speed Summary

trainfile_parse.minutes.5.851.75
train_time.minutes.8.220.12
test_time.seconds.48.55.84
overall_time.minutes.15.11.73

 

H2O-Fourier-1-aec3679e7c.csv Speed Summary

trainfile_parse.minutes.4.150.31
train_time.minutes.37.450.36
test_time.seconds.44.27.64
overall_time.minutes.42.470.52

 

H2O-Fourier-6-137 Speed Summary

trainfile_parse.minutes.3.920.21
train_time.minutes.18.530.2
test_time.seconds.42.73.33
overall_time.minutes.23.290.37

 

Speed Table (All Data Points)

fourier-1-h2o-aec3679e7c4.9237.646.043.38
fourier-1-h2o-aec3679e7c4.1537.4341.042.45
fourier-1-h2o-aec3679e7c3.937.2352.042.12
fourier-1-h2o-aec3679e7c4.0836.7741.041.67
fourier-1-h2o-aec3679e7c4.1337.2525.041.93
fourier-1-h2o-aec3679e7c3.9737.7749.042.7
fourier-1-h2o-aec3679e7c3.8537.5744.042.27
fourier-1-h2o-aec3679e7c4.0738.147.043.08
fourier-1-h2o-aec3679e7c4.037.5547.042.48
fourier-1-h2o-aec3679e7c4.4337.2550.042.65
fourier-6-h2o-1373.7818.6849.023.42
fourier-6-h2o-1374.2718.9844.024.13
fourier-6-h2o-1373.8818.3544.023.1
fourier-6-h2o-1373.5718.6739.023.03
fourier-6-h2o-1374.018.3744.023.23
fourier-6-h2o-1373.9718.5245.023.37
fourier-6-h2o-1373.918.3540.023.03
fourier-6-h2o-1374.1518.539.023.42
fourier-6-h2o-1373.6518.3539.022.77
fourier-6-h2o-1374.018.5344.023.38
WiseRF-double8.3914.795.025.2
WiseRF-double8.3514.6696.025.15
WiseRF-double8.5114.6197.025.3
WiseRF-double8.4214.6796.025.23
WiseRF-double10.5214.8286.027.35
WiseRF-double8.2414.7394.025.05
WiseRF-double8.214.6796.025.02
WiseRF-double8.2214.7895.025.13
WiseRF-double8.314.7195.025.13
WiseRF-double8.3114.7295.025.15
WiseRF-float7.0211.4780.020.2
WiseRF-float7.011.5281.020.23
WiseRF-float9.5211.53103.023.13
WiseRF-float9.1411.5380.022.37
WiseRF-float7.1211.44112.020.8
WiseRF-float10.411.57106.024.1
WiseRF-float10.5111.5383.023.8
WiseRF-float7.4111.4980.020.6
WiseRF-float7.2812.0985.021.15
WiseRF-float8.6313.09100.023.88
WiseRF-uchar5.138.1848.014.32
WiseRF-uchar5.158.1647.014.32
WiseRF-uchar5.258.3746.014.62
WiseRF-uchar5.148.5246.014.67
WiseRF-uchar5.038.1546.014.17
WiseRF-uchar5.058.1246.014.17
WiseRF-uchar10.628.1747.019.8
WiseRF-uchar5.168.1747.014.37
WiseRF-uchar6.758.2147.015.97
WiseRF-uchar5.178.1965.014.65

 

 headshot

H2O.ai Team

At H2O.ai, democratizing AI isn’t just an idea. It’s a movement. And that means that it requires action. We started out as a group of like minded individuals in the open source community, collectively driven by the idea that there should be freedom around the creation and use of AI.

Today we have evolved into a global company built by people from a variety of different backgrounds and skill sets, all driven to be part of something greater than ourselves. Our partnerships now extend beyond the open-source community to include business customers, academia, and non-profit organizations.