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

Preparing the training and test sets

One of the most important parts of the data science pipeline, after data collection (which was in a sense outsourced—we use data collected by others) is data preprocessing, that is, clearing the dataset and transforming it to suit our needs.

So, our goal is to predict the direction of price change from the actual price in dollars over time. To do that, we define variables such as file, symbol, batchSize, splitRatio, and epochs. You can see the explanation of each variable in the inline comments within this code:

// StockPricePrediction.javaString file = "data/prices-split-adjusted.csv";String symbol = "GRMN"; // stock nameint batchSize = 128; // mini-batch sizedouble splitRatio = 0.8; // 80% for training, ...

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