spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "DB Tsai (JIRA)" <>
Subject [jira] [Commented] (SPARK-12331) R^2 for regression through the origin
Date Wed, 16 Dec 2015 22:41:46 GMT


DB Tsai commented on SPARK-12331:

+1 PR is welcome. Thanks.

> R^2 for regression through the origin
> -------------------------------------
>                 Key: SPARK-12331
>                 URL:
>             Project: Spark
>          Issue Type: Improvement
>          Components: ML
>            Reporter: Imran Younus
>            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:
> 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, scikit-learn
doesn't use the above definition. I would recommend using the above definition in Spark.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message