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'特点关联规则式学习
Apriori
分类
Adaline
DecisionStump
Perceptron
Bagging(BootstrapAggregating)
RandomForest
AdaBoost
SVC
k-NearestNeighbors
NaiveBayes
DecisionTree(CART)
EnsembleAlgorithms
Linear
回归
LeastSquares
SVR
聚合
k-Means
DBSCAN
Metric
Accuracy
ConfusionMatrix
ClassificationReport
工作流
Pipeline
神经网络
MultilayerPerceptron
Backpropagationtraining
交叉验证
RandomSplit
StratifiedRandomSplit
预处理
Normalization
Imputationmissingvalues
特征提取
TokenCountVectorizer
Tf-idfTransformer
数据设置
Iris
Wine
Glass
Array
CSV
Files
Readytouse:
模式管理
Persistency
Math
Distance
Matrix
Set
Statistic
评论