How to forecast problem in spark arima

148 views
Skip to first unread message

jinxi...@gmail.com

unread,
Sep 29, 2017, 9:58:08 PM9/29/17
to Time Series for Spark (the spark-ts package)

Hi,
I have got TimeSeriesRDD in spark, but I don't know how to get the forecast.

val rdd = sc.textFile(path).map { line =>
val tokens = line.split(",")
val series = new DenseVector(tokens.tail.map(_.toDouble))
(tokens.head, series.asInstanceOf[Vector])
}

val start = ZonedDateTime.of(2015, 4, 9, 0, 0, 0, 0, ZoneId.of("Z"))
val index = uniform(start, 250, new DayFrequency(1))
val tsRDD = new TimeSeriesRDD(index, rdd);
val arimaModel = tsRDD.map(tuple => (tuple._1, ARIMA.fitModel(1,0,1,tuple._2)))


Thanks

Reply all
Reply to author
Forward
0 new messages