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

    https://github.com/apache/spark/pull/9413#discussion_r43685896
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/optim/WeightedLeastSquares.scala ---
    @@ -109,6 +113,9 @@ private[ml] class WeightedLeastSquares(
     
         val x = new DenseVector(CholeskyDecomposition.solve(aaBar.values, 
abBar.values))
     
    +    val aaInv = CholeskyDecomposition.inverse(aaBar.values, k)
    +    val diag = new DenseVector((1 to k).map{ i => aaInv(i + (i - 1) * i / 
2 - 1) / wSum }.toArray)
    --- End diff --
    
    Need an inline comment to explain the index mapping. It is sufficient to 
just mention that `aaInv` is a packed upper triangular matrix.


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