@FunctionalInterface public interface LossFunction<T>
Error function.
final Error<Double> error = Error.of(LossFunction::mse);| Modifier and Type | Method and Description |
|---|---|
double |
apply(T[] calculated,
T[] expected)
Calculates the error between the expected function values and the
values calculated by the actual
ProgramGene. |
static double |
mae(Double[] calculated,
Double[] expected)
Mean absolute error is measured as the average of sum of absolute
differences between predictions and actual observations.
|
static double |
mse(Double[] calculated,
Double[] expected)
Mean square error is measured as the average of squared difference
between predictions and actual observations.
|
static double |
rmse(Double[] calculated,
Double[] expected)
Root mean square error is measured as the average of squared difference
between predictions and actual observations.
|
double apply(T[] calculated, T[] expected)
ProgramGene.calculated - the currently calculated function valueexpected - the expected function valuesIllegalArgumentException - if the length of the two arrays are not
equalNullPointerException - if one of the double[] arrays is
nullstatic double mse(Double[] calculated, Double[] expected)
calculated - the function values calculated with the current program
treeexpected - the expected function value as given by the sample pointsIllegalArgumentException - if the length of the two arrays are not
equalNullPointerException - if one of the double[] arrays is
nullrmse(Double[], Double[])static double rmse(Double[] calculated, Double[] expected)
calculated - the function values calculated with the current program
treeexpected - the expected function value as given by the sample pointsIllegalArgumentException - if the length of the two arrays are not
equalNullPointerException - if one of the double[] arrays is
nullmse(Double[], Double[])static double mae(Double[] calculated, Double[] expected)
calculated - the function values calculated with the current program
treeexpected - the expected function value as given by the sample pointsIllegalArgumentException - if the length of the two arrays are not
equalNullPointerException - if one of the double[] arrays is
null© 2007-2019 Franz Wilhelmstötter (2019-11-18 20:30)