pipeline/evaluate.py
def jaccard_matrix(found_list, ground_list):
    """Compute pairwise jaccard similarity for a list of found communities when
    compared to the given ground truth communities.
    """
    gsets = [set(g) for g in ground_list]
    int_mat = np.zeros((len(found_list), len(ground_list)))
    union_mat = np.zeros((len(found_list), len(ground_list)))
    for i, found in enumerate(found_list):
        int_mat[i] = [len(ground.intersection(found)) for ground in gsets]
    for i, found in enumerate(found_list):
        union_mat[i] = [len(ground.union(found)) for ground in gsets]
    return int_mat / union_mat
Compute pairwise jaccard similarity for a list of found communities when
    compared to the given ground truth communities.
    
Compute pairwise jaccard similarity for a list of found communities when
compared to the given ground truth communities.
Compute pairwise jaccard similarity for a list of found communities when compared to the given ground truth communities .
def jaccard_matrix(found_list, ground_list):
    gsets = [set(g) for g in ground_list]
    int_mat = np.zeros((len(found_list), len(ground_list)))
    union_mat = np.zeros((len(found_list), len(ground_list)))
    for i, found in enumerate(found_list):
        int_mat[i] = [len(ground.intersection(found)) for ground in gsets]
    for i, found in enumerate(found_list):
        union_mat[i] = [len(ground.union(found)) for ground in gsets]
    return int_mat / union_mat
def jaccard_matrix ( found_list , ground_list ) : gsets = [ set ( g ) for g in ground_list ] int_mat = np . zeros ( ( len ( found_list ) , len ( ground_list ) ) ) union_mat = np . zeros ( ( len ( found_list ) , len ( ground_list ) ) ) for i , found in enumerate ( found_list ) : int_mat [ i ] = [ len ( ground . intersection ( found ) ) for ground in gsets ] for i , found in enumerate ( found_list ) : union_mat [ i ] = [ len ( ground . union ( found ) ) for ground in gsets ] return int_mat / union_mat
Compute pairwise jaccard similarity for a list of found communities when
compared to the given ground truth communities.
Compute pairwise jaccard similarity for a list of found communities when compared to the given ground truth communities .
"""Compute pairwise jaccard similarity for a list of found communities when
    compared to the given ground truth communities.
    """
found_list
ground_list