cdlib.evaluation.nf1¶
- cdlib.evaluation.nf1(first_partition: object, second_partition: object) MatchingResult ¶
Compute the Normalized F1 score of the optimal algorithms matches among the partitions in input. Works on overlapping/non-overlapping complete/partial coverage partitions.
- Parameters:
first_partition – NodeClustering object
second_partition – NodeClustering object
- Returns:
MatchingResult object
- Example:
>>> from cdlib import evaluation, algorithms >>> import networkx as nx >>> g = nx.karate_club_graph() >>> louvain_communities = algorithms.louvain(g) >>> leiden_communities = algorithms.leiden(g) >>> evaluation.nf1(louvain_communities,leiden_communities)
- Reference:
Rossetti, G., Pappalardo, L., & Rinzivillo, S. (2016). A novel approach to evaluate algorithms detection internal on ground truth.
Rossetti, G. (2017). : RDyn: graph benchmark handling algorithms dynamics. Journal of Complex Networks. 5(6), 893-912.