regaleo605 commented on code in PR #1888:
URL: https://github.com/apache/systemds/pull/1888#discussion_r1306373829
##########
scripts/builtin/imputeByKNN.dml:
##########
@@ -143,7 +156,11 @@ m_imputeByKNN = function(Matrix[Double] X, String
method="dist", Int seed=-1)
M3 = removeEmpty(target=filled_matrix, margin = "rows", select = Y)
#Create a random subset
- random_matrix = ceiling(rand(rows = nrow(M3), cols = 1, min = 0, max = 1,
sparsity = 0.5, seed = seed))
+ if(seed == -1){
+ random_matrix = ceiling(rand(rows = nrow(M3), cols = 1, min = 0, max =
1, sparsity = sparsity))
+ } else {
+ random_matrix = ceiling(rand(rows = nrow(M3), cols = 1, min = 0, max =
1, sparsity = sparsity, seed = seed))
+ }
Review Comment:
To make it clear, does it means for example if I call the dist_sample method
with the default seed -1, I can get rows 1 3 4 but If I call dist_sample method
again, since the seed doesn't change I still get 1 3 4, but we want whenever we
call dist_sample. I can get rows 1 3 4 for the first time, second 2 4 6, and so
on? Do I understand correctly?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]