From 16ca32eace39c423224b0ec25922038fd45c501a Mon Sep 17 00:00:00 2001 From: Zheng RuiFeng Date: Fri, 10 Jun 2016 10:09:19 +0100 Subject: [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 Closes #13560 from zhengruifeng/add_accuracy_property. --- python/pyspark/mllib/evaluation.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'python') 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): """ -- cgit v1.2.3