PHP-ml 是 PHP 的机器学习库。同时包含算法,交叉验证,神经网络,预处理,特征提取等。
PHP-ML 要求 PHP >= 7.0。
简单的分类示例:
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'
关联规则式学习
分类
Adaline
Decision Stump
Perceptron
Bagging (Bootstrap Aggregating)
Random Forest
AdaBoost
SVC
k-Nearest Neighbors
Naive Bayes
Decision Tree (CART)
Ensemble Algorithms
Linear
回归
Least Squares
SVR
聚合
k-Means
DBSCAN
Metric
Accuracy
Confusion Matrix
Classification Report
工作流
神经网络
Multilayer Perceptron
Backpropagation training
交叉验证
Random Split
Stratified Random Split
预处理
Normalization
Imputation missing values
特征提取
Token Count Vectorizer
Tf-idf Transformer
数据设置
Iris
Wine
Glass
Array
CSV
Files
Ready to use:
模式管理
Math
Distance
Matrix
Set
Statistic