The naive bayes project shows how to implement a simple spam filter with c#.

It is only an example project that means it is suitable for practical usage. It uses a naive bayers classifier to decide if a mail is spam or not. For further description please see the following post at my blog:

That simple example shows how check a part of a mail if is classified as spam or not:
NaiveBayes.NaiveBayes naiveBayes = new NaiveBayes.NaiveBayes();
// spam mail
var result = naiveBayes.CheckEmail("Buy Cheap cialis Online");
Assert.AreEqual(true, result);
// not spam mail
result = naiveBayes.CheckEmail("Thanks in advance for your support");
Assert.AreEqual(false, result);

Last edited May 25, 2013 at 8:07 AM by netmatze, version 5