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

Dataset preparation

In the previous section, we prepared the training and test sets. However, we need to put some extra efforts into making them consumable by DL4J. To be more specific, DL4J expects the training data as numeric and the last column to be the label column, and the remaining are features.

We will now try to prepare our training and test sets like that. First, we show the files where we saved the training and test sets:

String trainPath = "data/TCGA_train.csv"; // training setString testPath = "data/TCGA_test.csv"; // test set

Then, we define the required parameters, such as the number of features, number of classes, and batch size. Here, I use 128 as the batchSize but adjust it accordingly:

int labelIndex = 20531;// number of ...
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