spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbtsai <...@git.apache.org>
Subject [GitHub] spark pull request: [Spark-7780][MLLIB] Intercept in logisticregre...
Date Mon, 25 May 2015 22:09:24 GMT
Github user dbtsai commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6386#discussion_r30996190
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala
---
    @@ -100,12 +100,20 @@ 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 */
    +  def setInitialWeights(value: Vector): this.type = {
    +    this.optInitialWeights = Some(value)
    +    this
    +  }
    +
    +  override protected[spark] def train(dataset: DataFrame): LogisticRegressionModel =
{
    +    val handlePersistence = dataset.rdd.getStorageLevel == StorageLevel.NONE
    +    // Extract columns from data.  If dataset is persisted, do not persist instances.
         val instances = extractLabeledPoints(dataset).map {
           case LabeledPoint(label: Double, features: Vector) => (label, features)
         }
    -    val handlePersistence = dataset.rdd.getStorageLevel == StorageLevel.NONE
    +
    --- End diff --
    
    ditto. revert


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message