public abstract class Metrics
extends java.lang.Object
L_ are loss/error measures (less is better)
P_ are payoff/accuracy measures (higher is better).
For more on the evaluation and threshold selection implemented here, seeConstructor and Description |
---|
Metrics() |
Modifier and Type | Method and Description |
---|---|
static double |
F1(int[] s1,
int[] s2)
F1 - the F1 measure for two sets.
|
static double |
L_Hamming(int[][] Y,
int[][] Ypred)
Hamming loss.
|
static double |
L_Hamming(int[] y,
int[] ypred)
Hamming loss.
|
static double |
L_JaccardDist(int[][] Y,
int[][] Ypred)
Jaccard Distance -- the loss version of Jaccard Index
|
static double |
L_LogLoss(double y,
double rpred,
double C)
L_LogLoss - the log loss between real-valued confidence rpred and true prediction y.
|
static double |
L_LogLoss(int[][] Y,
double[][] Rpred,
double C)
L_LogLoss - the log loss between real-valued confidences Rpred and true predictions Y with a maximum penalty C [Important Note: Earlier versions of Meka only normalised by N, and not N*L as here].
|
static double |
L_LogLossD(int[][] Y,
double[][] Rpred)
L_LogLoss - the log loss between real-valued confidences Rpred and true predictions Y with a maximum penalty based on the number of examples D [Important Note: Earlier versions of Meka only normalised by N, and not N*L as here].
|
static double |
L_LogLossL(int[][] Y,
double[][] Rpred)
L_LogLoss - the log loss between real-valued confidences Rpred and true predictions Y with a maximum penalty based on the number of labels L [Important Note: Earlier versions of Meka only normalised by N, and not N*L as here].
|
double |
L_MAE(int[] y,
double[] p)
MAE
|
double |
L_MSE(int[] y,
double[] p)
MSE
|
static double |
L_OneError(int[][] Y,
double[][] Rpred)
OneError -
|
static double |
L_RankLoss(int[][] Y,
double[][] Rpred) |
static double |
L_RankLoss(int[] y,
double[] rpred) |
static double |
L_RankLoss(int[] y,
int[] r)
Rank Loss - the average fraction of labels which are not correctly ordered.
|
static double |
L_ZeroOne(int[][] Y,
int[][] Ypred)
0/1 Loss.
|
static double |
L_ZeroOne(int[] y,
int[] ypred)
0/1 Loss.
|
static void |
main(java.lang.String[] args)
Do some tests.
|
static double |
P_Accuracy(int[][] Y,
int[][] Ypred)
Jaccard Index -- often simply called multi-label 'accuracy'.
|
static double |
P_Accuracy(int[] y,
int[] ypred)
Jaccard Index -- often simply called multi-label 'accuracy'.
|
static double |
P_AveragePrecision(int[][] Y,
double[][] Rpred) |
static double |
P_AveragePrecision(int[] y,
double[] rpred) |
static double |
P_AveragePrecision(int[] y,
int[] r)
Average Precision - computes for each relevant label the percentage of relevant labels among all labels that are ranked before it.
|
static double |
P_ExactMatch(int[][] Y,
int[][] Ypred)
Exact Match, i.e., 1 - [0/1 Loss].
|
static double |
P_FalseNegatives(int[] y,
int[] ypred)
P_FalseNegatives - 0 but supposed to be 1 (the length of ypred \ y).
|
static double |
P_FalsePositives(int[] y,
int[] ypred)
P_FalsePositives - 1 but supposed to be 0 (the length of y \ ypred).
|
static double |
P_FmacroAvgD(int[][] Y,
int[][] Ypred)
F-Measure Macro Averaged by D - The F-measure macro averaged by example.
|
static double |
P_FmacroAvgL(int[][] Y,
int[][] Ypred)
F-Measure Macro Averaged by L - The 'standard' macro average.
|
static double |
P_FmicroAvg(int[][] Y,
int[][] Ypred)
P_FmicroAvg - Micro Averaged F-measure (F1, as if all labels in the dataset formed a single vector)
|
static double |
P_Hamming(int[][] Y,
int[][] Ypred)
Hamming score aka label accuracy.
|
static double |
P_Hamming(int[][] Y,
int[][] Ypred,
int j)
Hamming score aka label accuracy.
|
static double |
P_Harmonic(int[][] Y,
int[][] Ypred)
Harmonic Accuracy -- average over all labels.
|
static double |
P_Harmonic(int[][] Y,
int[][] Ypred,
int j)
Harmonic Accuracy -- for the j-th label.
|
static double |
P_Harmonic(int[] y,
int[] ypred)
Harmonic Accuracy.
|
static double |
P_JaccardIndex(int[][] Y,
int[][] Ypred)
Jaccard Index -- often simply called multi-label 'accuracy'.
|
double |
P_LogLikelihood(int[] y,
double[] p)
Log Likelihood
|
static double |
P_Precision(int[][] Y,
int[][] Ypred,
int j)
P_Precision - (retrieved AND relevant) / retrieved
|
static double |
P_Precision(int[] y,
int[] ypred)
P_Precision - (retrieved AND relevant) / retrieved
|
static double |
P_Recall(int[][] Y,
int[][] Ypred,
int j)
P_Recall - (retrieved AND relevant) / relevant
|
static double |
P_Recall(int[] y,
int[] ypred)
P_Recall - (retrieved AND relevant) / relevant
|
static double |
P_TrueNegatives(int[] y,
int[] ypred)
P_TrueNegatives - 0 and supposed to be 0.
|
static double |
P_TruePositives(int[] y,
int[] ypred)
P_TruePositives - 1 and supposed to be 1 (the intersection, i.e., logical AND).
|
public static double P_ExactMatch(int[][] Y, int[][] Ypred)
public static double L_ZeroOne(int[] y, int[] ypred)
public static double L_ZeroOne(int[][] Y, int[][] Ypred)
public static double L_Hamming(int[] y, int[] ypred)
public static double L_Hamming(int[][] Y, int[][] Ypred)
public static double P_Hamming(int[][] Y, int[][] Ypred)
public static double P_Hamming(int[][] Y, int[][] Ypred, int j)
public static double P_Harmonic(int[] y, int[] ypred)
public static double P_Harmonic(int[][] Y, int[][] Ypred, int j)
public static double P_Harmonic(int[][] Y, int[][] Ypred)
public static double P_Accuracy(int[] y, int[] ypred)
public static double P_Accuracy(int[][] Y, int[][] Ypred)
public static double P_JaccardIndex(int[][] Y, int[][] Ypred)
public static double L_JaccardDist(int[][] Y, int[][] Ypred)
public static double L_LogLoss(double y, double rpred, double C)
y
- labelrpred
- prediction (confidence)C
- limit (maximum loss of log(C))public static double L_LogLossL(int[][] Y, double[][] Rpred)
public static double L_LogLossD(int[][] Y, double[][] Rpred)
public static double L_LogLoss(int[][] Y, double[][] Rpred, double C)
public static double P_TruePositives(int[] y, int[] ypred)
public static double P_FalsePositives(int[] y, int[] ypred)
public static double P_TrueNegatives(int[] y, int[] ypred)
public static double P_FalseNegatives(int[] y, int[] ypred)
public static double P_Precision(int[] y, int[] ypred)
public static double P_Recall(int[] y, int[] ypred)
public static double F1(int[] s1, int[] s2)
public static double P_Precision(int[][] Y, int[][] Ypred, int j)
public static double P_Recall(int[][] Y, int[][] Ypred, int j)
public static double P_FmicroAvg(int[][] Y, int[][] Ypred)
public static double P_FmacroAvgL(int[][] Y, int[][] Ypred)
public static double P_FmacroAvgD(int[][] Y, int[][] Ypred)
public static double L_OneError(int[][] Y, double[][] Rpred)
public static double P_AveragePrecision(int[][] Y, double[][] Rpred)
public static double P_AveragePrecision(int[] y, double[] rpred)
public static double P_AveragePrecision(int[] y, int[] r)
y
- 0/1 labels [0, 0, 1 ] (true labels)r
- ranking position [1, 2, 0 ]public static double L_RankLoss(int[][] Y, double[][] Rpred)
public static double L_RankLoss(int[] y, double[] rpred)
public static double L_RankLoss(int[] y, int[] r)
y
- 0/1 labels [0, 0, 1 ]r
- ranking position [1, 2, 0 ]public double P_LogLikelihood(int[] y, double[] p)
public double L_MSE(int[] y, double[] p)
public double L_MAE(int[] y, double[] p)
public static void main(java.lang.String[] args)