Hi Ian,
You can create a dense vector of you features as follows:

- String Index your features
- Invoke One Hot Encoding on them, which generates a sparse vector
   - Now, in case you wish to merge these features, then use VectorAssembler
(optional)
- After transforming the dataframe to return sparse vector/s (which you may
or may not assemble), you can  use Vectos.dense(vector.toArray()) on either
the individual One Hot features or the assembled sparse vector.

Hope this helps.

Cheers,
Disha



--
View this message in context: 
http://apache-spark-user-list.1001560.n3.nabble.com/Dense-Vectors-outputs-in-feature-engineering-tp27331p27332.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe e-mail: user-unsubscr...@spark.apache.org

Reply via email to