bdelespierre / php-kmeans

PHP K-Means
MIT License
91 stars 41 forks source link

Add a maximum number of iteration threshold #41

Closed bdelespierre closed 2 years ago

bdelespierre commented 2 years ago

Proposed change

$kmeans = new Kmeans(new RandomInitialization());

// fit = clusterize (we should rename this method)
$result = $kmeans->fit($points, maxIter: 300);

echo $result->getIterations(); // never more than 300