Book Image

Practical Automated Machine Learning Using H2O.ai

By : Salil Ajgaonkar
Book Image

Practical Automated Machine Learning Using H2O.ai

By: Salil Ajgaonkar

Overview of this book

With the huge amount of data being generated over the internet and the benefits that Machine Learning (ML) predictions bring to businesses, ML implementation has become a low-hanging fruit that everyone is striving for. The complex mathematics behind it, however, can be discouraging for a lot of users. This is where H2O comes in – it automates various repetitive steps, and this encapsulation helps developers focus on results rather than handling complexities. You’ll begin by understanding how H2O’s AutoML simplifies the implementation of ML by providing a simple, easy-to-use interface to train and use ML models. Next, you’ll see how AutoML automates the entire process of training multiple models, optimizing their hyperparameters, as well as explaining their performance. As you advance, you’ll find out how to leverage a Plain Old Java Object (POJO) and Model Object, Optimized (MOJO) to deploy your models to production. Throughout this book, you’ll take a hands-on approach to implementation using H2O that’ll enable you to set up your ML systems in no time. By the end of this H2O book, you’ll be able to train and use your ML models using H2O AutoML, right from experimentation all the way to production without a single need to understand complex statistics or data science.
Table of Contents (19 chapters)
1
Part 1 H2O AutoML Basics
4
Part 2 H2O AutoML Deep Dive
10
Part 3 H2O AutoML Advanced Implementation and Productization

Using H2O AutoML model MOJOs to make predictions

Making predictions using MOJOs is the same as how we make predictions using model POJOS, albeit with some minor changes. Similar to POJOs, there is a dependency on the h2o-genmodel.jar file to compile and run the model MOJO to make predictions.

So, let’s go ahead and quickly run an experiment where we can use the model MOJO with the h2o-genmodel.jar file to make predictions. We shall write a Java program that imports the h2o-genmodel.jar file and uses its classes to load and use our model MOJO to make predictions.

So, let’s start by creating a folder where we can keep the H2O MOJO file needed for the experiment and then write some code that uses it.

Follow these steps:

  1. Open your Terminal and create an empty folder by executing the following command:
    mkdir H2O_MOJO
    cd H2O_MOJO
  2. Now, copy your model MOJO file to the folder by executing the following command:
    mv ~/Downloads/DRF_1_AutoML_7_20220622_170835...