0

I'm new with weka and this is my problem: I've a unlabeled arff data and a given SMO model; I need classify this data with that model. I searched examples, but all of them use a testing set to build classifier and I've not testing sets.

I need get classification with java or weka command line.

I tryed (under linux) command like: java weka.classifiers.functions.SMO -l /path/of/mymodel/SMOModel.model -T /path/pf/myunlabeledarff/unlabeled.arff

but I get several errors :S

Can someone help me? Thanks a lot

antonioc
  • 49
  • 7

1 Answers1

0

Documentation showing that the -l flag works is here: http://weka.wikispaces.com/Primer. That documentation also indicates that your syntax is correct, and that what you are trying to do is possible.

You say that the data is unlabeled: this can cause errors if the arff file you are using to predict does not match the format of the arff file which was used to create the model. Make sure that the arff header has the class attribute declared in it, and that every instance (row) in the file has a class value in it (even if the value is a ? to indicate unknown). Otherwise the formats won't match, and the classifier won't work.

Please post your error messages if this does not solve the problem.

kaz
  • 675
  • 2
  • 5
  • 13
  • At first thanks a lot. Yes! I think that my problem is an incopatibility in the format of the arff and the model... as you saied. Infact this is the error: java.lang.Exception: training and test set are not compatible at weka.classifiers.Evaluation.evaluateModel(Evaluation.java:1035) at weka.classifiers.Classifier.runClassifier(Classifier.java:312) at weka.classifiers.functions.SMO.main(SMO.java:2138) Both, model and arff, is not mine... so do I have to say to the author that he's wrong? – antonioc May 29 '12 at 09:45
  • I am sorry. I voted to delete my answer. You have trained model. I understand as if you are trying to train a model with unlabeled data. – Atilla Ozgur May 29 '12 at 10:27
  • If the model and arff were both given to you as-is, then yes, the author of those files gave you an impossible problem. However, you can try to fix the arff file by adding the class attribute back in if it is missing. Without the original arff files that were used to train the model, however, at best you can only guess about the format of the training file, and so matching it will be very hard or impossible. – kaz May 29 '12 at 13:19