|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.evaluation.paircounting.PairCountingFMeasure
public class PairCountingFMeasure
Compare two clustering results using a pair-counting F-Measure. A pair are any two objects that belong to the same cluster. Two clusterings are compared by comparing their pairs; if two clusterings completely agree, they also agree on every pair; even when the clusters and points are ordered differently. An empty clustering will of course have no pairs, the trivial all-in-one clustering of course has n^2 pairs. Therefore neither recall nor precision itself are useful, however their combination -- the F-Measure -- is useful.
Constructor Summary | |
---|---|
PairCountingFMeasure()
|
Method Summary | ||
---|---|---|
static
|
compareClusterings(R result1,
S result2)
Compare two clustering results. |
|
static
|
compareClusterings(R result1,
S result2,
boolean noiseSpecial,
boolean hierarchicalSpecial)
Compare two clustering results. |
|
static
|
compareClusterings(R result1,
S result2,
double beta)
Compare two clustering results. |
|
static
|
compareClusterings(R result1,
S result2,
double beta,
boolean noiseSpecial,
boolean hierarchicalSpecial)
Compare two clustering results. |
|
static Triple<Integer,Integer,Integer> |
countPairs(PairSortedGeneratorInterface first,
PairSortedGeneratorInterface second)
Compare two sets of generated pairs. |
|
static
|
countPairs(R result1,
S result2)
Compare two sets of generated pairs. |
|
static double |
fMeasure(int inBoth,
int inFirst,
int inSecond,
double beta)
Computes the F-measure of the given parameters. |
|
static
|
getPairGenerator(R clusters,
boolean noiseSpecial,
boolean hierarchicalSpecial)
Get a pair generator for the given Clustering |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PairCountingFMeasure()
Method Detail |
---|
public static <R extends Clustering<M>,M extends Model> PairSortedGeneratorInterface getPairGenerator(R clusters, boolean noiseSpecial, boolean hierarchicalSpecial)
R
- Clustering result classM
- Model typeclusters
- Clustering resultnoiseSpecial
- Special handling for "noise clusters"hierarchicalSpecial
- Special handling for hierarchical clusters
public static <R extends Clustering<M>,M extends Model,S extends Clustering<N>,N extends Model> double compareClusterings(R result1, S result2, double beta, boolean noiseSpecial, boolean hierarchicalSpecial)
R
- Result typeM
- Model typeS
- Result typeN
- Model typeresult1
- first resultresult2
- second resultbeta
- Beta value for the F-MeasurenoiseSpecial
- Noise receives special treatmenthierarchicalSpecial
- Special handling for hierarchical clusters
public static <R extends Clustering<M>,M extends Model,S extends Clustering<N>,N extends Model> double compareClusterings(R result1, S result2, double beta)
R
- Result typeM
- Model typeS
- Result typeN
- Model typeresult1
- first resultresult2
- second resultbeta
- Beta value for the F-Measure
public static <R extends Clustering<M>,M extends Model,S extends Clustering<N>,N extends Model> double compareClusterings(R result1, S result2, boolean noiseSpecial, boolean hierarchicalSpecial)
R
- Result typeM
- Model typeS
- Result typeN
- Model typeresult1
- first resultresult2
- second resultnoiseSpecial
- Noise receives special treatment
public static <R extends Clustering<M>,M extends Model,S extends Clustering<N>,N extends Model> double compareClusterings(R result1, S result2)
R
- Result typeM
- Model typeS
- Result typeN
- Model typeresult1
- first resultresult2
- second result
public static <R extends Clustering<M>,M extends Model,S extends Clustering<N>,N extends Model> Triple<Integer,Integer,Integer> countPairs(R result1, S result2)
R
- Result typeM
- Model typeS
- Result typeN
- Model typeresult1
- first resultresult2
- second result
Triple
that contains the number of objects that
are in both sets (FIRST), the number of objects that are just in
the first set (SECOND) and the number of object that are just in
the second set (THIRD).public static Triple<Integer,Integer,Integer> countPairs(PairSortedGeneratorInterface first, PairSortedGeneratorInterface second)
first
- first setsecond
- second set
Triple
that contains the number of objects that
are in both sets (FIRST), the number of objects that are just in
the first set (SECOND) and the number of object that are just in
the second set (THIRD).public static double fMeasure(int inBoth, int inFirst, int inSecond, double beta)
Returns
((1+beta*beta) * inBoth) / ((1+beta*beta) * inBoth + (beta*beta)*inFirst + inSecond)
inBoth
- The number of objects that are in both sets.inFirst
- The number of objects that are in the first set.inSecond
- The number of objects that are in the second set.beta
- The beta values for the f-measure.
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |