Package org.apache.spark.ml.evaluation
Class Evaluator
Object
org.apache.spark.ml.evaluation.Evaluator
- All Implemented Interfaces:
Serializable
,Params
,Identifiable
- Direct Known Subclasses:
BinaryClassificationEvaluator
,ClusteringEvaluator
,MulticlassClassificationEvaluator
,MultilabelClassificationEvaluator
,RankingEvaluator
,RegressionEvaluator
Abstract class for evaluators that compute metrics from predictions.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract Evaluator
Creates a copy of this instance with the same UID and some extra params.abstract double
Evaluates model output and returns a scalar metric.double
Evaluates model output and returns a scalar metric.boolean
Indicates whether the metric returned byevaluate
should be maximized (true, default) or minimized (false).Param<?>[]
params()
Returns all params sorted by their names.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.spark.ml.util.Identifiable
toString, uid
Methods inherited from interface org.apache.spark.ml.param.Params
clear, copyValues, defaultCopy, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, onParamChange, set, set, set, setDefault, setDefault, shouldOwn
-
Constructor Details
-
Evaluator
public Evaluator()
-
-
Method Details
-
copy
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. SeedefaultCopy()
. -
evaluate
Evaluates model output and returns a scalar metric. The value ofisLargerBetter()
specifies whether larger values are better.- Parameters:
dataset
- a dataset that contains labels/observations and predictions.paramMap
- parameter map that specifies the input columns and output metrics- Returns:
- metric
-
evaluate
Evaluates model output and returns a scalar metric. The value ofisLargerBetter()
specifies whether larger values are better.- Parameters:
dataset
- a dataset that contains labels/observations and predictions.- Returns:
- metric
-
isLargerBetter
public boolean isLargerBetter()Indicates whether the metric returned byevaluate
should be maximized (true, default) or minimized (false). A given evaluator may support multiple metrics which may be maximized or minimized.- Returns:
- (undocumented)
-
params
Description copied from interface:Params
Returns all params sorted by their names. The default implementation uses Java reflection to list all public methods that have no arguments and returnParam
.
-