RubixML is a high-level machine learning library and deep learning that lets you build programs that learn from data using the PHP language. The library supports the two types of machine learning : Supervised and Unsupervised out of the box. Which mean that you can use RubixML to solve any kind of problems using Classification, regression, clustering, anomaly detection or manifold learning.


You can get the data using one of the recommended PHP library wether from CSV files, database or big data repository. The data is then passed around in Rubix via specialized data containers called Datasets.

Dataset objects properly handle selecting, splitting, folding, transforming, and randomizing the samples and labels contained within. In general, there are two types of datasets, Labeled and Unlabeled. Labeled datasets are used for supervised learning and Unlabeled datasets are used for unsupervised learning and for making predictions (inference). Dataset objects have a mutability policy of generally immutable except for performance reasons such as applying a Transformer.

Some of the features of the library include :

  • Fast and easy prototyping with user-friendly API
  • 40+ modern supervised and unsupervised learners
  • Modular architecture combines power and flexbility
  • Open source and free to use commercially

RubixML does not support (yet) multithreading, however the library support  supports Deep (Representational) Learning through a number of learners including the Multi Layer Perceptron classifier and MLP Regressor.

Such processing require a lot of memory, so make sure to adjust your php.ini memory_limit, and it’s recommended to keep it -1 unless you are running in production environment. Rubix utilizes a combination of static analysis and unit tests to reduce the mount of bugs in code. Rubix provides two Composer scripts that can be run from the root directory to automate the testing process.

Install RubixML

To install RubixML you can use composer :

$ composer require rubix/ml

Released under an MIT license. More information at


Please enter your comment!
Please enter your name here