Package org.tribuo.regression.evaluation
Enum Class RegressionMetrics
- All Implemented Interfaces:
Serializable
,Comparable<RegressionMetrics>
,Constable
An enum of the default
RegressionMetric
s supported by the multi-dimensional regression
evaluation package.
The metrics treat each regressed dimension independently.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
explainedVariance
(MetricTarget<Regressor> target, RegressionSufficientStatistics sufficientStats) Calculates the explained variance based on the supplied statistics.static double
explainedVariance
(Regressor variable, RegressionSufficientStatistics sufficientStats) Calculates the explained variance based on the supplied statistics for a single dimension.static double
mae
(MetricTarget<Regressor> target, RegressionSufficientStatistics sufficientStats) Calculates the Mean Absolute Error based on the supplied statistics.static double
mae
(Regressor variable, RegressionSufficientStatistics sufficientStats) Calculates the Mean Absolute Error based on the supplied statistics for a single dimension.static double
r2
(MetricTarget<Regressor> target, RegressionSufficientStatistics sufficientStats) Calculates R^2 based on the supplied statistics.static double
r2
(Regressor variable, RegressionSufficientStatistics sufficientStats) Calculates R^2 based on the supplied statistics for a single dimension.static double
rmse
(MetricTarget<Regressor> target, RegressionSufficientStatistics sufficientStats) Calculates the RMSE based on the supplied statistics.static double
rmse
(Regressor variable, RegressionSufficientStatistics sufficientStats) Calculates the RMSE based on the supplied statistics for a single dimension.static RegressionMetrics
Returns the enum constant of this class with the specified name.static RegressionMetrics[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
R2
Calculates the R^2 of the predictions. -
RMSE
Calculates the Root Mean Squared Error of the predictions. -
MAE
Calculates the Mean Absolute Error of the predictions. -
EV
Calculates the Explained Variance of the predictions.
-
-
Method Details
-
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
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 nameNullPointerException
- 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
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
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
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.
-