Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3923#discussion_r22678010
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/mllib/stat/impl/MultivariateGaussian.scala
 ---
    @@ -84,14 +124,14 @@ private[mllib] class MultivariateGaussian(
         val tol = MLUtils.EPSILON * max(d) * d.length
         
         try {
    -      // pseudo-determinant is product of all non-zero singular values
    -      val pdetSigma = d.activeValuesIterator.filter(_ > tol).reduce(_ * _)
    +      // log(pseudo-determinant) is sum of the logs of all non-zero 
singular values
    +      val logPseudoDetSigma = d.activeValuesIterator.filter(_ > 
tol).map(math.log(_)).reduce(_ + _)
    --- End diff --
    
    ```map(math.log(_))``` can be simplified to ```map(math.log)```
    Also, ```reduce(_ + _)``` can be replaced with ```sum```



---
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]

Reply via email to