Example code – income

This section examines the Scala-based H2O Sparkling Water Deep Learning example using the previous Canadian income data source. First, the Spark (Context, Conf, MLlib, and RDD) and H2O (h2o, deeplearning, and water) classes are imported:

import org.apache.spark.SparkContextimport org.apache.spark.SparkContext._import org.apache.spark.SparkConf import hex.deeplearning.{DeepLearningModel, DeepLearning}import hex.deeplearning.DeepLearningModel.DeepLearningParametersimport org.apache.spark.h2o._import org.apache.spark.mllibimport org.apache.spark.mllib.feature.{IDFModel, IDF, HashingTF}import org.apache.spark.rdd.RDDimport water.Key

Next, an application class called h2o_spark_dl2 is defined, the master URL is created, and ...

Get Mastering Apache Spark 2.x - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.