aboutsummaryrefslogtreecommitdiff
path: root/mllib
diff options
context:
space:
mode:
authorMechCoder <manojkumarsivaraj334@gmail.com>2015-08-06 10:09:58 -0700
committerJoseph K. Bradley <joseph@databricks.com>2015-08-06 10:09:58 -0700
commit076ec056818a65216eaf51aa5b3bd8f697c34748 (patch)
tree681bd1b6621e4de217d71d5b102edc6382a0dd5f /mllib
parentc5c6aded641048a3e66ac79d9e84d34e4b1abae7 (diff)
downloadspark-076ec056818a65216eaf51aa5b3bd8f697c34748.tar.gz
spark-076ec056818a65216eaf51aa5b3bd8f697c34748.tar.bz2
spark-076ec056818a65216eaf51aa5b3bd8f697c34748.zip
[SPARK-9533] [PYSPARK] [ML] Add missing methods in Word2Vec ML
After https://github.com/apache/spark/pull/7263 it is pretty straightforward to Python wrappers. Author: MechCoder <manojkumarsivaraj334@gmail.com> Closes #7930 from MechCoder/spark-9533 and squashes the following commits: 1bea394 [MechCoder] make getVectors a lazy val 5522756 [MechCoder] [SPARK-9533] [PySpark] [ML] Add missing methods in Word2Vec ML
Diffstat (limited to 'mllib')
-rw-r--r--mllib/src/main/scala/org/apache/spark/ml/feature/Word2Vec.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/mllib/src/main/scala/org/apache/spark/ml/feature/Word2Vec.scala b/mllib/src/main/scala/org/apache/spark/ml/feature/Word2Vec.scala
index b4f46cef79..29acc3eb58 100644
--- a/mllib/src/main/scala/org/apache/spark/ml/feature/Word2Vec.scala
+++ b/mllib/src/main/scala/org/apache/spark/ml/feature/Word2Vec.scala
@@ -153,7 +153,7 @@ class Word2VecModel private[ml] (
* Returns a dataframe with two fields, "word" and "vector", with "word" being a String and
* and the vector the DenseVector that it is mapped to.
*/
- val getVectors: DataFrame = {
+ @transient lazy val getVectors: DataFrame = {
val sc = SparkContext.getOrCreate()
val sqlContext = SQLContext.getOrCreate(sc)
import sqlContext.implicits._