Class ClassifierMetricGetter
- java.lang.Object
-
- ai.libs.jaicore.ml.core.evaluation.measure.ClassifierMetricGetter
-
public class ClassifierMetricGetter extends java.lang.ObjectClass for getting metrics by their name for single- and multilabel classifiers. This class allows for convenient access of individual metrics by name and can be used to list available metrics.
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.util.List<java.lang.String>MULTI_LABEL_METRICSAvailable metrics for multilabelclassifiersprotected static java.util.List<java.lang.String>SINGLE_LABEL_METRICSAvailable metric for singlelabelclassifiers
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.List<java.lang.String>getMultiLabelMetrics()static java.util.List<java.lang.String>getSingleLabelMetrics()static doublegetValueOfMetricForSingleLabelClassifier(weka.classifiers.Evaluation eval, java.lang.String metricName, int classIndex)Extracts the metric with the given name from the Evaluation object that is the result of evaluating a classifier.static doublegetValueOfMultilabelClassifier(meka.core.Result result, java.lang.String metricName)Extracts the metric with the given name from the result of evaluating a multilabel classifier (Calls the corresponding method).
-
-
-
Method Detail
-
getSingleLabelMetrics
public static java.util.List<java.lang.String> getSingleLabelMetrics()
-
getMultiLabelMetrics
public static java.util.List<java.lang.String> getMultiLabelMetrics()
-
getValueOfMetricForSingleLabelClassifier
public static double getValueOfMetricForSingleLabelClassifier(weka.classifiers.Evaluation eval, java.lang.String metricName, int classIndex) throws java.lang.ExceptionExtracts the metric with the given name from the Evaluation object that is the result of evaluating a classifier.- Parameters:
eval- The Evaluation object containing the results of evaluating a classifiermetricName- The name of the metric to retrieveclassIndex- The class index in the instances the classifier was evaluated on- Returns:
- The value of the metric
- Throws:
java.lang.Exception- If a metric cannot be retrieved
-
getValueOfMultilabelClassifier
public static double getValueOfMultilabelClassifier(meka.core.Result result, java.lang.String metricName)Extracts the metric with the given name from the result of evaluating a multilabel classifier (Calls the corresponding method).- Parameters:
result- The result of evaluating the classifiermetricName- The metric which should be retrieved- Returns:
- The value of the metric
-
-