Skip to content

Commit

Permalink
added links to spark documentation, and moved import for style reasons
Browse files Browse the repository at this point in the history
  • Loading branch information
josepablocam authored and sryza committed Aug 24, 2015
1 parent 65c0772 commit 6a7014f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/main/scala/com/cloudera/sparkts/TimeSeriesRDD.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import org.apache.spark.SparkContext._
import org.apache.spark.{Partition, Partitioner, SparkContext, TaskContext}
import org.apache.spark.mllib.linalg.Vectors
import org.apache.spark.mllib.linalg.distributed.{IndexedRow, IndexedRowMatrix, RowMatrix}
import org.apache.spark.mllib.linalg.Vectors
import org.apache.spark.rdd.RDD
import org.apache.spark.util.StatCounter

Expand Down Expand Up @@ -281,7 +282,9 @@ class TimeSeriesRDD(val index: DateTimeIndex, parent: RDD[(String, Vector[Double
/**
* Converts a TimeSeriesRDD into a distributed IndexedRowMatrix, useful to take advantage
* of Spark MLlib's statistic functions on matrices in a distributed fashion. This is only
* supported for cases with a uniform time series index
* supported for cases with a uniform time series index. See
* [[http://spark.apache.org/docs/latest/mllib-data-types.html]] for more information on the
* matrix data structure
* @param nPartitions number of partitions, default to -1, which represents the same number
* as currently used for the TimeSeriesRDD
* @return an equivalent IndexedRowMatrix
Expand All @@ -306,9 +309,11 @@ class TimeSeriesRDD(val index: DateTimeIndex, parent: RDD[(String, Vector[Double
/**
* Converts a TimeSeriesRDD into a distributed RowMatrix, note that indices in
* a RowMatrix are not significant, and thus this is a valid operation regardless
* of the type of time index
* of the type of time index. See
* [[http://spark.apache.org/docs/latest/mllib-data-types.html]] for more information on the
* matrix data structure
* @param nPartitions
* @return
* @return an equivalent RowMatrix
*/
def toRowMatrix(nPartitions: Int = -1): RowMatrix = {
val instants = this.toInstants(nPartitions)
Expand Down

0 comments on commit 6a7014f

Please sign in to comment.