SkillAgentSearch skills...

Bayes

Implementation of Naive Bayes Classifier algorithm in PHP.

Install / Use

/learn @fieg/Bayes
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Naive Bayes Classifier

Implementation of Naive Bayes Classifier algorithm in PHP.

Based on Machine Learning: Naive Bayes Document Classification Algorithm in Javascript by Burak Kanber.

Build Status

Getting started

use Fieg\Bayes\Classifier;
use Fieg\Bayes\Tokenizer\WhitespaceAndPunctuationTokenizer;

$tokenizer = new WhitespaceAndPunctuationTokenizer();
$classifier = new Classifier($tokenizer);

$classifier->train('en', 'This is english');
$classifier->train('fr', 'Je suis Hollandais');

$result = $classifier->classify('This is a naive bayes classifier');

Which would result in:

array(2) {
  'en' =>
  double(0.9)
  'fr' =>
  double(0.1)
}
View on GitHub
GitHub Stars70
CategoryEducation
Updated3mo ago
Forks14

Languages

PHP

Security Score

82/100

Audited on Dec 9, 2025

No findings