Repository: spark Updated Branches: refs/heads/branch-1.2 9ea67fc1d -> 2acbd2884
get raw vectors for further processing in Word2Vec e.g. clustering Author: tkaessmann <tobias.kaessm...@s24.com> Closes #3309 from tkaessmann/branch-1.2 and squashes the following commits: e3a3142 [tkaessmann] changes the comment for getVectors 58d3d83 [tkaessmann] removes sign from comment a5be213 [tkaessmann] fixes getVectors to fit code guidelines 3782fa9 [tkaessmann] get raw vectors for further processing Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/2acbd288 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/2acbd288 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/2acbd288 Branch: refs/heads/branch-1.2 Commit: 2acbd2884f73c4503d753bb96e0acf75cd237536 Parents: 9ea67fc Author: tkaessmann <tobias.kaessm...@s24.com> Authored: Mon Nov 24 16:40:19 2014 -0800 Committer: Xiangrui Meng <m...@databricks.com> Committed: Mon Nov 24 16:40:19 2014 -0800 ---------------------------------------------------------------------- .../main/scala/org/apache/spark/mllib/feature/Word2Vec.scala | 7 +++++++ 1 file changed, 7 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/2acbd288/mllib/src/main/scala/org/apache/spark/mllib/feature/Word2Vec.scala ---------------------------------------------------------------------- diff --git a/mllib/src/main/scala/org/apache/spark/mllib/feature/Word2Vec.scala b/mllib/src/main/scala/org/apache/spark/mllib/feature/Word2Vec.scala index f5f7ad6..7960f3c 100644 --- a/mllib/src/main/scala/org/apache/spark/mllib/feature/Word2Vec.scala +++ b/mllib/src/main/scala/org/apache/spark/mllib/feature/Word2Vec.scala @@ -461,4 +461,11 @@ class Word2VecModel private[mllib] ( .tail .toArray } + + /** + * Returns a map of words to their vector representations. + */ + def getVectors: Map[String, Array[Float]] = { + model + } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org