Implementing a client subscription assessment model

To predict a client subscription assessment, we use the deep learning classifier implementation from H2O. First, we set up and create a Spark session:

val spark = SparkSession.builder        .master("local[*]")        .config("spark.sql.warehouse.dir", "E:/Exp/") // change accordingly        .appName(s"OneVsRestExample")        .getOrCreate()

Then we load the dataset as a data frame:

spark.sqlContext.setConf("spark.sql.caseSensitive", "false");val trainDF = spark.read.option("inferSchema","true")            .format("com.databricks.spark.csv")            .option("delimiter", ";")            .option("header", "true")            .load("data/bank-additional-full.csv")

Although there are categorical features in this dataset, there is no need to use a StringIndexer ...

Get Scala Machine Learning Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.