Stata recently added integration with the open source machine learning platform H2O. In order to use H2O in Stata, you first need to download, install, and initialise the H2O platform. For download and installation, there are two options:
If you are reasonably familiar with your computer system and its file structure, you can manually download and install H2O from the H2O AI website.
h2o init command.I have created the command h2oinstall to download and install H2O automatically for you. Download the command below and place it along your adopath. If you do not currently have H2O installed, the command can be run without options and will install the H2O release 3.46.0.7.
You can also install this directly in Stata using the net install command:
. net from http://techtips.surveydesign.com.au/docs/h2o-installation
-------------------------------------------------------------------------------------------------------------
http://techtips.surveydesign.com.au/docs/h2o-installation/
(no title)
-------------------------------------------------------------------------------------------------------------
PACKAGES you could -net describe-:
h2oinstall module to download and install the H2O package for use with Stata
-------------------------------------------------------------------------------------------------------------
. net install h2oinstall
checking h2oinstall consistency and verifying not already installed...
installing into C:\Users\LauraWhiting\ado\plus\...
installation complete.
If you would like to update a current installation to the latest stable release the command is also equipped to do that for you as well.
PLEASE NOTE: The H2O file is downloaded within Stata so may take many minutes to download. For the Windows version of Stata there is a progress bar shown in the bottom-left corner of Stata which will display progress each time a subsequent 10% of the file has been downloaded.
The h2o init command can be used to initialise your own personal H2O cluster. By default, this cluster is hosted on your own personal computer and can only be accessed by you directly via Stata. The cluster is not connected to the internet and cannot be accessed by anyone but you.
. h2o init
Connecting to the H2O cluster running at http://127.0.0.1:54321.....not found.
Starting a new cluster running at http://127.0.0.1:54321.
Connecting to the H2O cluster running at http://127.0.0.1:54321... Successful.
------------------------------------------------------------------------------
H2O cluster uptime: 2 secs
H2O cluster timezone: Australia/Sydney
H2O data parsing timezone: UTC
H2O cluster version: 3.46.0.7
H2O cluster version age: 2 months and 15 days
H2O cluster total nodes: 1
H2O cluster free memory: 3.895 Gb
H2O cluster total cores: 12
H2O cluster allowed cores: 12
H2O cluster status: accepting new members, healthy
H2O connection url: http://127.0.0.1:54321
------------------------------------------------------------------------------
Once your H2O cluster has been set up and initialised, you can put your Stata dataset into the cluster by creating an H2O dataframe and transferring your dataset to it. For example:
sysuse auto, clear
_h2oframe put, into(auto)
_h2oframe change auto
Once the data is within the h2o frame, you can use Stata’s new inbuilt h2o commands for analysis.