This is my arff file
@relation hamspam
@attribute text string
@attribute class {ham,spam}
@data
'good',ham
'very good',ham
'bad',spam
'very bad',spam
'very bad, very bad',spam
What i want to do is to classify it with weka clasiffier in my java program, but i don't know how to use StringToWordVector and then classify it.
this my code:
Classifier j48tree = new J48();
Instances train = new Instances(new BufferedReader(new FileReader("data.arff")));
StringToWordVector filter = new StringToWordVector();
What next?, i don't know what to do..
This code uses J48 decision tree to build a classifier trained with spamham.arff. Hope that helps.