Re: Prediction Problem using Weka API with J48
2009-10-01 00:13:58 GMT
Please no top-posting, see mailing list etiquette why (http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html). > I don't think it has to do with the number of attributes in the training and > unlabeled data as they both have the same number of attributes (19+1 class > attribute). I am able to perform a prediction of the unlabeled data using > Weka Explorer by using the training dataset to generate a J48 model and > performing prediction using the unlabeled data. The problem only occurs > when using Weka API. I should mention that the training data is not sorted > by the class attribute (I don't think this should be a problem) but the > order of the nominal class values of the class attribute in the <at> attribute > statement matches in both the training ARFF and the unlabeled ARFF. I've created a little test class "Blah.java" from the supplied code and ran it against the UCI dataset "iris" which worked fine for me. Here's the commandline that I used: java Blah ~/somewhere/iris.arff ~/somewhere/iris.arff ~/somewhere_else/out.txt Quick explanation of the parameters: 1. training set 2. unlabeled set 3. output file for the newly generated, labeled instances For simplicity, I just used the same dataset as unlabeled data (I ensure in the code that there are no class labels set). You might want to try this class with your data and see what happens. Also, please post next time *what* version of Weka you were using. I'm using post-3.7.0 code (revision 5991).(Continue reading)
RSS Feed