Registry / utility / rubix-ml

rubix-ml

JSON →
library2.5.3phppackagistunverified

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

composer require rubix/ml
INSTALL
IMPORT
SIG · RUBIX-ML
R
rubix-ml
utilityphpv2.5.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

KNearestNeighbors
use Rubix\ML\Classifiers\KNearestNeighbors;

Train a K-Nearest Neighbors classifier and make a prediction.

use Rubix\ML\Classifiers\KNearestNeighbors; use Rubix\ML\Datasets\Labeled; $samples = [[1, 2], [2, 3], [3, 4]]; $labels = ['a', 'b', 'c']; $dataset = new Labeled($samples, $labels); $estimator = new KNearestNeighbors(3); $estimator->train($dataset); $prediction = $estimator->predict([[2, 3]]);
Debug
Known issues
gotchaRequires PHP 7.4+ and may have memory issues with large datasets.
fix
Use chunking or increase memory_limit in php.ini.
affects: >=2.0.0
Upgrade
Version history
2.5.3latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
rubix-ml — pip install rubix-ml · libregistry