Enum Class Averaging

java.lang.Object
java.lang.Enum<Averaging>
smile.deep.metric.Averaging
All Implemented Interfaces:
Serializable, Comparable<Averaging>, Constable

public enum Averaging extends Enum<Averaging>
The averaging strategy to aggregate binary performance metrics across multi-classes.
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Macro-averaging calculates each class's performance metric (e.g., precision, recall) and then takes the arithmetic mean across all classes.
    Micro-averaging aggregates the counts of true positives, false positives, and false negatives across all classes and then calculates the performance metric based on the total counts.
    Weighted macro for imbalanced classes.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Averaging
    Returns the enum constant of this class with the specified name.
    static Averaging[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • Macro

      public static final Averaging Macro
      Macro-averaging calculates each class's performance metric (e.g., precision, recall) and then takes the arithmetic mean across all classes. So, the macro-average gives equal weight to each class, regardless of the number of instances.
    • Micro

      public static final Averaging Micro
      Micro-averaging aggregates the counts of true positives, false positives, and false negatives across all classes and then calculates the performance metric based on the total counts. So, the micro-average gives equal weight to each instance, regardless of the class label and the number of samples in the class. Note that micro-average precision and micro-average recall are equal to accuracy.
    • Weighted

      public static final Averaging Weighted
      Weighted macro for imbalanced classes. Note that weighted recall is equal to accuracy.
  • Method Details

    • values

      public static Averaging[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Averaging valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null