Lines Matching refs:clusters
128 $clusters = $this->initializeClusters($nbClusters, $initMethod);
131 if (count($clusters) == 1) {
132 return $clusters;
138 $iterationCallback($this, $clusters);
140 } while ($this->iterate($clusters));
143 return $clusters;
154 $clusters = $this->initializeRandomClusters($nbClusters);
159 $clusters = $this->initializeKmeansPlusPlusClusters($nbClusters);
168 $clusters[0]->attachAll($this);
170 return $clusters;
175 $clusters = [];
176 $clusters[] = new Cluster($this, $this->current()->getCoordinates());
182 $distance = $point->getDistanceWith($point->getClosest($clusters), false);
203 $clusters[] = new Cluster($this, $value->getCoordinates());
212 return $clusters;
217 $clusters = [];
224 $clusters[] = new Cluster($this, $this->getRandomPoint($min, $max)->getCoordinates());
226 return $clusters;
229 protected function iterate(array $clusters): bool argument
238 foreach ($clusters as $cluster) {
241 $closest = $point->getClosest($clusters);
271 foreach ($clusters as $cluster) {