Baunsgaard commented on a change in pull request #1089:
URL: https://github.com/apache/systemds/pull/1089#discussion_r514119995



##########
File path: scripts/builtin/kmeans.dml
##########
@@ -86,7 +87,11 @@ m_kmeans = function(Matrix[Double] X, Integer k = 10, 
Integer runs = 10, Integer
 
     # Select the i-th centroid in each sample as a random sample row id with
     # probability ~ min_distances:
-    random_row = rand(rows = 1, cols = num_runs);
+    if (seed == -1){
+      random_row = rand(rows = 1, cols = num_runs);
+    } else{
+      random_row = rand(rows = 1, cols = num_rows, seed = seed);
+    }

Review comment:
       but i want to have default random behaviour, with not setting a seed 
value, and then otherwise set the seed.
   Is there a way of doing that in one rand call?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to