0
votes

I am new to WEKA and I'm trying to do a basic training/testing task. However, when I issue the command:

java -cp ~/Applications/weka36/weka.jar weka.classifiers.functions.SMO -t pos_neg.arff -T w1/apple_iphone.arff > ../outputs/pos_neg_apple_iphone.txt

I got an error: Weka exception: Train and test file not compatible

I guess it's because of header. The last attribuite of the two arff file is not the same. However, pos_neg.arff contains my ground truth so the last attribute is:

@attribute twit {negative, postive}

Then what should the last attribute in pos_neg_apple_iphone.arff be? I suppose it should not be positive or negative because this is to be determined, i.e., it's testing file.

Actually if one do specify the last attribute in test file to be identical to training file. What WEKA will do is to view the attributes in test file as ground truth, and output the accuracy, rather than classify tweets to be either positive or negative.

1

1 Answers

1
votes

I might found the answer. One should use -p [number of column] to do the prediction.

ref: http://maya.cs.depaul.edu/classes/ect584/weka/classify.html