Github user shubhamchopra commented on a diff in the pull request:
https://github.com/apache/spark/pull/17673#discussion_r143528339
--- Diff: mllib/src/main/scala/org/apache/spark/ml/feature/Word2Vec.scala
---
@@ -171,20 +210,46 @@ final class Word2Vec @Since("1.4.0") (
@Since("2.0.0")
def setMaxSentenceLength(value: Int): this.type = set(maxSentenceLength,
value)
+ /** @group setParam */
+ @Since("2.2.0")
+ val solvers = Set("sg-hs", "cbow-ns")
+ def setSolver(value: String): this.type = {
+ require(solvers.contains(value),
+ s"Solver $value was not supported. Supported options:
${solvers.mkString(", ")}")
+ set(solver, value)
+ }
+ setDefault(solver -> "sg-hs")
+
+ /** @group setParam */
+ @Since("2.2.0")
+ def setNegativeSamples(value: Int): this.type = set(negativeSamples,
value)
+
+ /** @group setParam */
+ @Since("2.2.0")
+ def setMaxUnigramTableSize(value: Int): this.type =
set(unigramTableSize, value)
--- End diff --
Done
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]