I have two CSV files, one for training data and one for testing data. My goal is to do a time series prediction on stock data. The training data consists of 80% of stocks data over the last 5 years, and the test data consists of the most recent 20% of its data. I create two CSVSequenceRecordReaders and load a file into each separate reader, then with each separate reader, I create a DataSetIterator. Everything up to that point works, except I want to create DataSets with both the TestDataSetIterator and TrainDatasetIterator. When I call the next() method from each iterator, I get NoSuchElementException error. How can I fix my DataSetIterators so that I can properly convert them into DataSet Objects?
Here is the example I am following: https://github.com/deeplearning4j/oreilly-book-dl4j-examples/blob/master/dl4j-examples/src/main/java/org/deeplearning4j/examples/recurrent/regression/SingleTimestepRegressionExample.java
When i get to around line 68, creating a DataSet object from DataSetIterator.next() does not work for either DataSetIterators. I get the error i mentioned above.