Convert RDD to DStream to apply StreamingKMeans algorithm in Apache Spark MlLib
<p>I have my scala code for anomaly detection on the KDD cup dataset.
The code is at <a href="https://github.com/prashantprakash/KDDDataResearch/blob/master/Code/approach1Plus2/src/main/scala/PCA.scala" rel="nofollow">https://github.com/prashantprakash/KDDDataResearch/blob/master/Code/approach1Plus2/src/main/scala/PCA.scala</a></p>

<p>I wanted to try a new technique by using StreamingKMeans algorithm from MlLib and update my StreamingKmeans model whenever line 288 in the above code is true "if( dist &lt; threshold ) {"; ie when the test point is classified as normal, update the KMeans model with the new "normal datapoint".</p>

<p>I see that StreamingKmeans take data in the form of DStreams. 
"Please help in converting the existing RDD to Dstreams."</p>

<p>I found a link <a href="http://apache-spark-user-list.1001560.n3.nabble.com/RDD-to-DStream-td11145.html" rel="nofollow">http://apache-spark-user-list.1001560.n3.nabble.com/RDD-to-DStream-td11145.html</a> but it didn't help much.</p>

<p>Also please advice if there is a better design to solve the problem.</p>