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

    https://github.com/apache/spark/pull/8022#discussion_r38674349
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/mllib/classification/StreamingLogisticRegressionWithSGD.scala
 ---
    @@ -101,4 +107,14 @@ class StreamingLogisticRegressionWithSGD 
private[mllib] (
         this.model = Some(algorithm.createModel(initialWeights, 0.0))
         this
       }
    +
    +  override def setDecayFactor(decayFactor: Double): this.type = {
    --- End diff --
    
    This boilerplate is duplicated in streaming linear regression. I am 
guessing you do this to get the concrete subclass (correct me if I'm wrong), 
but you actually don't need to do this since the `this.type` in `trait 
StreamingDecay` takes care of this. A simple REPL example:
    
    ```scala
    scala> trait Superclass { def test: this.type }
    defined trait Superclass
    
    scala> class Subclass extends Superclass { def test = this }
    defined class Subclass
    
    scala> (new Subclass()).test
    res0: Subclass = Subclass@1cb4ab3e
    ```


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to