Browse Source

truc

master
gabrie.chataigner 3 years ago
parent
commit
a3d1991eec
  1. 21
      KNN_Mark1.py

21
KNN_Mark1.py

@ -1,8 +1,9 @@
from tkinter import *
def lancer():
lecture("pic-journalier-consommation.csv")
kPlusProches(value1, donnees_point,temp_jour)
def lancer(date, temp_moy, temp_ref):
moyenne_liste()
donnees_point = [date, temp_moy, temp_ref]
kPlusProches(k, donnees_point,temp_num_jour)
estBissextile(an)
def lecture(fichier):
@ -84,7 +85,7 @@ def numeroJour(date):
return num_jour
def moyenne_liste():
temp_jour, = lecture("pic-journalier-consommation.csv")
temp_jour = lecture("pic-journalier-consommation.csv")
temp_num_jour = []
for i in range(365):
temp_jour[i][0] = numeroJour(temp_jour[i][0])
@ -121,25 +122,29 @@ def distance(temp_jour, donneespoint):
return dist
def PuissanceMoyenne(lst,distance):
"""Fonction qui calcule la moyenne de distances entre les points """
"""Calcule la moyenne de distances entre les points """
lecture("pic-journalier-consommation.csv")
moy = sum() / len()
def recup1():
voisins = value1.get()
label5.configure(text=voisins)
k = value1.get()
label5.configure(text=k)
return k
def recup2():
date = value2.get()
label6.configure(text=date)
return date
def recup3():
temp_moy = value3.get()
label6.configure(text=temp_moy)
return temp_moy
def recup4():
temp_ref = value4.get()
label6.configure(text=temp_ref)
return temp_ref
#def calc_conso():
# Conso =
@ -179,7 +184,7 @@ entree4.grid()
label8 = Label(fenetre, text="Conso", bg="yellow")
bouton1 = Button(canvas1, text="Tester", command=lancer(), width=15, height=2, bg="cyan").grid(pady=10)
bouton1 = Button(canvas1, text="Tester", command=lancer(date,temp_moy,temp_ref), width=15, height=2, bg="cyan").grid(pady=10)
canvas1.grid()
label8.grid(pady=10)

Loading…
Cancel
Save