[ https://issues.apache.org/jira/browse/SPARK12331?page=com.atlassian.jira.plugin.system.issuetabpanels:alltabpanel
]
Apache Spark reassigned SPARK12331:

Assignee: Apache Spark
> R^2 for regression through the origin
> 
>
> Key: SPARK12331
> URL: https://issues.apache.org/jira/browse/SPARK12331
> Project: Spark
> Issue Type: Improvement
> Components: ML
> Reporter: Imran Younus
> Assignee: Apache Spark
> Priority: Minor
>
> The value of R^2 (coefficient of determination) obtained from LinearRegressionModel is
not consistent with R and statsmodels when the fitIntercept is false i.e., regression through
the origin. In this case, both R and statsmodels use the definition of R^2 given by eq(4')
in the following review paper:
> https://online.stat.psu.edu/~ajw13/stat501/SpecialTopics/Reg_thru_origin.pdf
> Here is the definition from this paper:
> R^2 = \sum(\hat( y)_i^2)/\sum(y_i^2)
> The paper also describes why this should be the case. I've double checked that the value
of R^2 from statsmodels and R are consistent with this definition. On the other hand, scikitlearn
doesn't use the above definition. I would recommend using the above definition in Spark.

This message was sent by Atlassian JIRA
(v6.3.4#6332)

To unsubscribe, email: issuesunsubscribe@spark.apache.org
For additional commands, email: issueshelp@spark.apache.org
