Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22784#discussion_r228724515
  
    --- Diff: mllib/src/main/scala/org/apache/spark/mllib/feature/PCA.scala ---
    @@ -49,7 +50,16 @@ class PCA @Since("1.4.0") (@Since("1.4.0") val k: Int) {
           "Try reducing the parameter k for PCA, or reduce the input feature " 
+
           "vector dimension to make this tractable.")
     
    -    val mat = new RowMatrix(sources)
    +    val mat = if (numFeatures > 65535) {
    +      val meanVector = Statistics.colStats(sources).mean
    --- End diff --
    
    Rather than call `.toArray` and `.zipped` below, can this not be written as 
Vector - Vector in the loop below? might be more efficient.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to