Implementation with JavaMail API

Help
2004-05-31
2004-05-31
  • jprogrammer

    jprogrammer - 2004-05-31

    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

     
    • Nick Lothian

      Nick Lothian - 2004-05-31

      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.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks