Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
    Bookmark Topic Watch Topic
  • New Topic

debugging code required

 
Natasha Teokotai
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi all

I have a java program utilizing a data mining program called weka

http://www.cs.waikato.ac.nz/ml/weka/

My program loops through seven weka classifiers and I wish to printout the options for the current classifier


part of the code is as follows......................

// Choose a set of classifiers
Classifier[] models = new Classifier[] {
new KStar(),
new J48(),
new JRip(),
new NaiveBayes(),
new LMT(),
new KStar(),
new LibSVM() };


// Run for each classifier model
for(int j = 0; j < models.length; j++) {

data.setClassIndex(attributesArray[j] - 1); // I have setup this array which is an array of the number of attributes for each of the seven classifiers

Remove filter = new Remove(); // First, we create the base object.
filter.setAttributeIndicesArray(filtersArray[j]); // Finally, we provide an array of integer indexes.

//build classifier
FilteredClassifier fc = new FilteredClassifier(); // Create a FilteredClassifier object
((OptionHandler)models[j]).setOptions(optionsArray[j]);
fc.setClassifier(models[j]);

*** I think I wish the debugging code to go here ? ***

fc.setFilter(filter);

fc.buildClassifier(training);

*********************************************
My optionsArray looks like this.....................

String[][] optionsArray = new String[][] {
weka.core.Utils.splitOptions ("-B 35 -M a"), // KStar
weka.core.Utils.splitOptions ("-C 0.25 _M 2"), // J48

etc..etc......

Many thanks

Natasha
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
I think i"m missing the question. Do you get an error? Do you have a question about how to debug? What problem are you trying to solve?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
Now I see this is a duplicate thread. There is a nice discussion going in the other copy so closing this one.
 
    Bookmark Topic Watch Topic
  • New Topic