pipeline/evaluate.py
def fpr_matrix(found_list, ground_list):
    """Compute the false positive rate matrix for the found communities when
    compared to the ground truth communities given.
    """
    all_ground = np.array(list(itertools.chain.from_iterable(ground_list)))
    size_all_ground = float(len(np.unique(all_ground)))
    glens = np.array([float(len(g)) for g in ground_list])
    negatives = size_all_ground - glens
    fp_mat = np.zeros((len(found_list), len(ground_list)))

    for i, flist in enumerate(found_list):
        found = set(flist)
        fp_mat[i] = [len(found.difference(ground)) for ground in ground_list]

    return fp_mat / negatives
Compute the false positive rate matrix for the found communities when
    compared to the ground truth communities given.
    
Compute the false positive rate matrix for the found communities when
compared to the ground truth communities given.
Compute the false positive rate matrix for the found communities when compared to the ground truth communities given .
def fpr_matrix(found_list, ground_list):
    all_ground = np.array(list(itertools.chain.from_iterable(ground_list)))
    size_all_ground = float(len(np.unique(all_ground)))
    glens = np.array([float(len(g)) for g in ground_list])
    negatives = size_all_ground - glens
    fp_mat = np.zeros((len(found_list), len(ground_list)))
    for i, flist in enumerate(found_list):
        found = set(flist)
        fp_mat[i] = [len(found.difference(ground)) for ground in ground_list]
    return fp_mat / negatives
def fpr_matrix ( found_list , ground_list ) : all_ground = np . array ( list ( itertools . chain . from_iterable ( ground_list ) ) ) size_all_ground = float ( len ( np . unique ( all_ground ) ) ) glens = np . array ( [ float ( len ( g ) ) for g in ground_list ] ) negatives = size_all_ground - glens fp_mat = np . zeros ( ( len ( found_list ) , len ( ground_list ) ) ) for i , flist in enumerate ( found_list ) : found = set ( flist ) fp_mat [ i ] = [ len ( found . difference ( ground ) ) for ground in ground_list ] return fp_mat / negatives
Compute the false positive rate matrix for the found communities when
compared to the ground truth communities given.
Compute the false positive rate matrix for the found communities when compared to the ground truth communities given .
"""Compute the false positive rate matrix for the found communities when
    compared to the ground truth communities given.
    """
found_list
ground_list