You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by MLnick <gi...@git.apache.org> on 2017/10/02 19:28:42 UTC

[GitHub] spark pull request #17673: [SPARK-20372] [ML] Word2Vec Continuous Bag of Wor...

Github user MLnick commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17673#discussion_r142221460
  
    --- 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 --
    
    setters should match the params - this should be `setUnigramTableSize`


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org