Github user dbtsai commented on a diff in the pull request:
https://github.com/apache/spark/pull/1425#discussion_r15013544
--- Diff:
mllib/src/test/scala/org/apache/spark/mllib/classification/LogisticRegressionSuite.scala
---
@@ -81,9 +82,8 @@ class LogisticRegressionSuite extends FunSuite with
LocalSparkContext with Match
val model = lr.run(testRDD)
// Test the weights
- val weight0 = model.weights(0)
- assert(weight0 >= -1.60 && weight0 <= -1.40, weight0 + " not in [-1.6,
-1.4]")
- assert(model.intercept >= 1.9 && model.intercept <= 2.1,
model.intercept + " not in [1.9, 2.1]")
+ assert(model.weights(0).almostEquals(-1.5244128696247), "weight0
should be -1.5244128696247")
--- End diff --
We can have higher relative error here instead. If the implementation is
changed, it's also nice to have a test which can catch the slightly different
behavior. Also, updating those numbers will not take too much time comparing
with the implementation work.
---
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.
---