diff --git a/mllib/src/main/scala/org/apache/spark/mllib/linalg/rdd/CoordinateRDDMatrix.scala b/mllib/src/main/scala/org/apache/spark/mllib/linalg/rdd/CoordinateRDDMatrix.scala index d8a72aed37dda..c6af5fb833b05 100644 --- a/mllib/src/main/scala/org/apache/spark/mllib/linalg/rdd/CoordinateRDDMatrix.scala +++ b/mllib/src/main/scala/org/apache/spark/mllib/linalg/rdd/CoordinateRDDMatrix.scala @@ -66,7 +66,7 @@ class CoordinateRDDMatrix( val indexedRows = entries.map(entry => (entry.i, (entry.j.toInt, entry.value))) .groupByKey() .map { case (i, vectorEntries) => - RDDMatrixRow(i, Vectors.sparse(n, vectorEntries)) + IndexedRDDMatrixRow(i, Vectors.sparse(n, vectorEntries)) } new IndexedRowRDDMatrix(indexedRows, numRows(), numCols()) } diff --git a/mllib/src/main/scala/org/apache/spark/mllib/linalg/rdd/RDDMatrixRow.scala b/mllib/src/main/scala/org/apache/spark/mllib/linalg/rdd/IndexedRDDMatrixRow.scala similarity index 93% rename from mllib/src/main/scala/org/apache/spark/mllib/linalg/rdd/RDDMatrixRow.scala rename to mllib/src/main/scala/org/apache/spark/mllib/linalg/rdd/IndexedRDDMatrixRow.scala index b964fc206f9d3..8c9a9a857646c 100644 --- a/mllib/src/main/scala/org/apache/spark/mllib/linalg/rdd/RDDMatrixRow.scala +++ b/mllib/src/main/scala/org/apache/spark/mllib/linalg/rdd/IndexedRDDMatrixRow.scala @@ -20,4 +20,4 @@ package org.apache.spark.mllib.linalg.rdd import org.apache.spark.mllib.linalg.Vector /** Represents a row of RowRDDMatrix. */ -case class RDDMatrixRow(index: Long, vector: Vector) +case class IndexedRDDMatrixRow(index: Long, vector: Vector) diff --git a/mllib/src/main/scala/org/apache/spark/mllib/linalg/rdd/IndexedRowRDDMatrix.scala b/mllib/src/main/scala/org/apache/spark/mllib/linalg/rdd/IndexedRowRDDMatrix.scala index c0ead63a84c7e..d1dbd0a017c2d 100644 --- a/mllib/src/main/scala/org/apache/spark/mllib/linalg/rdd/IndexedRowRDDMatrix.scala +++ b/mllib/src/main/scala/org/apache/spark/mllib/linalg/rdd/IndexedRowRDDMatrix.scala @@ -27,7 +27,7 @@ import org.apache.spark.rdd.RDD * @param n number of cols, where a negative number means unknown */ class IndexedRowRDDMatrix( - val rows: RDD[RDDMatrixRow], + val rows: RDD[IndexedRDDMatrixRow], m: Long = -1L, n: Long = -1L) extends RDDMatrix { @@ -49,8 +49,8 @@ class IndexedRowRDDMatrix( _m } - /** Drops row indices and converts this to a RowRDDMatrix. */ - def compressRows(): RowRDDMatrix = { + /** Drops row indices and converts this matrix to a RowRDDMatrix. */ + def toRowRDDMatrix(): RowRDDMatrix = { new RowRDDMatrix(rows.map(_.vector), -1, _n) } }