PHPackages                             rubix/ml - 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. rubix/ml

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

rubix/ml
========

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

2.5.3(7mo ago)2.2k1.4M—5.5%195[72 issues](https://github.com/RubixML/ML/issues)[3 PRs](https://github.com/RubixML/ML/pulls)20MITPHPPHP &gt;=7.4CI failing

Since Apr 23Pushed 1mo ago52 watchersCompare

[ Source](https://github.com/RubixML/ML)[ Packagist](https://packagist.org/packages/rubix/ml)[ Docs](https://rubixml.github.io/ML/latest/)[ GitHub Sponsors](https://github.com/sponsors/andrewdalpino)[ RSS](/packages/rubix-ml/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (15)Versions (86)Used By (20)

Rubix ML
========

[](#rubix-ml)

[![PHP from Packagist](https://camo.githubusercontent.com/ecd57f70fa75cdcc1db4d9b81bee4c5e8a8ba53af42e9b60f9a99462d29e9e2c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f72756269782f6d6c2e7376673f7374796c653d666c617426636f6c6f72423d383839324246)](https://www.php.net/) [![Latest Stable Version](https://camo.githubusercontent.com/ae4625aa4e7868f232421e3f37da8a92c011e1de8042bdcfea37b6a5ecdb76b0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72756269782f6d6c2e7376673f7374796c653d666c617426636f6c6f72423d6f72616e6765)](https://packagist.org/packages/rubix/ml) [![Downloads from Packagist](https://camo.githubusercontent.com/3095960fbc486ccc8170787b2ff6c9ba63e0a31f962a090d226f1b9bbd8e59ae/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72756269782f6d6c2e7376673f7374796c653d666c617426636f6c6f72423d726564)](https://packagist.org/packages/rubix/ml) [![Code Checks](https://github.com/RubixML/ML/actions/workflows/ci.yml/badge.svg)](https://github.com/RubixML/ML/actions/workflows/ci.yml) [![GitHub](https://camo.githubusercontent.com/d163c07d87c4dfe3bf2c3a85ff163d12f5f6207b026607d9cc65e86a546b8e17/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f52756269784d4c2f52756269784d4c)](https://github.com/RubixML/ML/blob/master/LICENSE.md)

A high-level machine learning and deep learning library for the [PHP](https://php.net) language.

- **Developer-friendly** API is delightful to use
- **40+** supervised and unsupervised learning algorithms
- **Support** for ETL, preprocessing, and cross-validation
- **Open source** and free to use commercially

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

[](#installation)

Install Rubix ML into your project using [Composer](https://getcomposer.org/):

```
composer require rubix/ml
```

### Requirements

[](#requirements)

- [PHP](https://php.net/manual/en/install.php) 7.4 or above

#### Recommended

[](#recommended)

- [Tensor extension](https://github.com/RubixML/Tensor) for fast Matrix/Vector computing

#### Optional

[](#optional)

- [GD extension](https://php.net/manual/en/book.image.php) for image support
- [Mbstring extension](https://www.php.net/manual/en/book.mbstring.php) for fast multibyte string manipulation
- [SVM extension](https://php.net/manual/en/book.svm.php) for Support Vector Machine engine (libsvm)
- [PDO extension](https://www.php.net/manual/en/book.pdo.php) for relational database support
- [GraphViz](https://graphviz.org/) for graph visualization

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

[](#documentation)

Read the latest docs [here](https://rubixml.github.io/ML/latest/).

What is Rubix ML?
-----------------

[](#what-is-rubix-ml)

Rubix ML is a free open-source machine learning (ML) library that allows you to build programs that learn from your data using the PHP language. We provide tools for the entire machine learning life cycle from ETL to training, cross-validation, and production with over 40 supervised and unsupervised learning algorithms. In addition, we provide tutorials and other educational content to help you get started using ML in your projects.

Getting Started
---------------

[](#getting-started)

If you are new to machine learning, we recommend taking a look at the [What is Machine Learning?](https://rubixml.github.io/ML/latest/what-is-machine-learning.html) section to get started. If you are already familiar with basic ML concepts, you can browse the [basic introduction](https://rubixml.github.io/ML/latest/basic-introduction.html) for a brief look at a typical Rubix ML project. From there, you can browse the official tutorials below which range from beginner to advanced skill level.

### Tutorials &amp; Example Projects

[](#tutorials--example-projects)

Check out these example projects using the Rubix ML library. Many come with instructions and a pre-cleaned dataset.

- [CIFAR-10 Image Recognizer](https://github.com/RubixML/CIFAR-10)
- [Color Clusterer](https://github.com/RubixML/Colors)
- [Credit Default Risk Predictor](https://github.com/RubixML/Credit)
- [Customer Churn Predictor](https://github.com/RubixML/Churn)
- [Divorce Predictor](https://github.com/RubixML/Divorce)
- [DNA Taxonomer](https://github.com/RubixML/DNA)
- [Dota 2 Game Outcome Predictor](https://github.com/RubixML/Dota2)
- [Human Activity Recognizer](https://github.com/RubixML/HAR)
- [Housing Price Predictor](https://github.com/RubixML/Housing)
- [Iris Flower Classifier](https://github.com/RubixML/Iris)
- [MNIST Handwritten Digit Recognizer](https://github.com/RubixML/MNIST)
- [Text Sentiment Analyzer](https://github.com/RubixML/Sentiment)
- [Titanic Survival Predictor](https://github.com/Jenutka/titanic_php)

Interact With The Community
---------------------------

[](#interact-with-the-community)

- [Join Our Telegram Channel](https://t.me/RubixML)

Contributing
------------

[](#contributing)

See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.

License
-------

[](#license)

The code is licensed [MIT](LICENSE) and the documentation is licensed [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/).

###  Health Score

70

—

ExcellentBetter than 100% of packages

Maintenance77

Regular maintenance activity

Popularity67

Solid adoption and visibility

Community46

Growing community involvement

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 97% 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

Every ~34 days

Recently: every ~125 days

Total

85

Last Release

54d ago

Major Versions

1.3.2 → 2.0.02022-03-30

1.3.4 → 2.0.22022-06-03

0.4.3 → 2.2.12022-10-15

1.0.x-dev → 2.3.02022-12-31

2.6.x-dev → 3.0.x-dev2026-03-25

PHP version history (4 changes)0.0.1-alphaPHP &gt;=7.1.3

0.0.18-betaPHP &gt;=7.2

1.0.0-beta2PHP &gt;=7.4

3.0.x-devPHP &gt;=8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/643b22cfe15a5f3ff42dc06ce98f1e5024b6e4578fc9627a058097f5046164d8?d=identicon)[andrewdalpino](/maintainers/andrewdalpino)

---

Top Contributors

[![andrewdalpino](https://avatars.githubusercontent.com/u/18690561?v=4)](https://github.com/andrewdalpino "andrewdalpino (1995 commits)")[![simplechris](https://avatars.githubusercontent.com/u/520892?v=4)](https://github.com/simplechris "simplechris (13 commits)")[![marclaporte](https://avatars.githubusercontent.com/u/1004261?v=4)](https://github.com/marclaporte "marclaporte (5 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (5 commits)")[![Boorinio](https://avatars.githubusercontent.com/u/13625730?v=4)](https://github.com/Boorinio "Boorinio (3 commits)")[![LouisAUTHIE](https://avatars.githubusercontent.com/u/65625876?v=4)](https://github.com/LouisAUTHIE "LouisAUTHIE (3 commits)")[![absolutic](https://avatars.githubusercontent.com/u/23214898?v=4)](https://github.com/absolutic "absolutic (2 commits)")[![maximecolin](https://avatars.githubusercontent.com/u/606766?v=4)](https://github.com/maximecolin "maximecolin (2 commits)")[![bogkonstantin](https://avatars.githubusercontent.com/u/8061739?v=4)](https://github.com/bogkonstantin "bogkonstantin (2 commits)")[![DrDub](https://avatars.githubusercontent.com/u/315403?v=4)](https://github.com/DrDub "DrDub (2 commits)")[![kroky](https://avatars.githubusercontent.com/u/2064350?v=4)](https://github.com/kroky "kroky (2 commits)")[![SublimeRaiser](https://avatars.githubusercontent.com/u/52673904?v=4)](https://github.com/SublimeRaiser "SublimeRaiser (2 commits)")[![ElGigi](https://avatars.githubusercontent.com/u/18268216?v=4)](https://github.com/ElGigi "ElGigi (2 commits)")[![BahmanMehrdad](https://avatars.githubusercontent.com/u/89250787?v=4)](https://github.com/BahmanMehrdad "BahmanMehrdad (2 commits)")[![torchello](https://avatars.githubusercontent.com/u/897885?v=4)](https://github.com/torchello "torchello (1 commits)")[![0xflotus](https://avatars.githubusercontent.com/u/26602940?v=4)](https://github.com/0xflotus "0xflotus (1 commits)")[![WinterSilence](https://avatars.githubusercontent.com/u/3521094?v=4)](https://github.com/WinterSilence "WinterSilence (1 commits)")[![27pchrisl](https://avatars.githubusercontent.com/u/6286310?v=4)](https://github.com/27pchrisl "27pchrisl (1 commits)")[![allanmcarvalho](https://avatars.githubusercontent.com/u/12012197?v=4)](https://github.com/allanmcarvalho "allanmcarvalho (1 commits)")[![BasvanH](https://avatars.githubusercontent.com/u/1708136?v=4)](https://github.com/BasvanH "BasvanH (1 commits)")

---

Tags

analyticsanomaly-detectionclassificationclusteringdeep-learningmachine-learningnatural-language-processingphpregressionphpinferenceaianalyticsclassificationAlgorithmnlpcartmachine learningpredictionmlregressionLinear regressionetlclassifierdatasetanomaly-detectionartificial intelligencenatural language processingneural-networkdata miningrecommendationsvmrankingensembleclusteringimage recognitionk-meansRubixkmeansdata scienceDeep learningfeature extractionknnnearest neighborsTF-IDFestimatornaive bayespredictive modelingmanifold learningdimensionality reductioncross validationk-nearest neighborsadaboostdbscanfeature selectionfeature importancegaussian mixturegmmgradient boostgrid searchimputationisolation forestlodalocal outlier factorlogistic regressionmean shiftmultilayer perceptronphp mlrandom forestregressorrubixmlrubix mlsupport vector machinet-snetsneoutlier detectionphp machine learningtext mininggbmsoftmaxlofridgesupervised learningunsupervised learningmlpphp ai

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/rubix-ml/health.svg)

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

###  Alternatives

[rubix/server

Deploy your Rubix ML models to production with scalable stand-alone inference servers.

632.3k](/packages/rubix-server)[codewithkyrian/transformers

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

749231.8k5](/packages/codewithkyrian-transformers)[php-ai/php-ml

PHP-ML - Machine Learning library for PHP

1061.7M12](/packages/php-ai-php-ml)[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)[niiknow/bayes

a machine learning lib

6950.0k](/packages/niiknow-bayes)[denissimon/prediction-builder

A library for machine learning that builds predictions using a linear regression.

1146.7k](/packages/denissimon-prediction-builder)

PHPackages © 2026

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