diff options
author | Zheng RuiFeng <ruifengz@foxmail.com> | 2016-06-10 10:09:19 +0100 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2016-06-10 10:09:19 +0100 |
commit | 16ca32eace39c423224b0ec25922038fd45c501a (patch) | |
tree | 3f331d80264370562d1d69cae1e74b28f399c310 /python | |
parent | 675a73715d3c8adb9d9a9dce5f76a2db5106790c (diff) | |
download | spark-16ca32eace39c423224b0ec25922038fd45c501a.tar.gz spark-16ca32eace39c423224b0ec25922038fd45c501a.tar.bz2 spark-16ca32eace39c423224b0ec25922038fd45c501a.zip |
[SPARK-15823][PYSPARK][ML] Add @property for 'accuracy' in MulticlassMetrics
## What changes were proposed in this pull request?
`accuracy` should be decorated with `property` to keep step with other methods in `pyspark.MulticlassMetrics`, like `weightedPrecision`, `weightedRecall`, etc
## How was this patch tested?
manual tests
Author: Zheng RuiFeng <ruifengz@foxmail.com>
Closes #13560 from zhengruifeng/add_accuracy_property.
Diffstat (limited to 'python')
-rw-r--r-- | python/pyspark/mllib/evaluation.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/python/pyspark/mllib/evaluation.py b/python/pyspark/mllib/evaluation.py index 2eaac87b67..fc2a0b3b50 100644 --- a/python/pyspark/mllib/evaluation.py +++ b/python/pyspark/mllib/evaluation.py @@ -179,11 +179,7 @@ class MulticlassMetrics(JavaModelWrapper): 1.0... >>> metrics.fMeasure(0.0, 2.0) 0.52... - >>> metrics.precision() - 0.66... - >>> metrics.recall() - 0.66... - >>> metrics.accuracy() + >>> metrics.accuracy 0.66... >>> metrics.weightedFalsePositiveRate 0.19... @@ -273,6 +269,7 @@ class MulticlassMetrics(JavaModelWrapper): else: return self.call("fMeasure", label, beta) + @property @since('2.0.0') def accuracy(self): """ |