Interface EvaluationMetric<T extends Output<T>,C extends MetricContext<T>>

Type Parameters:
T - The output type.
C - The context (information necessary to calculate this metric).
All Known Implementing Classes:
AnomalyMetric, ClusteringMetric, LabelMetric, MultiLabelMetric, RegressionMetric

public interface EvaluationMetric<T extends Output<T>,C extends MetricContext<T>>
A metric that can be calculated for the specified output type.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    Specifies what form of average to use for a EvaluationMetric.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    compute(C context)
    Compute the result of this metric from the input context.
    createContext(Model<T> model, List<Prediction<T>> predictions)
    Creates the context this metric uses to compute it's value.
    default C
    createContext(Model<T> model, Dataset<T> dataset)
    Creates the metric context used to compute this metric's value, generating Predictions for each Example in the supplied dataset.
    default MetricID<T>
    The metric ID, a combination of the metric target and metric name.
    The name of this metric.
    The target for this metric instance.
  • Method Details

    • compute

      double compute(C context)
      Compute the result of this metric from the input context.
      Parameters:
      context - The context to use.
      Returns:
      The value of the metric.
    • getTarget

      MetricTarget<T> getTarget()
      The target for this metric instance.
      Returns:
      The metric target.
    • getName

      String getName()
      The name of this metric.
      Returns:
      The name.
    • getID

      default MetricID<T> getID()
      The metric ID, a combination of the metric target and metric name.
      Returns:
      The metric ID.
    • createContext

      C createContext(Model<T> model, List<Prediction<T>> predictions)
      Creates the context this metric uses to compute it's value.
      Parameters:
      model - The model to use.
      predictions - The predictions to use.
      Returns:
      The metric context.
    • createContext

      default C createContext(Model<T> model, Dataset<T> dataset)
      Creates the metric context used to compute this metric's value, generating Predictions for each Example in the supplied dataset.
      Parameters:
      model - The model to use.
      dataset - The dataset to predict outputs for.
      Returns:
      The metric context.