public final class RegressionEvaluator extends Evaluator
Constructor and Description |
---|
RegressionEvaluator() |
RegressionEvaluator(java.lang.String uid) |
Modifier and Type | Method and Description |
---|---|
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.
|
java.lang.String |
getMetricName() |
boolean |
isLargerBetter()
Indicates whether the metric returned by
evaluate() should be maximized (true, default)
or minimized (false). |
Param<java.lang.String> |
metricName()
param for metric name in evaluation (supports
"rmse" (default), "mse" , "r2" , and "mae" ) |
RegressionEvaluator |
setLabelCol(java.lang.String value) |
RegressionEvaluator |
setMetricName(java.lang.String value) |
RegressionEvaluator |
setPredictionCol(java.lang.String value) |
java.lang.String |
uid()
An immutable unique ID for the object and its derivatives.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clear, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, paramMap, params, set, set, set, setDefault, setDefault, shouldOwn, validateParams
toString
public RegressionEvaluator(java.lang.String uid)
public RegressionEvaluator()
public java.lang.String uid()
Identifiable
public Param<java.lang.String> metricName()
"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.
public java.lang.String getMetricName()
public RegressionEvaluator setMetricName(java.lang.String value)
public RegressionEvaluator setPredictionCol(java.lang.String value)
public RegressionEvaluator setLabelCol(java.lang.String value)
public double evaluate(DataFrame dataset)
Evaluator
public boolean isLargerBetter()
Evaluator
evaluate()
should be maximized (true, default)
or minimized (false).
A given evaluator may support multiple metrics which may be maximized or minimized.isLargerBetter
in class Evaluator
public RegressionEvaluator copy(ParamMap extra)
Params