From 4d27901e7dad3ea08219919ebe812d940f97d44d Mon Sep 17 00:00:00 2001 From: VANDEPOELE Enzo Date: Thu, 2 Jun 2022 09:21:28 +0200 Subject: [PATCH] =?UTF-8?q?D=C3=A9pot=20:=20Modif=20:=20KNN=5FMark2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- KNN_Mark2.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/KNN_Mark2.py b/KNN_Mark2.py index 5d5ccf4..c136b98 100644 --- a/KNN_Mark2.py +++ b/KNN_Mark2.py @@ -11,6 +11,8 @@ def lancer(k, date, temp_moy, temp_ref, donnees): print(donnees_point) print(donnees) lst_k_plus_proches = kPlusProches(k, donnees_point, donnees) + conso_moy = PuissanceMoyenne(lst_k_plus_proches) + label9.configure(text=conso_moy) def lecture(fichier): temp_jour = [] @@ -111,7 +113,7 @@ def distance(donnees, donneespoint, i): def PuissanceMoyenne(lst_k_plus_proches): """Calcule la moyenne de distances entre les points """ lecture("pic-journalier-consommation.csv") - conso_moy =0 # sum() / len(lst_k_plus_proches) + conso_moy = 10 # sum() / len(lst_k_plus_proches) return conso_moy global colour @@ -159,8 +161,7 @@ def recup4(): def calc_conso(): conso_moy = PuissanceMoyenne(lst_k_plus_proches) - Conso = conso_moy - label9.configure(text=Conso) + label9.configure(text=conso_moy) label1 = Label(fenetre, text="Choisissez le nombre de voisins (k) :", font = txt_design, bg ='#005dff', foreground="#ff5733")