public class AdjustedMutualInformation extends java.lang.Object implements ClusteringMetric
WARNING: The computation of adjustment is is really really slow.
Modifier and Type | Class and Description |
---|---|
static class |
AdjustedMutualInformation.Method
The normalization method.
|
Modifier and Type | Field and Description |
---|---|
static AdjustedMutualInformation |
MAX
Default instance with max normalization.
|
static AdjustedMutualInformation |
MIN
Default instance with min normalization.
|
static AdjustedMutualInformation |
SQRT
Default instance with sqrt normalization.
|
static AdjustedMutualInformation |
SUM
Default instance with sum normalization.
|
Constructor and Description |
---|
AdjustedMutualInformation(AdjustedMutualInformation.Method method)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static double |
max(int[] y1,
int[] y2)
Calculates the adjusted mutual information of (I(y1, y2) - E(MI)) / (max(H(y1), H(y2)) - E(MI)).
|
static double |
min(int[] y1,
int[] y2)
Calculates the adjusted mutual information of (I(y1, y2) - E(MI)) / (min(H(y1), H(y2)) - E(MI)).
|
double |
score(int[] y1,
int[] y2)
Returns a score to measure the quality of clustering.
|
static double |
sqrt(int[] y1,
int[] y2)
Calculates the adjusted mutual information of (I(y1, y2) - E(MI)) / (sqrt(H(y1) * H(y2)) - E(MI)).
|
static double |
sum(int[] y1,
int[] y2)
Calculates the adjusted mutual information of (I(y1, y2) - E(MI)) / (0.5 * (H(y1) + H(y2)) - E(MI)).
|
java.lang.String |
toString() |
public static final AdjustedMutualInformation MAX
public static final AdjustedMutualInformation MIN
public static final AdjustedMutualInformation SUM
public static final AdjustedMutualInformation SQRT
public AdjustedMutualInformation(AdjustedMutualInformation.Method method)
method
- the normalization method.public double score(int[] y1, int[] y2)
ClusteringMetric
score
in interface ClusteringMetric
y1
- the cluster labels.y2
- the alternative cluster labels.public static double max(int[] y1, int[] y2)
public static double sum(int[] y1, int[] y2)
public static double sqrt(int[] y1, int[] y2)
public static double min(int[] y1, int[] y2)
public java.lang.String toString()
toString
in class java.lang.Object