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

    https://github.com/apache/spark/pull/16699#discussion_r124265572
  
    --- Diff: 
mllib/src/test/scala/org/apache/spark/ml/optim/IterativelyReweightedLeastSquaresSuite.scala
 ---
    @@ -169,29 +169,29 @@ class IterativelyReweightedLeastSquaresSuite extends 
SparkFunSuite with MLlibTes
     object IterativelyReweightedLeastSquaresSuite {
     
       def BinomialReweightFunc(
    -      instance: Instance,
    +      instance: OffsetInstance,
           model: WeightedLeastSquaresModel): (Double, Double) = {
    -    val eta = model.predict(instance.features)
    +    val eta = model.predict(instance.features) + instance.offset
         val mu = 1.0 / (1.0 + math.exp(-1.0 * eta))
    -    val z = eta + (instance.label - mu) / (mu * (1.0 - mu))
    +    val z = eta - instance.offset + (instance.label - mu) / (mu * (1.0 - 
mu))
    --- End diff --
    
    Why ```- instance.offset```? I suspect it's wrong, the test doesn't fail 
because it's zero.


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