Conditions | 3 |
Paths | 4 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
51 | public function acluster(array $samples): array |
||
52 | { |
||
53 | $space = new Space(count(reset($samples))); |
||
54 | foreach ($samples as $key => $sample) { |
||
55 | $space->addPointWithLabels($sample, $key); |
||
56 | } |
||
57 | |||
58 | $clusters = []; |
||
59 | foreach ($space->cluster($this->clustersNumber, $this->initialization) as $cluster) { |
||
60 | $clusters[] = $cluster->getPointsWithLabels(); |
||
61 | } |
||
62 | |||
63 | return $clusters; |
||
64 | } |
||
65 | } |
||
66 |