zhengruifeng commented on pull request #30587:
URL: https://github.com/apache/spark/pull/30587#issuecomment-738504951
```
/**
* When no regularization is applied, the multinomial coefficients lack
identifiability
* because we do not use a pivot class. We can add any constant value to
the coefficients
* and get the same likelihood. If fitting under bound constrained
optimization, we don't
* choose the mean centered coefficients like what we do for unbound
problems, since they
* may out of the bounds. We use this function to check whether two
coefficients are equivalent.
*/
def checkCoefficientsEquivalent(coefficients1: Matrix, coefficients2:
Matrix): Unit = {
coefficients1.colIter.zip(coefficients2.colIter).foreach { case (col1:
Vector, col2: Vector) =>
(col1.asBreeze - col2.asBreeze).toArray.toSeq.sliding(2).foreach {
case Seq(v1, v2) => assert(v1 ~= v2 absTol 1E-3)
}
}
}
```
According to the comments, it looks that this compare logic is designed on
purpose. @WeichenXu123
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]