Use Vector Assembler and extracting "features" as org.apache.spark.mllib.linalg.Vectors in spark scala
<p>I have wanted to use the Gaussian Mixture Model in Spark 1.5.1 which uses the linalg.mllib.vector rdd .</p>

<p>This is my code</p>

<pre><code>import org.apache.spark.mllib.clustering.GaussianMixture
import org.apache.spark.mllib.clustering.GaussianMixtureModel
import org.apache.spark.mllib.linalg.Vectors
import org.apache.spark.ml.feature.VectorAssembler
import org.apache.spark.sql.DataFrame
import org.apache.spark.sql.DataFrameNaFunctions
dummy = dummy.na.drop
var colnames= dummy.columns
var df = dummy

for(x&lt;-colnames)
{ 
    if (dummy.select(x).dtypes(0)._2.equals("StringType") || dummy.select(x).dtypes(0)._2.equals("LongType"))
    { df = df.drop(x)}

}

var colnames = df.columns
var assembler = new VectorAssembler().setInputCols(colnames).setOutputCol("features")
var output = assembler.transform(df)
var temp = output.select("features")
</code></pre>

<p>The problem is i am not able to change the feature column into  <code>org.apache.spark.mllib.linalg.Vector</code> rdd </p>

<p>Anyone has an idea how to do this ?</p>