phpでKNearestNeighbors

まずはチュートリアルから。

<?php

require_once 'vendor/autoload.php';

use Phpml\Classification\KNearestNeighbors;

$sample = &#91;&#91;1, 3&#93;,&#91;1, 4&#93;,&#91;2, 4&#93;,&#91;3, 1&#93;, &#91;4,1&#93;, &#91;4, 2&#93;&#93;;
$labels = &#91;'a', 'a', 'a', 'b', 'b', 'b'&#93;;

$classifier = new KNearestNeighbors();
$classifier->train($sample, $labels);

echo $classifier->predict([3, 2]);


これ、ほんまかいな?