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

    https://github.com/apache/spark/pull/6386#discussion_r31578786
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala
 ---
    @@ -100,8 +100,28 @@ class LogisticRegression(override val uid: String)
       def setThreshold(value: Double): this.type = set(threshold, value)
       setDefault(threshold -> 0.5)
     
    -  override protected def train(dataset: DataFrame): 
LogisticRegressionModel = {
    -    // Extract columns from data.  If dataset is persisted, do not persist 
oldDataset.
    +  private var optInitialWeights: Option[Vector] = None
    +  /** @group setParam */
    +  private[spark] def setInitialWeights(value: Vector): this.type = {
    +    this.optInitialWeights = Some(value)
    +    this
    +  }
    +
    +  /** Validate the initial weights, return an Option, if not the expected 
size return None
    +   * and log a warning.
    +   */
    +  private def validateWeights(vectorOpt: Option[Vector], numFeatures: 
Int): Option[Vector] = {
    +    vectorOpt.flatMap(vec =>
    +      if (vec.size == numFeatures) {
    --- End diff --
    
    Sorry, my bad. you +1 in the function call if intercept is true.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to