April 2017
Intermediate to advanced
532 pages
12h 39m
English
In the next step in our example, we will create a streaming regression program. The basic layout and setup is the same as our previous streaming analytics examples:
/** * A simple streaming linear regression that prints out predicted value for each batch */ object SimpleStreamingModel { def main(args: Array[String]) { val ssc = new StreamingContext("local[2]", "First Streaming App", Seconds(10)) val stream = ssc.socketTextStream("localhost", 9999)
Here, we will set up the number of features to match the records in our input data stream. We will then create a zero vector to use as the initial weight vector of our streaming regression model. Finally, we will select the number of iterations and ...
Read now
Unlock full access