PHP-ml 是 PHP 的 机器学习 库。同时包含算法,交叉验证,神经网络,预处理,特征提取等。
HP-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'
特点
- 关联规则式学习
- Apriori
- 分类
- 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
- 工作流
- Pipeline
- 神经网络
- 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:
- 模式管理
- Persistency
- Math
- Distance
- Matrix
- Set
- Statistic