Github user iyounus commented on a diff in the pull request:
https://github.com/apache/spark/pull/10384#discussion_r48200009
--- 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 --
I can put it in scala docs as well. I think it would nice to have it here
also, so that other developers can see why there are two definitions here.
---
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]