Skip to Content
Java Deep Learning Projects
book

Java Deep Learning Projects

by Md. Rezaul Karim
June 2018
Intermediate to advanced
436 pages
10h 33m
English
Packt Publishing
Content preview from Java Deep Learning Projects

Feature engineering and input dataset preparation

In this sub-section, we will see some basic feature engineering and dataset preparation that can be fed into the MLP classifier. So let's start by creating SparkSession, which is the gateway to access Spark:

SparkSession spark = SparkSession                     .builder()                     .master("local[*]")                     .config("spark.sql.warehouse.dir", "/tmp/spark")                     .appName("SurvivalPredictionMLP")                     .getOrCreate();

Then let's read the training set and see a glimpse of it:

Dataset<Row> df = spark.sqlContext()                .read()                .format("com.databricks.spark.csv")                .option("header", "true")                .option("inferSchema", "true")                .load("data/train.csv");df.show();

A snapshot of the dataset can be seen as follows:

A snapshot of the Titanic survival dataset
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java Deep Learning Essentials

Java Deep Learning Essentials

Yusuke Sugomori
Machine Learning in Java - Second Edition

Machine Learning in Java - Second Edition

AshishSingh Bhatia, Bostjan Kaluza
Mastering Java Machine Learning

Mastering Java Machine Learning

Uday Kamath, Krishna Choppella

Publisher Resources

ISBN: 9781788997454Supplemental Content