public final class RegressionEvaluator extends Evaluator implements HasPredictionCol, HasLabelCol, DefaultParamsWritable
Constructor and Description |
---|
RegressionEvaluator() |
RegressionEvaluator(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(Dataset<?> dataset)
Evaluates model output and returns a scalar metric.
|
String |
getMetricName() |
boolean |
isLargerBetter()
Indicates whether the metric returned by
evaluate should be maximized (true, default)
or minimized (false). |
static RegressionEvaluator |
load(String path) |
Param<String> |
metricName()
Param for metric name in evaluation.
|
static MLReader<T> |
read() |
RegressionEvaluator |
setLabelCol(String value) |
RegressionEvaluator |
setMetricName(String value) |
RegressionEvaluator |
setPredictionCol(String value) |
String |
uid()
An immutable unique ID for the object and its derivatives.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPredictionCol, predictionCol
getLabelCol, labelCol
clear, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, paramMap, params, set, set, set, setDefault, setDefault, shouldOwn
toString
write
save
public RegressionEvaluator(String uid)
public RegressionEvaluator()
public static RegressionEvaluator load(String path)
public static MLReader<T> read()
public String uid()
Identifiable
uid
in interface Identifiable
public Param<String> metricName()
"rmse"
(default): root mean squared error
- "mse"
: mean squared error
- "r2"
: R^2^ metric
- "mae"
: mean absolute error
public String getMetricName()
public RegressionEvaluator setMetricName(String value)
public RegressionEvaluator setPredictionCol(String value)
public RegressionEvaluator setLabelCol(String value)
public double evaluate(Dataset<?> dataset)
Evaluator
isLargerBetter
specifies whether larger values are better.
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
defaultCopy()
.