public abstract class MLEvalUtils
extends java.lang.Object
Metrics| Constructor and Description |
|---|
MLEvalUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Result |
averageResults(Result[] folds)
AverageResults - Create a Result with the average of an array of Results by taking the average +/- standand deviation.
|
static java.util.HashMap<java.lang.String,java.lang.Double> |
getMLStats(double[][] Rpred,
int[][] Y,
double[] t,
java.lang.String vop)
GetMLStats - Given predictions and corresponding true values and a threshold string, retreive statistics.
|
static java.util.HashMap<java.lang.String,java.lang.Double> |
getMLStats(double[][] Rpred,
int[][] Y,
java.lang.String t,
java.lang.String vop)
GetMLStats - Given predictions and corresponding true values and a threshold string, retreive statistics.
|
static java.util.HashMap<java.lang.String,java.lang.Double> |
getMTStats(double[][] Rpred,
int[][] Y,
java.lang.String vop)
GetMTStats - Given multi-target predictions and corresponding true values, retreive evaluation statistics.
|
static java.lang.String |
getThreshold(java.util.ArrayList<double[]> Y,
weka.core.Instances D,
java.lang.String top)
GetThreshold - Get a threshold from a Threshold OPtion string 'top'.
|
static void |
main(java.lang.String[] args)
Main - can use this function for writing tests during development.
|
public static java.lang.String getThreshold(java.util.ArrayList<double[]> Y,
weka.core.Instances D,
java.lang.String top)
throws java.lang.Exception
Y - label space; for calculating a threshold with PCutD - training data; for calculating a threshold with PCuttop - Threshold OPtion (either "PCut1", "PCutL" or a real value e.g. "0.5" or L real values e.g. "[0.1, 0.2, 0.8]" for L = 3java.lang.Exceptionpublic static java.util.HashMap<java.lang.String,java.lang.Double> getMLStats(double[][] Rpred,
int[][] Y,
java.lang.String t,
java.lang.String vop)
Rpred - predictions (may be real-valued confidences)Y - corresponding true valuest - a threshold string, e.g. "0.387"public static java.util.HashMap<java.lang.String,java.lang.Double> getMLStats(double[][] Rpred,
int[][] Y,
double[] t,
java.lang.String vop)
Rpred - predictions (may be double-valued confidences in the multi-label case)Y - corresponding true valuest - a vector of thresholds, e.g. [0.1,0.1,0.1] or [0.1,0.5,0.4,0.001]public static java.util.HashMap<java.lang.String,java.lang.Double> getMTStats(double[][] Rpred,
int[][] Y,
java.lang.String vop)
Rpred - predictionsY - corresponding true valuespublic static Result averageResults(Result[] folds)
folds - array of Results (e.g., from CV-validation)public static void main(java.lang.String[] args)
args - command line arguments