PHP Machine Learning library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Jorge Casas de9b3a6d1c
Merge pull request #5 from meirzamoodle/fix_str_interpolation_deprecated
2 weeks ago
bin Update phpunit to 7.5.1 and remove osx build from travis (#335) 4 years ago
data add glass identification dataset 7 years ago
docs last 2 years ago
src Fixed ${var} string interpolation deprecations in PHP 8.1 2 weeks ago
tests Fix static analysis errors from phpstan upgrade to 0.12 (#426) 3 years ago
var start to implement SVM with libsvm 7 years ago
.editorconfig Issue #355: Add a .editorconfig file. (#356) 4 years ago
.gitattributes Add .gitattributes (#287) 5 years ago
.gitignore Update to phpunit 8 and bump min php to 7.2 (#367) 4 years ago
.travis.yml Add php 7.4 for travis build (#393) 3 years ago
CHANGELOG.md Implement OneHotEncoder (#384) 4 years ago
CONTRIBUTING.md Add performance test for LeastSquares (#263) 5 years ago
LICENSE Add Andrew to license (#380) 4 years ago
README.md Implement OneHotEncoder (#384) 4 years ago
composer.json Update composer.json 7 months ago
composer.lock Fix static analysis errors from phpstan upgrade to 0.12 (#426) 3 years ago
ecs.yml Update phpunit, phpbench, easy coding standard (#415) 3 years ago
mkdocs.yml Mnist Dataset (#326) 4 years ago
phpbench.json Add performance test for LeastSquares (#263) 5 years ago
phpstan.neon Fix static analysis errors from phpstan upgrade to 0.12 (#426) 3 years ago
phpunit.xml Remove enforceTimeLimit flag from phpunit and update dependencies (#328) 4 years ago

README.md

PHP-ML - Machine Learning library for PHP

Minimum PHP Version Latest Stable Version Build Status Documentation Status Total Downloads License Coverage Status Scrutinizer Code Quality

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 >= 7.2.

Simple example of classification:

require_once __DIR__ . '/vendor/autoload.php';

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);

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

Awards

Documentation

To find out how to use PHP-ML follow Documentation.

Installation

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

composer require php-ai/php-ml

Examples

Example scripts are available in a separate repository php-ai/php-ml-examples.

Datasets

Public datasets are available in a separate repository php-ai/php-ml-datasets.

Features

Contribute

You can find more about contributing in CONTRIBUTING.md.

License

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

Author

Arkadiusz Kondas (@ArkadiuszKondas)