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

    https://github.com/apache/spark/pull/11365#discussion_r59254960
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/regression/AFTSurvivalRegression.scala 
---
    @@ -230,7 +241,13 @@ class AFTSurvivalRegression @Since("1.6.0") 
(@Since("1.6.0") override val uid: S
     
         if (handlePersistence) instances.unpersist()
     
    -    val coefficients = Vectors.dense(parameters.slice(2, 
parameters.length))
    +    val rawCoefficients = parameters.slice(2, parameters.length)
    +    var i = 0
    +    while (i < numFeatures) {
    +      rawCoefficients(i) *= { if (featuresStd(i) != 0.0) 1.0 / 
featuresStd(i) else 0.0 }
    --- End diff --
    
    Could you test a dataset with a constant nonzero column and see whether we 
output a different solution from R? While I think it is correct to set the 
coefficients to 0.0 for a constant feature column. But if it is different from 
R's output, we should document it. See the discussion on SPARK-13029.


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