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

    https://github.com/apache/spark/pull/10384#discussion_r48178585
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/mllib/evaluation/RegressionMetrics.scala 
---
    @@ -105,6 +112,14 @@ class RegressionMetrics @Since("1.2.0") (
        */
       @Since("1.2.0")
       def r2: Double = {
    -    1 - SSerr / SStot
    +    // In case of regression through the origin (biased case), the 
definition of R^2 is
    +    // to be modified. Here is a review paper which explains why:
    +    // J. G. Eisenhauer, Regression through the Origin. Teaching 
Statistics 25, 76–80 (2003)
    +    // 
https://online.stat.psu.edu/~ajw13/stat501/SpecialTopics/Reg_thru_origin.pdf
    --- End diff --
    
    @iyounus Can you put this comment into the scaladoc instead? [This 
example](https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/CentralMomentAgg.scala#L27)
 might be of use.


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