org.apache.spark.ml.evaluation
Class RegressionEvaluator

Object
  extended by org.apache.spark.ml.evaluation.Evaluator
      extended by org.apache.spark.ml.evaluation.RegressionEvaluator
All Implemented Interfaces:
java.io.Serializable, Params

public final class RegressionEvaluator
extends Evaluator

:: Experimental :: Evaluator for regression, which expects two input columns: prediction and label.

See Also:
Serialized Form

Constructor Summary
RegressionEvaluator()
           
RegressionEvaluator(String uid)
           
 
Method Summary
 RegressionEvaluator copy(ParamMap extra)
          Creates a copy of this instance with the same UID and some extra params.
 double evaluate(DataFrame dataset)
          Evaluates the output.
 String getMetricName()
           
 Param<String> metricName()
          param for metric name in evaluation (supports "rmse" (default), "mse", "r2", and "mae")
 RegressionEvaluator setLabelCol(String value)
           
 RegressionEvaluator setMetricName(String value)
           
 RegressionEvaluator setPredictionCol(String value)
           
 String uid()
           
 
Methods inherited from class org.apache.spark.ml.evaluation.Evaluator
evaluate
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.spark.ml.param.Params
clear, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, paramMap, params, set, set, set, setDefault, setDefault, setDefault, shouldOwn, validateParams
 

Constructor Detail

RegressionEvaluator

public RegressionEvaluator(String uid)

RegressionEvaluator

public RegressionEvaluator()
Method Detail

uid

public String uid()

metricName

public Param<String> metricName()
param for metric name in evaluation (supports "rmse" (default), "mse", "r2", and "mae")

Because we will maximize evaluation value (ref: CrossValidator), when we evaluate a metric that is needed to minimize (e.g., "rmse", "mse", "mae"), we take and output the negative of this metric.

Returns:
(undocumented)

getMetricName

public String getMetricName()

setMetricName

public RegressionEvaluator setMetricName(String value)

setPredictionCol

public RegressionEvaluator setPredictionCol(String value)

setLabelCol

public RegressionEvaluator setLabelCol(String value)

evaluate

public double evaluate(DataFrame dataset)
Description copied from class: Evaluator
Evaluates the output.

Specified by:
evaluate in class Evaluator
Parameters:
dataset - a dataset that contains labels/observations and predictions.
Returns:
metric

copy

public RegressionEvaluator copy(ParamMap extra)
Description copied from interface: Params
Creates a copy of this instance with the same UID and some extra params. Subclasses should implement this method and set the return type properly.

Specified by:
copy in interface Params
Specified by:
copy in class Evaluator
Parameters:
extra - (undocumented)
Returns:
(undocumented)
See Also:
defaultCopy()