PHPackages                             mcheptea/nbclassifier - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mcheptea/nbclassifier

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mcheptea/nbclassifier
=====================

A simple naive bayes text/document classier. This library allows classifying text to one or more classes.

012[3 issues](https://github.com/mcheptea/nbclassifier/issues)PHP

Since May 15Pushed 10y ago1 watchersCompare

[ Source](https://github.com/mcheptea/nbclassifier)[ Packagist](https://packagist.org/packages/mcheptea/nbclassifier)[ RSS](/packages/mcheptea-nbclassifier/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHP Naive Bayes Classifier
==========================

[](#php-naive-bayes-classifier)

A simple php based Naive-Bayes text classifier.

The Naive-Bayes classifier is a statistical classifier which relies on a "trained set" to classify documents.

Documents are chunks of plain text, classes are any type of class structure a document ay fall under.

*Examples:*\* `Restaurant Menu  Food Type`\* `Vocabulary  Language`\* `Novel  Author`

How does it work?
-----------------

[](#how-does-it-work)

Before starting to use the classifier you **should train it**.

This package comes with both a Trainer and a Classifier. To achieve good performance it is recommended to train at least *200* documents before using the classifier.

*Note:* The 200 document number is an *arbitrarily high* number. As with any machine learner a *golden mean number* should be encountered for each specific case.

Installation
------------

[](#installation)

...

Usage
-----

[](#usage)

...

License
-------

[](#license)

MIT

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5627229?v=4)[Mark Cheptea](/maintainers/mcheptea)[@mcheptea](https://github.com/mcheptea)

---

Top Contributors

[![mcheptea](https://avatars.githubusercontent.com/u/5627229?v=4)](https://github.com/mcheptea "mcheptea (46 commits)")

### Embed Badge

![Health badge](/badges/mcheptea-nbclassifier/health.svg)

```
[![Health](https://phpackages.com/badges/mcheptea-nbclassifier/health.svg)](https://phpackages.com/packages/mcheptea-nbclassifier)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
