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

    https://github.com/apache/spark/pull/17459#discussion_r109417523
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/mllib/linalg/distributed/IndexedRowMatrix.scala
 ---
    @@ -113,6 +114,67 @@ class IndexedRowMatrix @Since("1.0.0") (
       }
     
       /**
    +    * Converts to BlockMatrix. Creates blocks of `DenseMatrix` with size 
1024 x 1024.
    +    */
    +  def toBlockMatrixDense(): BlockMatrix = {
    --- End diff --
    
    I agree that there's no clear default, though if DenseMatrix-backed was the 
default than people would still be able to get SparseMatrix backed by calling 
`IndexedRowMatrix.toCoordinateMatrix().toBlockMatrix()`, which is the current 
implementation of toBlockMatrix anyway. But that's less than ideal, as that's 
not a particularly good implementation either. 
    
    As for generalizing, if we went ahead and just had one toBlockMatrix method 
with an argument to specify how it should be backed, it'd be easy enough to 
take the code that turns the iterator of `(Int, Array[Double])` pairs into a 
`DenseMatrix` and pull it out into a helper method. Then I could make a 
corresponding one to make a `SparseMatrix` and just call the appropriate one 
based on the given argument. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to