sarutak commented on a change in pull request #32673: URL: https://github.com/apache/spark/pull/32673#discussion_r640338758
########## File path: mllib/src/test/scala/org/apache/spark/ml/optim/aggregator/DifferentiableLossAggregatorSuite.scala ########## @@ -149,10 +152,43 @@ object DifferentiableLossAggregatorSuite { override def add(instance: Instance): TestAggregator = { val error = instance.label - BLAS.dot(coefficients, instance.features) - weightSum += instance.weight - lossSum += instance.weight * error * error / 2.0 - (0 until dim).foreach { j => - gradientSumArray(j) += instance.weight * error * instance.features(j) + val mathCls = Utils.classForName("java.lang.Math") Review comment: > I think we can just fix the test with tolerance at the assertion e.g.) assert(agg.weight ~== weightSum relTol 1e-5) like the above one I considered using `~==` at first but can we accept the precision diff in this case? The failed assertion uses `===` while some of other assertions use `~==` so I guessed `===` is intentionally used. If we can use `~==` here, I'll fix with `~==`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org