PDA

View Full Version : Experimenter: how to set class attribute?



pgan
05-17-2008, 03:49 AM
Hi,

I have some data sets which I need in CSV format for analysis with other tools. I would rather not make ARFF copies of them to save space.

So, I want to set the class attribute in Experimenter. I set a FilteredClassifier with a ClassAssigner filter, but I still get an error "Class attribute is not nominal", so apparently it is not set. When I type the classIndex paramter to ClassAssigner, it outputs error messages on the command line:
Error parsing 'fi'!
Error parsing 'fi'!
Error parsing 'firs'!

Still, it seems to accept the string "first", like other Weka index parameters do. When I use "1" instead, it automatically reverts to "2". This looks like a bug, but maybe it is not.

Is it possible to assign the class in experimenter? I could not find anything on the web about this.

Thanks
Philip Ganchev

Mark
05-17-2008, 06:52 AM
Unfortunately, the Experimenter requires the class attribute to be in the last column. At some stage it ought to be modified to operate on the class index in the data (if set). There is a hack to make it use the first column, but this involves saving your experiment configuration as an XML file, editing this file and changing the tag with the name attribute "classFirst" to true, and then running the experiment from the command line using weka.experiment.Experiment.

I'd suggest creating new CVS or ARFF files with your first column moved to be the last column.

Cheers,
Mark.