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?
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.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.