PHP-ML

用于 PHP 的机器学习库。(PHP-ML - Machine Learning library for PHP.)

Github stars Tracking Chart

PHP-ML —— 用于 PHP 的机器学习库。

用 PHP 实现机器学习的新方法。算法、交叉验证、神经网络、预处理、特征提取和更多的在一个库中。

PHP-ML 要求 PHP>=7.2。

分类的简单例子:

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'

文档

要了解如何使用PHP-ML,请遵循文档

安装

目前该库正在开发中,但您可以使用 Composer 进行安装:

composer require php-ai/php-ml

例子

示例脚本可在单独的存储库 php-ai/php-ml-examples 中找到。

数据集

公共数据集可在单独的存储库 php-ai/php-ml-datasets 中获得。

特性

Main metrics

Overview
Name With Ownerphp-ai/php-ml
Primary LanguagePHP
Program languagePHP (Language Count: 2)
PlatformLinux, Mac, Windows
License:MIT License
所有者活动
Created At2016-02-08 20:39:41
Pushed At2020-05-15 05:49:43
Last Commit At2020-05-15 07:44:34
Release Count15
Last Release Name0.9.0 (Posted on 2020-05-15 07:44:34)
First Release Namev0.1.0 (Posted on 2016-07-08 00:03:22)
用户参与
Stargazers Count7.9k
Watchers Count546
Fork Count1.1k
Commits Count446
Has Issues Enabled
Issues Count212
Issue Open Count101
Pull Requests Count185
Pull Requests Open Count4
Pull Requests Close Count33
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

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)