diff options
author | Feynman Liang <fliang@databricks.com> | 2015-07-15 13:32:25 -0700 |
---|---|---|
committer | Joseph K. Bradley <joseph@databricks.com> | 2015-07-15 13:32:25 -0700 |
commit | 536533cad83a26f8fa7c60042904a31057ab56c2 (patch) | |
tree | 8a50e5f13e5db7e3ae002e5c4348edbb29cee981 /python | |
parent | ec9b621647b893abae3afef219bceab382b99564 (diff) | |
download | spark-536533cad83a26f8fa7c60042904a31057ab56c2.tar.gz spark-536533cad83a26f8fa7c60042904a31057ab56c2.tar.bz2 spark-536533cad83a26f8fa7c60042904a31057ab56c2.zip |
[SPARK-9005] [MLLIB] Fix RegressionMetrics computation of explainedVariance
Fixes implementation of `explainedVariance` and `r2` to be consistent with their definitions as described in [SPARK-9005](https://issues.apache.org/jira/browse/SPARK-9005).
Author: Feynman Liang <fliang@databricks.com>
Closes #7361 from feynmanliang/SPARK-9005-RegressionMetrics-bugs and squashes the following commits:
f1112fc [Feynman Liang] Add explainedVariance formula
1a3d098 [Feynman Liang] SROwen code review comments
08a0e1b [Feynman Liang] Fix pyspark tests
db8605a [Feynman Liang] Style fix
bde9761 [Feynman Liang] Fix RegressionMetrics tests, relax assumption predictor is unbiased
c235de0 [Feynman Liang] Fix RegressionMetrics tests
4c4e56f [Feynman Liang] Fix RegressionMetrics computation of explainedVariance and r2
Diffstat (limited to 'python')
-rw-r--r-- | python/pyspark/mllib/evaluation.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/python/pyspark/mllib/evaluation.py b/python/pyspark/mllib/evaluation.py index f21403707e..4398ca86f2 100644 --- a/python/pyspark/mllib/evaluation.py +++ b/python/pyspark/mllib/evaluation.py @@ -82,7 +82,7 @@ class RegressionMetrics(JavaModelWrapper): ... (2.5, 3.0), (0.0, -0.5), (2.0, 2.0), (8.0, 7.0)]) >>> metrics = RegressionMetrics(predictionAndObservations) >>> metrics.explainedVariance - 0.95... + 8.859... >>> metrics.meanAbsoluteError 0.5... >>> metrics.meanSquaredError |