Github user feynmanliang commented on a diff in the pull request:
https://github.com/apache/spark/pull/8022#discussion_r37824256
--- Diff:
mllib/src/main/scala/org/apache/spark/mllib/regression/StreamingLinearAlgorithm.scala
---
@@ -84,7 +87,20 @@ abstract class StreamingLinearAlgorithm[
}
data.foreachRDD { (rdd, time) =>
if (!rdd.isEmpty) {
- model = Some(algorithm.run(rdd, model.get.weights))
+ val newModel = algorithm.run(rdd, model.get.weights)
+
+ val numNewDataPoints = rdd.count()
+ val discount = getDiscount(numNewDataPoints)
+
+ val updatedDataWeight = previousDataWeight * discount +
numNewDataPoints
+ val lambda = numNewDataPoints / math.max(updatedDataWeight, 1e-16)
--- End diff --
I actually think it's more clear if `StreamingDecay` had a `getLambda`,
otherwise you will need to document how `discount` is calculated in
`StreamingDecay` as well as how `lambda` affects the weight updates in
`StreamingLinearAlgorithm`
---
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]