Package adams.opt.genetic
Enum Measure
- java.lang.Object
-
- java.lang.Enum<Measure>
-
- adams.opt.genetic.Measure
-
- All Implemented Interfaces:
Serializable
,Comparable<Measure>
public enum Measure extends Enum<Measure>
The measure to use for evaluating.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ACC
Accuracy.AREA_UNDER_PRC
area under precision recall curve.AREA_UNDER_ROC
area under receiver operator curve.CC
Correlation coefficient.F_MEASURE
F measure.FALSE_NEG_RATE
false negative rate.FALSE_POS_RATE
false positive rate.KAPPA
Kappa.MAE
Mean absolute error.MSLE
Mean squared logarithmic error.PRECISION
precision.RAE
Relative absolute error.RECALL
recall.RMSE
Root mean squared error.RRSE
Root relative squared error.RSQUARED
R^2.TRUE_NEG_RATE
true negative rate.TRUE_POS_RATE
true positive rate.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double
adjust(double measure)
Adjusts the measure value for sorting: either multiplies it with -1 or 1.double
extract(weka.classifiers.Evaluation evaluation, boolean adjust, int classLabel)
Extracts the measure from the Evaluation object.boolean
isPerClassLabel()
Returns whether the measure is per class label.String
isValid(weka.core.Instances data, String index)
Checks whether the data can be used with this measure.EvaluationStatistic
toEvaluationStatistic()
Converts the measure intoEvaluationStatistic
.static Measure
valueOf(String name)
Returns the enum constant of this type with the specified name.static Measure[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ACC
public static final Measure ACC
Accuracy.
-
CC
public static final Measure CC
Correlation coefficient.
-
MAE
public static final Measure MAE
Mean absolute error.
-
MSLE
public static final Measure MSLE
Mean squared logarithmic error.
-
RAE
public static final Measure RAE
Relative absolute error.
-
RMSE
public static final Measure RMSE
Root mean squared error.
-
RRSE
public static final Measure RRSE
Root relative squared error.
-
RSQUARED
public static final Measure RSQUARED
R^2.
-
KAPPA
public static final Measure KAPPA
Kappa.
-
FALSE_POS_RATE
public static final Measure FALSE_POS_RATE
false positive rate.
-
FALSE_NEG_RATE
public static final Measure FALSE_NEG_RATE
false negative rate.
-
TRUE_POS_RATE
public static final Measure TRUE_POS_RATE
true positive rate.
-
TRUE_NEG_RATE
public static final Measure TRUE_NEG_RATE
true negative rate.
-
F_MEASURE
public static final Measure F_MEASURE
F measure.
-
PRECISION
public static final Measure PRECISION
precision.
-
RECALL
public static final Measure RECALL
recall.
-
AREA_UNDER_ROC
public static final Measure AREA_UNDER_ROC
area under receiver operator curve.
-
AREA_UNDER_PRC
public static final Measure AREA_UNDER_PRC
area under precision recall curve.
-
-
Method Detail
-
values
public static Measure[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Measure c : Measure.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Measure valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
toEvaluationStatistic
public EvaluationStatistic toEvaluationStatistic()
Converts the measure intoEvaluationStatistic
.- Returns:
- the converted statistic
-
extract
public double extract(weka.classifiers.Evaluation evaluation, boolean adjust, int classLabel) throws Exception
Extracts the measure from the Evaluation object.- Parameters:
evaluation
- the evaluation to useadjust
- whether to just the measureclassLabel
- the index of the class label to use (for per-class-label stats)- Returns:
- the measure
- Throws:
Exception
- in case the retrieval of the measure fails- See Also:
adjust(double)
-
adjust
public double adjust(double measure)
Adjusts the measure value for sorting: either multiplies it with -1 or 1.- Parameters:
measure
- the raw measure- Returns:
- the adjusted measure
-
isValid
public String isValid(weka.core.Instances data, String index)
Checks whether the data can be used with this measure.- Parameters:
data
- the data to checkindex
- the index for per-class-label measures- Returns:
- null if valid, otherwise error message
-
isPerClassLabel
public boolean isPerClassLabel()
Returns whether the measure is per class label.- Returns:
- true if per class label
-
-