Enum Class RegressionMetrics

java.lang.Object
java.lang.Enum<RegressionMetrics>
org.tribuo.regression.evaluation.RegressionMetrics
All Implemented Interfaces:
Serializable, Comparable<RegressionMetrics>, Constable

public enum RegressionMetrics extends Enum<RegressionMetrics>
An enum of the default RegressionMetrics supported by the multi-dimensional regression evaluation package.

The metrics treat each regressed dimension independently.

  • Enum Constant Details

    • R2

      public static final RegressionMetrics R2
      Calculates the R^2 of the predictions.
    • RMSE

      public static final RegressionMetrics RMSE
      Calculates the Root Mean Squared Error of the predictions.
    • MAE

      public static final RegressionMetrics MAE
      Calculates the Mean Absolute Error of the predictions.
    • EV

      public static final RegressionMetrics EV
      Calculates the Explained Variance of the predictions.
  • Method Details

    • values

      public static RegressionMetrics[] 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 RegressionMetrics 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
    • r2

      public static double r2(MetricTarget<Regressor> target, RegressionSufficientStatistics sufficientStats)
      Calculates R^2 based on the supplied statistics.
      Parameters:
      target - The regression dimension or average to target.
      sufficientStats - The sufficient statistics.
      Returns:
      The R^2 value of the predictions.
    • r2

      public static double r2(Regressor variable, RegressionSufficientStatistics sufficientStats)
      Calculates R^2 based on the supplied statistics for a single dimension.
      Parameters:
      variable - The regression dimension.
      sufficientStats - The sufficient statistics.
      Returns:
      The R^2 value of the predictions.
    • rmse

      public static double rmse(MetricTarget<Regressor> target, RegressionSufficientStatistics sufficientStats)
      Calculates the RMSE based on the supplied statistics.
      Parameters:
      target - The regression dimension or average to target.
      sufficientStats - The sufficient statistics.
      Returns:
      The RMSE of the predictions.
    • rmse

      public static double rmse(Regressor variable, RegressionSufficientStatistics sufficientStats)
      Calculates the RMSE based on the supplied statistics for a single dimension.
      Parameters:
      variable - The regression dimension to target.
      sufficientStats - The sufficient statistics.
      Returns:
      The RMSE of the predictions.
    • mae

      public static double mae(MetricTarget<Regressor> target, RegressionSufficientStatistics sufficientStats)
      Calculates the Mean Absolute Error based on the supplied statistics.
      Parameters:
      target - The regression dimension or average to target.
      sufficientStats - The sufficient statistics.
      Returns:
      The MAE of the predictions.
    • mae

      public static double mae(Regressor variable, RegressionSufficientStatistics sufficientStats)
      Calculates the Mean Absolute Error based on the supplied statistics for a single dimension.
      Parameters:
      variable - The regression dimension to target.
      sufficientStats - The sufficient statistics.
      Returns:
      The MAE of the predictions.
    • explainedVariance

      public static double explainedVariance(MetricTarget<Regressor> target, RegressionSufficientStatistics sufficientStats)
      Calculates the explained variance based on the supplied statistics.
      Parameters:
      target - The regression dimension or average to target.
      sufficientStats - The sufficient statistics.
      Returns:
      The explained variance of the truth given the predictions.
    • explainedVariance

      public static double explainedVariance(Regressor variable, RegressionSufficientStatistics sufficientStats)
      Calculates the explained variance based on the supplied statistics for a single dimension.
      Parameters:
      variable - The regression dimension to target.
      sufficientStats - The sufficient statistics.
      Returns:
      The explained variance of the truth given the predictions.