Bob Matthews

Ranch Hand
+ Follow
since Jan 01, 2013
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Bob Matthews

yes - that's the puzzler - line 122 is the middle line of code below



Bob M
3 months ago
Finally all .csv files are correct BUT I now have the following error
which is odd since all my labels are in the range 0 thru 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

Bob M
3 months ago
Thank you for your advice

Bob M
New Zealand
3 months ago

Why I do not recommend to use your design with Java.util.List: you will need to iterate whole list each time when you need to update a value.



Thank you but I would prefer to stay with ArrayList <String, Integer> or Map<String, Integer> if I can

I am following an example of code for dl4j and ArrayList<> is used further on in the code

I only need to update all the integers once

Bob M
3 months ago
Ha....ha..........
I am a novice programmer, I don't know
3 months ago

It is populated by

I was looking at
etc to populate the ArrayList and then
etc to update the contents
3 months ago
I have an array list made up of pairs of strings and integers (one of each in each pair)

I also have a .csv column vector with integer values which I wish to update the array list with

How do I accomplish that ?

Bob M

p.s. do I use the arraylist.set(.....) command and if so how do I reference the integer in the pair?
3 months ago
Thank you

Paul: there are many confusing aspects of the dl4j example I am looking at

And your comment is just one of them

details of the example -

https://archive.ics.uci.edu/ml/datasets/Synthetic+Control+Chart+Time+Series

the example produces a huge number of .csv files - none of which are comma separated ???

The example appears to me (a novice) as highly inefficient in its methods of handling data

Bob M
4 months ago
At the moment I have a .csv file

When I look at it it looks like this
1 3 8 4 2 5 4

I would like to change it to
1
3
8
4
2
5
4

How do I do that ?

Bob M
4 months ago
The following code is where the .csv files are populated
and it is the features files that are ending up as row vectors rather than column vectors

4 months ago
The following code is my current version:-

The idea of the changes is to read the data from files on my computer rather than from the web
In addition, I have shuffled the data rows so that the categories are now random between 0 and 5



Unfortunately, my features .csv files end up as row vectors and they should be column vectors

So I am still wrong somewhere in the code ?
4 months ago
yes - line 33
4 months ago
I have altered my code but still in error ?

A problem with the categories (labels)

Error: NumberFormatException "[Ljava.lang.String;@7fc2413d"
which is what I see in 0.csv in labels

4 months ago
Hello Liutauras

Thanks for the comment which I will take on board

I have a general question regarding the code from the example.......................

It ends up creating 600 separate .csv files for the data and 600 separate .csv files for the categories

If one wishes to classify huge amounts of data, should I be looking for more efficient data handling processes

Bob M
4 months ago
Hi

The following code is from the UCI Classification Example under the dl4j umbrella
The data is read in from a website via a URL
The data has 600 records, the first 100 are category 1, the next 100 are category 2 etc.



I am changing the code to suit my circumstances
I have two files on my computer - one is data.csv and the other cats.csv
When I try to run my altered code(see below)  I get an error on the line



The error is "incompatible types"
Can somebody explain what is wrong here

Bob M

4 months ago