aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorHolden Karau <holden@us.ibm.com>2016-05-11 08:33:29 +0200
committerNick Pentreath <nickp@za.ibm.com>2016-05-11 08:33:29 +0200
commit007882c7ee06de37ba309424fced1e4c6b408572 (patch)
tree40dee3f55d78515449a275f7365b41d619598a15 /python
parentba181c0c7a32b0e81bbcdbe5eed94fc97b58c83e (diff)
downloadspark-007882c7ee06de37ba309424fced1e4c6b408572.tar.gz
spark-007882c7ee06de37ba309424fced1e4c6b408572.tar.bz2
spark-007882c7ee06de37ba309424fced1e4c6b408572.zip
[SPARK-15189][PYSPARK][DOCS] Update ml.evaluation PyDoc
## What changes were proposed in this pull request? Fix doctest issue, short param description, and tag items as Experimental ## How was this patch tested? build docs locally & doctests Author: Holden Karau <holden@us.ibm.com> Closes #12964 from holdenk/SPARK-15189-ml.Evaluation-PyDoc-issues.
Diffstat (limited to 'python')
-rw-r--r--python/pyspark/ml/evaluation.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/python/pyspark/ml/evaluation.py b/python/pyspark/ml/evaluation.py
index 2a41678741..719c0c7d79 100644
--- a/python/pyspark/ml/evaluation.py
+++ b/python/pyspark/ml/evaluation.py
@@ -105,6 +105,8 @@ class JavaEvaluator(JavaParams, Evaluator):
@inherit_doc
class BinaryClassificationEvaluator(JavaEvaluator, HasLabelCol, HasRawPredictionCol):
"""
+ .. note:: Experimental
+
Evaluator for binary classification, which expects two input columns: rawPrediction and label.
The rawPrediction column can be of type double (binary 0/1 prediction, or probability of label
1) or of type vector (length-2 vector of raw predictions, scores, or label probabilities).
@@ -172,6 +174,8 @@ class BinaryClassificationEvaluator(JavaEvaluator, HasLabelCol, HasRawPrediction
@inherit_doc
class RegressionEvaluator(JavaEvaluator, HasLabelCol, HasPredictionCol):
"""
+ .. note:: Experimental
+
Evaluator for Regression, which expects two input
columns: prediction and label.
@@ -193,7 +197,11 @@ class RegressionEvaluator(JavaEvaluator, HasLabelCol, HasPredictionCol):
# when we evaluate a metric that is needed to minimize (e.g., `"rmse"`, `"mse"`, `"mae"`),
# we take and output the negative of this metric.
metricName = Param(Params._dummy(), "metricName",
- "metric name in evaluation (mse|rmse|r2|mae)",
+ """metric name in evaluation - one of:
+ rmse - root mean squared error (default)
+ mse - mean squared error
+ r2 - r^2 metric
+ mae - mean absolute error.""",
typeConverter=TypeConverters.toString)
@keyword_only
@@ -241,8 +249,11 @@ class RegressionEvaluator(JavaEvaluator, HasLabelCol, HasPredictionCol):
@inherit_doc
class MulticlassClassificationEvaluator(JavaEvaluator, HasLabelCol, HasPredictionCol):
"""
+ .. note:: Experimental
+
Evaluator for Multiclass Classification, which expects two input
columns: prediction and label.
+
>>> scoreAndLabels = [(0.0, 0.0), (0.0, 1.0), (0.0, 0.0),
... (1.0, 0.0), (1.0, 1.0), (1.0, 1.0), (1.0, 1.0), (2.0, 2.0), (2.0, 0.0)]
>>> dataset = sqlContext.createDataFrame(scoreAndLabels, ["prediction", "label"])