Defined in File SCDGroundTruthComparison.hpp
public NetworKit::Algorithm
(Class Algorithm)
This class evaluates a set found communities against a ground truth cover. Each found community is compared against the communities of the seed node in the ground truth cover.
For each score, the ground truth community is chosen as comparison that maximizes the score. If seeds are not ignored (a parameter of the constructor), then only ground truth communities that contain the given seed are used to compare against.
The calculated scores are:
Precision: the size of the intersection of found and ground truth community divided by the size of the found community, i.e., how much of the found community was an actual match.
Recall: the size of the intersection of found and ground truth community divided by the size of the ground truth community, i.e., how much of the ground truth community was found.
F1 score: the harmonic mean of precision and recall.
Jaccard index: the size of the intersection of found and ground truth community divided by the size of the union of found and ground truth community.
For each score, the range of values is between 0 and 1, where 0 is the worst and 1 the best score.
Public Functions
Construct the SCD evaluation for the given graph, ground truth and found communities.
G – The graph to compare on
groundTruth – The ground truth cover
found – The found communities
ignoreSeeds – If the seeds shall be ignored, i.e. any ground truth community is a match
Calculate all measures.
Get the Jaccard index of every found community.
A map between seed node and the jaccard index of the seed’s community.
Get the precision of every found community.
A map between seed node and the precision of the seed’s community.
Get the recall of every found community.
A map between seed node and the recall of the seed’s community.
Get the F1 score of every found community.
A map between seed node and the F1 score of the seed’s community.
Get the (unweighted) average of the jaccard indices of every found community.
Get the (unweighted) average of the F1 score of every found community.
Get the (unweighted) average of the precision of every found community.
Get the (unweighted) average of the recall of every found community.