Best bayesian filtering library

What is the best bayesian filtering library in php? Please recommend the best ones that I can use.

given that there are not many libraries at all, it boils down to personal preference.

Ok, which one yourself would go?

I don’t know the difference of bayes abd svm? To detect spams which one shoul I go with?

use Camspiers\StatisticalClassifier\Classifier\ComplementNaiveBayes;
use Camspiers\StatisticalClassifier\DataSource\DataArray;

$source = new DataArray();
$source->addDocument(‘spam’, ‘Some spam document’);
$source->addDocument(‘spam’, ‘Another spam document’);
$source->addDocument(‘ham’, ‘Some ham document’);
$source->addDocument(‘ham’, ‘Another ham document’);

$classifier = new ComplementNaiveBayes($source);
$classifier->is(‘ham’, ‘Some ham document’); // bool(true)
$classifier->classify(‘Some ham document’); // string “ham”

For addDocument, first param is a name and second param is fir example email source we want to look into? The what exactly shoukd be first and second param of is() and classify()?

I looked at source code, is it a correct usage?

$source = new DataArray();
$source->addDocument('spam', 'viagra');
$source->addDocument('spam', 'cancer');
$classifier = new ComplementNaiveBayes($source);
$classifier->is('spam', $email_text); 

If yes, is it case sensitive for Viagra and Viagra? and what is difference of SVM and Bayes?

Isn’t it a bug? or am I wrong?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.