

def main():
    f = scipy.io.loadmat('cvdataset.mat')
    traindata = f['traindata']
    trainlabels = f['trainlabels']
    testdata = f['testdata']
    evaldata = f['evaldata']
    testlabels = f['testlabels']
    distances = []
    for i in range(len(trainlabels)):
        first_train_example_class1 = traindata[i]
        aux = []
        for j in range(len(trainlabels)):
            first_train_example_class2 = traindata[j]
            d = cosineDistance(first_train_example_class1, first_train_example_class2)
            aux.append(d)
        distances.append(aux)
    print_to_file(distances)

dataset/ETHPy150Open bt3gl/Advanced-Machine-Learning/k-NN/calculate_cosine_distance.py main/original