PHP-ML

Php-ml is an very interesting library for the developer for implement machine learning php-ml gives you easy use API for training your bot  making it do predictions based on input data. The fresh approach to Machine Learning in PHP. Algorithms, Cross Validation, Neural Network, Preprocessing,  Feature Extraction and much more in one library.
[Read more for code sample]

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'
Podelite sa saradnicima i prijateljima

Leave a Reply

Skip to toolbar