pipeline/evaluate.py
def precision_matrix(found_list, ground_list):
    """Compute pairwise precision for a list of found communities when compared
    to the given ground truth communities.
    """
    gsets = [set(g) for g in ground_list]
    flens = np.matrix([float(len(f)) for f in found_list])
    tp_mat = np.zeros((len(found_list), len(ground_list)))
    for i, found in enumerate(found_list):
        tp_mat[i] = [len(ground.intersection(found)) for ground in gsets]
    return np.array(tp_mat / np.tile(flens.transpose(), tp_mat.shape[1]))
Compute pairwise precision for a list of found communities when compared
    to the given ground truth communities.
    
Compute pairwise precision for a list of found communities when compared
to the given ground truth communities.
Compute pairwise precision for a list of found communities when compared to the given ground truth communities .
def precision_matrix(found_list, ground_list):
    gsets = [set(g) for g in ground_list]
    flens = np.matrix([float(len(f)) for f in found_list])
    tp_mat = np.zeros((len(found_list), len(ground_list)))
    for i, found in enumerate(found_list):
        tp_mat[i] = [len(ground.intersection(found)) for ground in gsets]
    return np.array(tp_mat / np.tile(flens.transpose(), tp_mat.shape[1]))
def precision_matrix ( found_list , ground_list ) : gsets = [ set ( g ) for g in ground_list ] flens = np . matrix ( [ float ( len ( f ) ) for f in found_list ] ) tp_mat = np . zeros ( ( len ( found_list ) , len ( ground_list ) ) ) for i , found in enumerate ( found_list ) : tp_mat [ i ] = [ len ( ground . intersection ( found ) ) for ground in gsets ] return np . array ( tp_mat / np . tile ( flens . transpose ( ) , tp_mat . shape [ 1 ] ) )
Compute pairwise precision for a list of found communities when compared
to the given ground truth communities.
Compute pairwise precision for a list of found communities when compared to the given ground truth communities .
"""Compute pairwise precision for a list of found communities when compared
    to the given ground truth communities.
    """
found_list
ground_list