diff --git a/KNN_Mark1.py b/KNN_Mark1.py index dde42b4..5655992 100644 --- a/KNN_Mark1.py +++ b/KNN_Mark1.py @@ -1,12 +1,12 @@ from tkinter import * -def lancer(k, date, temp_moy, temp_ref, temp_num_jour): +def lancer(k, date, temp_moy, temp_ref, donnees): moyenne_liste() donnees_point = [date, temp_moy, temp_ref] print(k) print(donnees_point) #print(temp_num_jour) - kPlusProches(k, donnees_point, temp_num_jour) + kPlusProches(k, donnees_point, donnees) #estBissextile(an) def lecture(fichier): @@ -41,28 +41,10 @@ def kPlusProches(k,donnees_point,donnees): k = len(donnees) voisin=[] for i in range(len(donnees)): - voisin.append(distance(donnees, donnees_point)) + voisin.append(distance(donnees, donnees_point, i)) voisin.sorted return [voisins[i] for i in range(k)] - - -# for j in range(k): -# voisin.append([None]) -# for i in range(len(temp_num_jour)): -# MN = distance(temp_num_jour[i],donnees_point) -# for l in range(k): -# if voisin[l][1] == None or MN