O'Reilly logo

Java Deep Learning Projects by Md. Rezaul Karim

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required