|
|
@ -37,14 +37,12 @@ def kPlusProches(k, donnees_point, temp_num_jour): |
|
|
|
une liste du jeu de données et la conso électrique. Renvoie une liste triée |
|
|
|
en fonction de la distance dont les éléments sont des tuples.""" |
|
|
|
voisins = [] |
|
|
|
if k > len(temp_num_jour[0]): |
|
|
|
k = len(temp_num_jour[0]) |
|
|
|
energy = temp_num_jour.pop() |
|
|
|
energy.sort |
|
|
|
for i in range(len(temp_num_jour[0])): |
|
|
|
if k > len(temp_num_jour): |
|
|
|
k = len(temp_num_jour) |
|
|
|
for i in range(len(temp_num_jour)): |
|
|
|
d = distance(temp_num_jour[i],donnees_point) |
|
|
|
voisins.append((d, i)) |
|
|
|
voisins.sort() |
|
|
|
voisins.sort() |
|
|
|
return [voisins[i][1] for i in range(k)] |
|
|
|
|
|
|
|
def numeroJour(date): |
|
|
@ -125,25 +123,26 @@ def distance(temp_jour, donneespoint): |
|
|
|
dist = ((x1-x2)**2)+((y1-y2)**2)+((z1-z2)**2) |
|
|
|
return dist |
|
|
|
|
|
|
|
def PuissanceMoyenne(lst,distance): |
|
|
|
def PuissanceMoyenne(lst, distance): |
|
|
|
"""Calcule la moyenne de distances entre les points """ |
|
|
|
lecture("pic-journalier-consommation.csv") |
|
|
|
moy = sum() / len() |
|
|
|
return conso |
|
|
|
|
|
|
|
def recup1(): |
|
|
|
k = value1.get() |
|
|
|
k = 5 |
|
|
|
return k |
|
|
|
|
|
|
|
def recup2(): |
|
|
|
date = '2016-08-24' |
|
|
|
date = 2016 |
|
|
|
return date |
|
|
|
|
|
|
|
def recup3(): |
|
|
|
temp_moy = value3.get() |
|
|
|
temp_moy = 34 |
|
|
|
return temp_moy |
|
|
|
|
|
|
|
def recup4(): |
|
|
|
temp_ref = value4.get() |
|
|
|
temp_ref = 41 |
|
|
|
return temp_ref |
|
|
|
|
|
|
|
#def calc_conso(): |
|
|
|