Class Evaluator

Object
org.apache.spark.ml.evaluation.Evaluator
All Implemented Interfaces:
Serializable, Params, Identifiable
Direct Known Subclasses:
BinaryClassificationEvaluator, ClusteringEvaluator, MulticlassClassificationEvaluator, MultilabelClassificationEvaluator, RankingEvaluator, RegressionEvaluator

public abstract class Evaluator extends Object implements Params
Abstract class for evaluators that compute metrics from predictions.
See Also:
  • Constructor Details

    • Evaluator

      public Evaluator()
  • Method Details

    • copy

      public abstract Evaluator 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. See defaultCopy().
      Specified by:
      copy in interface Params
      Parameters:
      extra - (undocumented)
      Returns:
      (undocumented)
    • evaluate

      public double evaluate(Dataset<?> dataset, ParamMap paramMap)
      Evaluates model output and returns a scalar metric. The value of isLargerBetter() 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

      public abstract double evaluate(Dataset<?> dataset)
      Evaluates model output and returns a scalar metric. The value of isLargerBetter() 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 by evaluate should be maximized (true, default) or minimized (false). A given evaluator may support multiple metrics which may be maximized or minimized.
      Returns:
      (undocumented)
    • params

      public Param<?>[] 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 return Param.

      Specified by:
      params in interface Params
      Returns:
      (undocumented)