PHPackages                             mpescador1/php-mt - 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. mpescador1/php-mt

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

mpescador1/php-mt
=================

PHP-ML - Machine Learning library for PHP

v0.4.1(4y ago)07MITPHPPHP &gt;=7.0.0

Since Sep 27Pushed 4y ago1 watchersCompare

[ Source](https://github.com/mpescador1/php-mt)[ Packagist](https://packagist.org/packages/mpescador1/php-mt)[ Docs](https://github.com/php-ai/php-ml)[ RSS](/packages/mpescador1-php-mt/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

PHP-ML - Machine Learning library for PHP
=========================================

[](#php-ml---machine-learning-library-for-php)

[![Minimum PHP Version](https://camo.githubusercontent.com/5c3072425e67297c8ef63d17acd2c86a0d2ef324f19249f2280bd7de902f63a2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230372e302d3838393242462e737667)](https://php.net/)[![Latest Stable Version](https://camo.githubusercontent.com/e22dd29f73bf361e53b3f6e7a04fe6a6d9d63eb6e1aace085e042bf0af6c4a90/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7068702d61692f7068702d6d6c2e737667)](https://packagist.org/packages/php-ai/php-ml)[![Build Status](https://camo.githubusercontent.com/bd9c590b13a89ace085ef4e1df470312e247f58ac11639f85b500ed53615d81c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7068702d61692f7068702d6d6c2f6261646765732f6275696c642e706e673f623d646576656c6f70)](https://scrutinizer-ci.com/g/php-ai/php-ml/build-status/develop)[![Documentation Status](https://camo.githubusercontent.com/f5dba9d7890a5374a8e29ef9d6b9c20ea697f3ae1e7fd30be43a5e0b678d4aa1/68747470733a2f2f72656164746865646f63732e6f72672f70726f6a656374732f7068702d6d6c2f62616467652f3f76657273696f6e3d6d6173746572)](http://php-ml.readthedocs.org/)[![Total Downloads](https://camo.githubusercontent.com/5520b32bf7f297eff12f576b02e8f42b90fb18475c758e400cd473af81c9746a/68747470733a2f2f706f7365722e707567782e6f72672f7068702d61692f7068702d6d6c2f646f776e6c6f6164732e737667)](https://packagist.org/packages/php-ai/php-ml)[![License](https://camo.githubusercontent.com/976b950a432a2a11bad43aaab3afc222b6d27eaf53f8ab507f1c104c6e47c0d6/68747470733a2f2f706f7365722e707567782e6f72672f7068702d61692f7068702d6d6c2f6c6963656e73652e737667)](https://packagist.org/packages/php-ai/php-ml)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/3cd8971fd3c2c7a71609f729b4a4b3897fdb29a7cd777a415c58f58c97f9f71b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7068702d61692f7068702d6d6c2f6261646765732f7175616c6974792d73636f72652e706e673f623d646576656c6f70)](https://scrutinizer-ci.com/g/php-ai/php-ml/?branch=develop)

[![PHP-ML - Machine Learning library for PHP](docs/assets/php-ml-logo.png)](docs/assets/php-ml-logo.png)

Fresh approach to Machine Learning in PHP. Algorithms, Cross Validation, Neural Network, Preprocessing, Feature Extraction and much more in one library.

PHP-ML requires PHP &gt;= 7.0.

Simple example of classification:

```
use Phpml\Classification\KNearestNeighbors;

$samples = [[1, 3], [1, 4], [2, 4], [3, 1], [4, 1], [4, 2]];
$labels = ['a', 'a', 'a', 'b', 'b', 'b'];

$classifier = new KNearestNeighbors();
$classifier->train($samples, $labels);

$classifier->predict([3, 2]);
// return 'b'
```

Documentation
-------------

[](#documentation)

To find out how to use PHP-ML follow [Documentation](http://php-ml.readthedocs.org/).

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

[](#installation)

Currently this library is in the process of developing, but You can install it with Composer:

```
composer require php-ai/php-ml

```

Examples
--------

[](#examples)

Example scripts are available in a separate repository [php-ai/php-ml-examples](https://github.com/php-ai/php-ml-examples).

Features
--------

[](#features)

- Association rule learning
    - [Apriori](http://php-ml.readthedocs.io/en/latest/machine-learning/association/apriori/)
- Classification
    - [SVC](http://php-ml.readthedocs.io/en/latest/machine-learning/classification/svc/)
    - [k-Nearest Neighbors](http://php-ml.readthedocs.io/en/latest/machine-learning/classification/k-nearest-neighbors/)
    - [Naive Bayes](http://php-ml.readthedocs.io/en/latest/machine-learning/classification/naive-bayes/)
    - Decision Tree (CART)
    - Ensemble Algorithms
        - Bagging (Bootstrap Aggregating)
        - Random Forest
        - AdaBoost
    - Linear
        - Adaline
        - Decision Stump
        - Perceptron
- Regression
    - [Least Squares](http://php-ml.readthedocs.io/en/latest/machine-learning/regression/least-squares/)
    - [SVR](http://php-ml.readthedocs.io/en/latest/machine-learning/regression/svr/)
- Clustering
    - [k-Means](http://php-ml.readthedocs.io/en/latest/machine-learning/clustering/k-means/)
    - [DBSCAN](http://php-ml.readthedocs.io/en/latest/machine-learning/clustering/dbscan/)
- Metric
    - [Accuracy](http://php-ml.readthedocs.io/en/latest/machine-learning/metric/accuracy/)
    - [Confusion Matrix](http://php-ml.readthedocs.io/en/latest/machine-learning/metric/confusion-matrix/)
    - [Classification Report](http://php-ml.readthedocs.io/en/latest/machine-learning/metric/classification-report/)
- Workflow
    - [Pipeline](http://php-ml.readthedocs.io/en/latest/machine-learning/workflow/pipeline)
- Neural Network
    - [Multilayer Perceptron](http://php-ml.readthedocs.io/en/latest/machine-learning/neural-network/multilayer-perceptron/)
    - [Backpropagation training](http://php-ml.readthedocs.io/en/latest/machine-learning/neural-network/backpropagation/)
- Cross Validation
    - [Random Split](http://php-ml.readthedocs.io/en/latest/machine-learning/cross-validation/random-split/)
    - [Stratified Random Split](http://php-ml.readthedocs.io/en/latest/machine-learning/cross-validation/stratified-random-split/)
- Preprocessing
    - [Normalization](http://php-ml.readthedocs.io/en/latest/machine-learning/preprocessing/normalization/)
    - [Imputation missing values](http://php-ml.readthedocs.io/en/latest/machine-learning/preprocessing/imputation-missing-values/)
- Feature Extraction
    - [Token Count Vectorizer](http://php-ml.readthedocs.io/en/latest/machine-learning/feature-extraction/token-count-vectorizer/)
    - [Tf-idf Transformer](http://php-ml.readthedocs.io/en/latest/machine-learning/feature-extraction/tf-idf-transformer/)
- Datasets
    - [Array](http://php-ml.readthedocs.io/en/latest/machine-learning/datasets/array-dataset/)
    - [CSV](http://php-ml.readthedocs.io/en/latest/machine-learning/datasets/csv-dataset/)
    - [Files](http://php-ml.readthedocs.io/en/latest/machine-learning/datasets/files-dataset/)
    - Ready to use:
        - [Iris](http://php-ml.readthedocs.io/en/latest/machine-learning/datasets/demo/iris/)
        - [Wine](http://php-ml.readthedocs.io/en/latest/machine-learning/datasets/demo/wine/)
        - [Glass](http://php-ml.readthedocs.io/en/latest/machine-learning/datasets/demo/glass/)
- Models management
    - [Persistency](http://php-ml.readthedocs.io/en/latest/machine-learning/model-manager/persistency/)
- Math
    - [Distance](http://php-ml.readthedocs.io/en/latest/math/distance/)
    - [Matrix](http://php-ml.readthedocs.io/en/latest/math/matrix/)
    - [Set](http://php-ml.readthedocs.io/en/latest/math/set/)
    - [Statistic](http://php-ml.readthedocs.io/en/latest/math/statistic/)

Contribute
----------

[](#contribute)

- [Issue Tracker: github.com/php-ai/php-ml](https://github.com/php-ai/php-ml/issues)
- [Source Code: github.com/php-ai/php-ml](https://github.com/php-ai/php-ml)

You can find more about contributing in [CONTRIBUTING.md](CONTRIBUTING.md).

License
-------

[](#license)

PHP-ML is released under the MIT Licence. See the bundled LICENSE file for details.

Author
------

[](#author)

Arkadiusz Kondas (@ArkadiuszKondas)

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1694d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/56395851?v=4)[mpescador1](/maintainers/mpescador1)[@mpescador1](https://github.com/mpescador1)

---

Top Contributors

[![mpescador1](https://avatars.githubusercontent.com/u/56395851?v=4)](https://github.com/mpescador1 "mpescador1 (9 commits)")

---

Tags

machine learningartificial intelligenceneural-networkdata sciencefeature extractionpattern recognitioncomputational learning theory

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mpescador1-php-mt/health.svg)

```
[![Health](https://phpackages.com/badges/mpescador1-php-mt/health.svg)](https://phpackages.com/packages/mpescador1-php-mt)
```

###  Alternatives

[php-ai/php-ml

PHP-ML - Machine Learning library for PHP

1061.7M12](/packages/php-ai-php-ml)[rubix/ml

A high-level machine learning and deep learning library for the PHP language.

2.2k1.4M28](/packages/rubix-ml)[nlp-tools/nlp-tools

NlpTools is a set of php 5.3+ classes for beginner to semi advanced natural language processing work.

774645.2k5](/packages/nlp-tools-nlp-tools)[codewithkyrian/transformers

State-of-the-art Machine Learning for PHP. Run Transformers in PHP

749231.8k5](/packages/codewithkyrian-transformers)[davmixcool/php-sentiment-analyzer

PHP Sentiment Analyzer is a lexicon and rule-based sentiment analysis tool that is used to understand sentiments in a sentence using VADER (Valence Aware Dictionary and sentiment Reasoner).

138151.7k1](/packages/davmixcool-php-sentiment-analyzer)[nlgen/nlgen

A library for creating recursive-descent natural language generators.

56181.3k](/packages/nlgen-nlgen)

PHPackages © 2026

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