You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2019/01/22 14:24:30 UTC

[GitHub] avplatonov commented on a change in pull request #5884: IGNITE-11010: [ML] Use seed from learningEnviroment for KMeans trainer

avplatonov commented on a change in pull request #5884: IGNITE-11010: [ML] Use seed from learningEnviroment for KMeans trainer
URL: https://github.com/apache/ignite/pull/5884#discussion_r249798747
 
 

 ##########
 File path: modules/ml/src/main/java/org/apache/ignite/ml/clustering/kmeans/KMeansTrainer.java
 ##########
 @@ -272,7 +269,7 @@ private TotalCostAndCounts calcDataForNewCentroids(Vector[] centers,
         // Pick k vectors randomly.
         if (rndPnts.size() >= k) {
             for (int i = 0; i < k; i++) {
-                final LabeledVector rndPnt = rndPnts.get(new Random(seed).nextInt(rndPnts.size()));
+                final LabeledVector rndPnt = rndPnts.get(environment.randomNumbersGenerator().nextInt(rndPnts.size()));
 
 Review comment:
   great bug fix! 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services