LAP.py
def find_distances(local_start):
    """
    This method creates a k*m matrix 
    of the euclidean distances between 
    the members of the local set and the members of the global set.
    If the euclidean distance is not below the threshold, the distance is set to -1.
    """
    distances = np.reshape(np.arange(k*m),(k,m))
    for x in range (k):
        a = loads(lines[local_start+x])
        local_member = np.fromstring(b64decode(a['data']),dtype=np.ubyte)
        local_member = local_member.astype(np.float64)
        
        for y in range (m):
            if y in classified_points_ignorelist:
                distances[x,y] = -2
                continue
            b = loads(lines[y])
            global_member = np.fromstring(b64decode(b['data']),dtype=np.ubyte)
            global_member = global_member.astype(np.float64)
            dst = distance.euclidean(local_member, global_member)
            if(below_threshold(dst) == False):
                distances[x,y] = -1
            else:
                distances[x,y] = dst
    return distances

    This method creates a k*m matrix 
    of the euclidean distances between 
    the members of the local set and the members of the global set.
    If the euclidean distance is not below the threshold, the distance is set to -1.
    
This method creates a k*m matrix
of the euclidean distances between
the members of the local set and the members of the global set.
If the euclidean distance is not below the threshold, the distance is set to -1.
This method creates a k * m matrix of the euclidean distances between the members of the local set and the members of the global set . If the euclidean distance is not below the threshold the distance is set to - 1 .
def find_distances(local_start):
    distances = np.reshape(np.arange(k*m),(k,m))
    for x in range (k):
        a = loads(lines[local_start+x])
        local_member = np.fromstring(b64decode(a['data']),dtype=np.ubyte)
        local_member = local_member.astype(np.float64)
        for y in range (m):
            if y in classified_points_ignorelist:
                distances[x,y] = -2
                continue
            b = loads(lines[y])
            global_member = np.fromstring(b64decode(b['data']),dtype=np.ubyte)
            global_member = global_member.astype(np.float64)
            dst = distance.euclidean(local_member, global_member)
            if(below_threshold(dst) == False):
                distances[x,y] = -1
            else:
                distances[x,y] = dst
    return distances
def find_distances ( local_start ) : distances = np . reshape ( np . arange ( k * m ) , ( k , m ) ) for x in range ( k ) : a = loads ( lines [ local_start + x ] ) local_member = np . fromstring ( b64decode ( a [ 'data' ] ) , dtype = np . ubyte ) local_member = local_member . astype ( np . float64 ) for y in range ( m ) : if y in classified_points_ignorelist : distances [ x , y ] = - 2 continue b = loads ( lines [ y ] ) global_member = np . fromstring ( b64decode ( b [ 'data' ] ) , dtype = np . ubyte ) global_member = global_member . astype ( np . float64 ) dst = distance . euclidean ( local_member , global_member ) if ( below_threshold ( dst ) == False ) : distances [ x , y ] = - 1 else : distances [ x , y ] = dst return distances
This method creates a k*m matrix
of the euclidean distances between
the members of the local set and the members of the global set.
This method creates a k * m matrix of the euclidean distances between the members of the local set and the members of the global set .
"""
    This method creates a k*m matrix 
    of the euclidean distances between 
    the members of the local set and the members of the global set.
    If the euclidean distance is not below the threshold, the distance is set to -1.
    """
local_start