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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract EvaluatorCreates a copy of this instance with the same UID and some extra params.abstract doubleEvaluates model output and returns a scalar metric.doubleEvaluates model output and returns a scalar metric.booleanIndicates whether the metric returned byevaluateshould 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, waitMethods inherited from interface org.apache.spark.ml.util.Identifiable
toString, uidMethods inherited from interface org.apache.spark.ml.param.Params
clear, copyValues, defaultCopy, estimateMatadataSize, 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:ParamsCreates 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 byevaluateshould 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:ParamsReturns all params sorted by their names. The default implementation uses Java reflection to list all public methods that have no arguments and returnParam.
-