LAP.py
def find_neighbor_labels(pivot):
    """
    This method finds the labels of all the close neighbors of the pivot in the global set.
    """
    labels = np.full(k, INIT_VAL)
    a = loads(lines[pivot])
    pivot_val = np.fromstring(b64decode(a['data']),dtype=np.ubyte)
    pivot_val = pivot_val.astype(np.float64)
    pivot_label = a['label']
    labels[0] = pivot_label
    x = 0
    i = 1
    for x in range (k):
        if(x != pivot):
            b = loads(lines[x])
            candidate = np.fromstring(b64decode(b['data']),dtype=np.ubyte)
            candidate = candidate.astype(np.float64)
            x_label = b['label']
            if(distance.euclidean(pivot_val, candidate) <= t):
                labels[i] = x_label
                i += 1
        x += 1
    print(labels)
    return labels

    This method finds the labels of all the close neighbors of the pivot in the global set.
    
This method finds the labels of all the close neighbors of the pivot in the global set.
This method finds the labels of all the close neighbors of the pivot in the global set .
def find_neighbor_labels(pivot):
    labels = np.full(k, INIT_VAL)
    a = loads(lines[pivot])
    pivot_val = np.fromstring(b64decode(a['data']),dtype=np.ubyte)
    pivot_val = pivot_val.astype(np.float64)
    pivot_label = a['label']
    labels[0] = pivot_label
    x = 0
    i = 1
    for x in range (k):
        if(x != pivot):
            b = loads(lines[x])
            candidate = np.fromstring(b64decode(b['data']),dtype=np.ubyte)
            candidate = candidate.astype(np.float64)
            x_label = b['label']
            if(distance.euclidean(pivot_val, candidate) <= t):
                labels[i] = x_label
                i += 1
        x += 1
    print(labels)
    return labels
def find_neighbor_labels ( pivot ) : labels = np . full ( k , INIT_VAL ) a = loads ( lines [ pivot ] ) pivot_val = np . fromstring ( b64decode ( a [ 'data' ] ) , dtype = np . ubyte ) pivot_val = pivot_val . astype ( np . float64 ) pivot_label = a [ 'label' ] labels [ 0 ] = pivot_label x = 0 i = 1 for x in range ( k ) : if ( x != pivot ) : b = loads ( lines [ x ] ) candidate = np . fromstring ( b64decode ( b [ 'data' ] ) , dtype = np . ubyte ) candidate = candidate . astype ( np . float64 ) x_label = b [ 'label' ] if ( distance . euclidean ( pivot_val , candidate ) <= t ) : labels [ i ] = x_label i += 1 x += 1 print ( labels ) return labels
This method finds the labels of all the close neighbors of the pivot in the global set.
This method finds the labels of all the close neighbors of the pivot in the global set .
"""
    This method finds the labels of all the close neighbors of the pivot in the global set.
    """
pivot