From 78af08d735a0dd48ba15fb84cde9782d25dfe7e6 Mon Sep 17 00:00:00 2001 From: "gabrie.chataigner" Date: Mon, 30 May 2022 09:16:04 +0200 Subject: [PATCH] changement nom var --- KNN_Mark1.py | 40 +++++++++++----------------------------- 1 file changed, 11 insertions(+), 29 deletions(-) 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