LAP.py
def is_correct(labels):
    """
    This method gives a correctness score to the algorithm 
    based on the similarity of the neighbors to the pivot.
    A score of 0 means there are no inaccurately classified neighbors.
    """
    x = 1
    wrongness_score = 0
    correctness_score = 0
    incorrect_labels = np.full(k, INIT_VAL)
    i = 0
    for x in range (k):
        if(labels[x] != labels[0] and labels[x] != INIT_VAL):
            wrongness_score += 1
            incorrect_labels[i] = labels[x]
            i += 1
        elif(labels[x] == labels[0]):
            correctness_score += 1
        x += 1
    print(correctness_score, " are correctly classified")
    print(wrongness_score, " are incorrectly classified")
    print("incorrect label(s): ", incorrect_labels)
    return incorrect_labels

    This method gives a correctness score to the algorithm 
    based on the similarity of the neighbors to the pivot.
    A score of 0 means there are no inaccurately classified neighbors.
    
This method gives a correctness score to the algorithm
based on the similarity of the neighbors to the pivot.
A score of 0 means there are no inaccurately classified neighbors.
This method gives a correctness score to the algorithm based on the similarity of the neighbors to the pivot . A score of 0 means there are no inaccurately classified neighbors .
def is_correct(labels):
    x = 1
    wrongness_score = 0
    correctness_score = 0
    incorrect_labels = np.full(k, INIT_VAL)
    i = 0
    for x in range (k):
        if(labels[x] != labels[0] and labels[x] != INIT_VAL):
            wrongness_score += 1
            incorrect_labels[i] = labels[x]
            i += 1
        elif(labels[x] == labels[0]):
            correctness_score += 1
        x += 1
    print(correctness_score, " are correctly classified")
    print(wrongness_score, " are incorrectly classified")
    print("incorrect label(s): ", incorrect_labels)
    return incorrect_labels
def is_correct ( labels ) : x = 1 wrongness_score = 0 correctness_score = 0 incorrect_labels = np . full ( k , INIT_VAL ) i = 0 for x in range ( k ) : if ( labels [ x ] != labels [ 0 ] and labels [ x ] != INIT_VAL ) : wrongness_score += 1 incorrect_labels [ i ] = labels [ x ] i += 1 elif ( labels [ x ] == labels [ 0 ] ) : correctness_score += 1 x += 1 print ( correctness_score , " are correctly classified" ) print ( wrongness_score , " are incorrectly classified" ) print ( "incorrect label(s): " , incorrect_labels ) return incorrect_labels
This method gives a correctness score to the algorithm
based on the similarity of the neighbors to the pivot.
This method gives a correctness score to the algorithm based on the similarity of the neighbors to the pivot .
"""
    This method gives a correctness score to the algorithm 
    based on the similarity of the neighbors to the pivot.
    A score of 0 means there are no inaccurately classified neighbors.
    """
labels