|
|
-
Re: Help with MatrixDumperLance Norskog 2012-01-20, 22:41
Dumping vectors is a separate job called 'vectordump'.
On Fri, Jan 20, 2012 at 1:54 PM, Suneel Marthi <[EMAIL PROTECTED]> wrote: > Mahout Version: 0.6-SNAPSHOT from trunk > > > I convert my vectors (generated by seq2sparse) to matrix using the RowIdJob. > > RowIdJob creates a matrix (IntWritable, VectorWritable) and a docIndex (IntWritable, Text). > > > I am now trying to dump the matrix generated using MatrixDumper and I see this error:- > > Exception in thread "main" java.lang.ClassCastException: org.apache.mahout.math.VectorWritable cannot be cast to org.apache.mahout.math.MatrixWritable > at org.apache.mahout.utils.MatrixDumper.exportCSV(MatrixDumper.java:70) > at org.apache.mahout.utils.MatrixDumper.run(MatrixDumper.java:63) > at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65) > at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:79) > at org.apache.mahout.utils.MatrixDumper.main(MatrixDumper.java:50) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at org.apache.hadoop.util.ProgramDriver$ProgramDescription.invoke(ProgramDriver.java:68) > at org.apache.hadoop.util.ProgramDriver.driver(ProgramDriver.java:139) > at org.apache.mahout.driver.MahoutDriver.main(MahoutDriver.java:188) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at org.apache.hadoop.util.RunJar.main(RunJar.java:156) > > > Obviously the MatrixDumper is expecting to retrieve a MatrixWritable, but what's being written into the matrix is a VectorWritable. > > Am I using MatrixDumper the right way or do we have an issue here? -- Lance Norskog [EMAIL PROTECTED] |