# PHP-ML ## php 机器学习类库(在人工智能大数据时代,不学点算法,只写业务的程序猿很大可能被人工智能代替) [![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.1-8892BF.svg)](https://php.net/)[![Latest Stable Version](https://img.shields.io/packagist/v/php-ai/php-ml.svg)](https://packagist.org/packages/php-ai/php-ml)[![Build Status](https://travis-ci.org/php-ai/php-ml.svg?branch=master)](https://travis-ci.org/php-ai/php-ml)[![Documentation Status](https://readthedocs.org/projects/php-ml/badge/?version=master)](http://php-ml.readthedocs.org/)[![Total Downloads](https://poser.pugx.org/php-ai/php-ml/downloads.svg)](https://packagist.org/packages/php-ai/php-ml)[![License](https://poser.pugx.org/php-ai/php-ml/license.svg)](https://packagist.org/packages/php-ai/php-ml)[![Coverage Status](https://coveralls.io/repos/github/php-ai/php-ml/badge.svg?branch=master)](https://coveralls.io/github/php-ai/php-ml?branch=master)[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/php-ai/php-ml/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/php-ai/php-ml/?branch=master) ***** 用PHP学习机器的新方法。算法、交叉验证、神经网络、预处理、特征提取等。 ***** PHP-ML 需要 PHP >= 7.1. ***** **简单示例:** ``` 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); $classifier->predict([3, 2]); // return 'b' ``` ***** ## 安装: 当前正在开发此库,但您可以使用composer安装它: `composer require php-ai/php-ml` ## 示例: 示例脚本在单独的存储库php-ai/php-ml-examples.。 ## 贡献: * Guide:[CONTRIBUTING.md](https://github.com/php-ai/php-ml/blob/master/CONTRIBUTING.md) * Issue Tracker:[github.com/php-ai/php-ml/issues](https://github.com/php-ai/php-ml/issues) * Source Code:[github.com/php-ai/php-ml](https://github.com/php-ai/php-ml) You can find more about contributing in[CONTRIBUTING.md](https://php-ml.readthedocs.io/en/CONTRIBUTING.md). ## 许可证 PHP-ML is released under the MIT Licence. See the bundled LICENSE file for details. ## 作者 Arkadiusz Kondas (@ArkadiuszKondas)