I am doing a java program which uses JavaMail API and Bayesian Filter.
It would be great if I can use Classifier 4J as Bayesian filter.
I am using the following Code - In my main method.
IWordsDataSource wds = new SimpleWordsDataSource();
IClassifier classifier = new BayesianClassifier(wds);
System.out.println( "Matches = " + classifier.classify(" Do you Sex this sex is klo sex gyt sEX SEX bnn seX") );
It doesnt matter what word or sentence I use it always give me the probability 0.5.
Is it something wrong I am doing?
Thanks
Regards
JProgrammer
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You need to train your classifier using the teachMatch and teachNonMatch methods (note that you need to train <b>both</b> matches and non-matches - you can't just train matches).
Please post any further questions on the mailing list.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
Will appreciate if someone can help.
I am doing a java program which uses JavaMail API and Bayesian Filter.
It would be great if I can use Classifier 4J as Bayesian filter.
I am using the following Code - In my main method.
IWordsDataSource wds = new SimpleWordsDataSource();
IClassifier classifier = new BayesianClassifier(wds);
System.out.println( "Matches = " + classifier.classify(" Do you Sex this sex is klo sex gyt sEX SEX bnn seX") );
It doesnt matter what word or sentence I use it always give me the probability 0.5.
Is it something wrong I am doing?
Thanks
Regards
JProgrammer
You need to train your classifier using the teachMatch and teachNonMatch methods (note that you need to train <b>both</b> matches and non-matches - you can't just train matches).
Please post any further questions on the mailing list.