Github user feynmanliang commented on a diff in the pull request:
https://github.com/apache/spark/pull/8022#discussion_r38151338
--- Diff:
mllib/src/main/scala/org/apache/spark/mllib/regression/StreamingLinearRegressionWithSGD.scala
---
@@ -47,6 +52,7 @@ class StreamingLinearRegressionWithSGD private[mllib] (
private var numIterations: Int,
private var miniBatchFraction: Double)
extends StreamingLinearAlgorithm[LinearRegressionModel,
LinearRegressionWithSGD]
+ with StreamingDecaySetter[StreamingLinearRegressionWithSGD]
--- End diff --
OK, I think I get why you have both `StreamingDecay` and
`StreamingDecaySetter`; it's because `getDiscount` is also needed in `trainOn`
but you also need to get the concrete type `StreamingLinearRegressionWithSGD`
for returning from the setters (e.g. `setHalfLife`), right?
I'm still for having a single trait over trait inheritance, especially if
the reason we have this inheritance is to get the concrete type and we won't be
adding other concrete `StreamingDecay` implementations soon.
We could just have a single `private[mllib] trait StreamingDecay` and have
`StreamingLinearAlgorithm extends StreamingDecay[A]`; the concrete type should
be available in `A` and return properly. Let me know if that works...
---
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]