|
In kmeans.R, 1. Line 9, in function parsevectors(), list(matrix(as.numeric(unlist(lines)), ncol = length(lines[[1]]))) should better be list(matrix(as.numeric(unlist(lines)), ncol = length(lines[[1]]), byrow = TRUE)). 2. Line 41, takeSample() doesn't work as expected, it returns the entire matrix rather than K random rows. A simple solution would be take the first K rows of the matrix by adding kPoints <- kPoints[1:K,] next to it. 3. Line 56, in reduceByKey(), t(colSums(rbind(p1, p2))) could be replaced by rbind(p1, p2) . 4. Line 64, in collect(), point.sum <- tup[[2]][, -1] should be point.sum <- colSums(tup[[2]][, -1]).
Thank you for your wonderful work of SparkR, looking forward to more convenient and stable release.
|