cdlib.evaluation.f1¶
- cdlib.evaluation.f1(first_partition: object, second_partition: object) MatchingResult ¶
Compute the average 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.f1(louvain_communities,leiden_communities)
- Reference:
Rossetti, G., Pappalardo, L., & Rinzivillo, S. (2016). A novel approach to evaluate algorithms detection internal on ground truth. In Complex Networks VII (pp. 133-144). Springer, Cham.