Github user tengpeng commented on a diff in the pull request: https://github.com/apache/spark/pull/21125#discussion_r183386571 --- Diff: mllib/src/main/scala/org/apache/spark/ml/regression/GeneralizedLinearRegression.scala --- @@ -782,8 +782,12 @@ object GeneralizedLinearRegression extends DefaultParamsReadable[GeneralizedLine override def variance(mu: Double): Double = mu + private def ylogy(y: Double, mu: Double): Double = { + if (y == 0) 0.0 else y * math.log(y / mu) + } + --- End diff -- Thanks so much for the quick review. I have moved the `ylog` implementation to `object GeneralizedLinearRegression`. One quick question here: I am not sure I have fully understood why this is the right place for `ylog`? Thanks!
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org