Modifying UCI Example

OK - all .csv files are correct
Now I am getting the following error - which is strange since all my labels range between 0 and 5

Exception in thread "main" java.lang.IllegalStateException: Cannot convert sequence writables to one-hot: class index 6 >= numClass (6). (Note that classes are zero-indexed, thus only values 0 to nClasses-1 are valid)
	at org.deeplearning4j.datasets.datavec.RecordReaderMultiDataSetIterator.convertWritablesSequence(RecordReaderMultiDataSetIterator.java:693)
	at org.deeplearning4j.datasets.datavec.RecordReaderMultiDataSetIterator.convertFeaturesOrLabels(RecordReaderMultiDataSetIterator.java:369)
	at org.deeplearning4j.datasets.datavec.RecordReaderMultiDataSetIterator.nextMultiDataSet(RecordReaderMultiDataSetIterator.java:333)
	at org.deeplearning4j.datasets.datavec.RecordReaderMultiDataSetIterator.next(RecordReaderMultiDataSetIterator.java:213)
	at org.deeplearning4j.datasets.datavec.SequenceRecordReaderDataSetIterator.next(SequenceRecordReaderDataSetIterator.java:365)
	at org.deeplearning4j.datasets.datavec.SequenceRecordReaderDataSetIterator.next(SequenceRecordReaderDataSetIterator.java:344)
	at org.deeplearning4j.datasets.datavec.SequenceRecordReaderDataSetIterator.next(SequenceRecordReaderDataSetIterator.java:48)
	at org.nd4j.linalg.dataset.api.preprocessor.AbstractDataSetNormalizer.fit(AbstractDataSetNormalizer.java:109)
	at org.deeplearning4j.examples.recurrent.seqclassification.UCIExample_2.main(UCIExample_2.java:122)
Process finished with exit code 1

make sure that you don’t have any header lines in your data and then make sure you really only have as many classes as you think you do. I’ve lost more than a fair share of my time on problems like this, and sanity checking the whole pipeline always has always seen a good return on time invested.

You can do two things here:

  1. Check your data
  2. Put a breakpoint on the exception, and see what the system has recognized as labels and why it thinks you have more labels than you do

Hello treo

Thank you so much for your continued efforts at sorting me out :slight_smile:

This morning I downloaded a HxD program and studied both the original data and my modified data

Original data:- space is 20H and numbers where the dec. places are not the full four have additional 20H spaces

My data: space between numbers is ‘a decimal point’ 09H and no additional spaces for numbers with less than four dec. places

Conclusion: this is why my data files consistently fall over
How to correct - I will think on that :slight_smile:

Bob M
New Zealand

1 Like