RE: [Classifier4j-devel] Next Step after Training?
Status: Beta
Brought to you by:
nicklothian
From: <br...@bj...> - 2004-07-15 16:45:12
|
Right - your first two for-loops are training your classifier to learn which messages are your whitelist messages. Once this is done you can test any other message against your training to get a "rating". When you run the classify() method it will return a value between 0.0 and 1.0. 0 meaning that the new message you ran classify on is definitely a blacklist message... 1.0 meaning its definitely a whitelist message. At least this is the way I'm using Classifier4J.. not sure if its the absolute correct way :) My rules are similar to SpamBayes in that I mark anything with a 0.9 and above as a definite match.. anything below that is considered a partial match (I use C4J as a spam filter against email msgs). Nick - correct me if Im wrong? I'm no C4J expert, but using it this way seems to work pretty well for me. - Brent > -----Original Message----- > From: Nick Lothian [mailto:nl...@es...] > Sent: Thursday, July 15, 2004 3:25 AM > To: 'cla...@li...' > Subject: RE: [Classifier4j-devel] Next Step after Training? > > Yes, that looks fine. > > The line "double result = > classifier.classify(bayMsgs[i].getSubject());" is doing the filtering. > > Nick > > > -----Original Message----- > From: Kashif [mailto:ks...@ai...] > Sent: Thursday, 15 July 2004 3:54 PM > To: cla...@li... > Subject: [Classifier4j-devel] Next Step after Training? > Importance: Low > > > Hi > > I solved the earlier problem with the "Exception in thread "main" > java.lang.NoClassDefFoundError: > org/apache/commons/logging/" I had to install the latest > version of jdk. > > Thanks Nick for your help with training the filter > > I used the following code > > // For Black List Arrays > for (int i=0; i<blackListArray.length; i++) { > classifier.teachNonMatch(blackListArray[i]); > } > > // For White List Arrays > for (int i=0; i<whiteListArray.length; i++) { > classifier.teachMatch(whiteListArray[i]); > } > > // For BayMsgs Arrays > // Applying Bayesian Filter on subject > // BayMsgs is an array of Message Object. > > for (int i=0; i<bayMsgs.length; i++) { > double result = > classifier.classify(bayMsgs[i].getSubject()); > } > > > Does this look OK to you. > > Can you please let me know what are the next steps, and what > should I do next to apply Bayesian filter on the subject > field only of bayMsgs Array, which holds the Message Object. > > Regards > > And Thanks for our help. > > > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop FREE > Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > _______________________________________________ > Classifier4j-devel mailing list > Cla...@li... > https://lists.sourceforge.net/lists/listinfo/classifier4j-devel > > > |