I'm using Weka for text classification task. I created my data.arff File. It contains two attributes:
- text attribute
- class attribute
Then, the generated ARFF file is processed with the StringToWordVector:
java weka.filters.unsupervised.attribute.StringToWordVector -i data/weather.arff -o data/out.arff Then, NaiveBayes is used: java weka.classifiers.bayes.NaiveBayes -t data/out.arff -K
I have this problem:
weka.core.UnsupportedAttributeTypeException: weka.classifiers.bayes.NaiveBayes: Cannot handle numeric class! at weka.core.Capabilities.test(Capabilities.java:954) at weka.core.Capabilities.test(Capabilities.java:1110) at weka.core.Capabilities.test(Capabilities.java:1023) at weka.core.Capabilities.testWithFail(Capabilities.java:1302) at weka.classifiers.bayes.NaiveBayes.buildClassifier(NaiveBayes.java:213) at weka.classifiers.Evaluation.evaluateModel(Evaluation.java:1076) at weka.classifiers.Classifier.runClassifier(Classifier.java:312) at weka.classifiers.bayes.NaiveBayes.main(NaiveBayes.java:944) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at weka.gui.SimpleCLIPanel$ClassRunner.run(SimpleCLIPanel.java:265)
Could anyone help me? I'm stuck at this level.