You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Charlie Evans (JIRA)" <ji...@apache.org> on 2016/06/13 14:13:20 UTC

[jira] [Updated] (SPARK-15922) BlockMatrix to IndexedRowMatrix throws an error

     [ https://issues.apache.org/jira/browse/SPARK-15922?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Charlie Evans updated SPARK-15922:
----------------------------------
    Description: 
{code}
import org.apache.spark.mllib.linalg.distributed._
import org.apache.spark.mllib.linalg._

val rows = IndexedRow(0L, new DenseVector(Array(1,2,3))) :: IndexedRow(1L, new DenseVector(Array(1,2,3))):: IndexedRow(2L, new DenseVector(Array(1,2,3))):: Nil
val rdd = sc.parallelize(rows)
val matrix = new IndexedRowMatrix(rdd, 3, 3)
val bmat = matrix.toBlockMatrix

val imat = bmat.toIndexedRowMatrix
imat.rows.collect // this throws an error - Caused by: java.lang.IllegalArgumentException: requirement failed: Vectors must be the same length!


  was:
import org.apache.spark.mllib.linalg.distributed._
import org.apache.spark.mllib.linalg._

val rows = IndexedRow(0L, new DenseVector(Array(1,2,3))) :: IndexedRow(1L, new DenseVector(Array(1,2,3))):: IndexedRow(2L, new DenseVector(Array(1,2,3))):: Nil
val rdd = sc.parallelize(rows)
val matrix = new IndexedRowMatrix(rdd, 3, 3)
val bmat = matrix.toBlockMatrix

val imat = bmat.toIndexedRowMatrix
imat.rows.collect // this throws an error - Caused by: java.lang.IllegalArgumentException: requirement failed: Vectors must be the same length!



> BlockMatrix to IndexedRowMatrix throws an error
> -----------------------------------------------
>
>                 Key: SPARK-15922
>                 URL: https://issues.apache.org/jira/browse/SPARK-15922
>             Project: Spark
>          Issue Type: Bug
>          Components: MLlib
>    Affects Versions: 2.0.0
>            Reporter: Charlie Evans
>
> {code}
> import org.apache.spark.mllib.linalg.distributed._
> import org.apache.spark.mllib.linalg._
> val rows = IndexedRow(0L, new DenseVector(Array(1,2,3))) :: IndexedRow(1L, new DenseVector(Array(1,2,3))):: IndexedRow(2L, new DenseVector(Array(1,2,3))):: Nil
> val rdd = sc.parallelize(rows)
> val matrix = new IndexedRowMatrix(rdd, 3, 3)
> val bmat = matrix.toBlockMatrix
> val imat = bmat.toIndexedRowMatrix
> imat.rows.collect // this throws an error - Caused by: java.lang.IllegalArgumentException: requirement failed: Vectors must be the same length!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org