VANDEPOELE Enzo
3 years ago
1 changed files with 13 additions and 19 deletions
@ -1,19 +1,13 @@ |
|||
# -*- coding: utf-8 -*- |
|||
""" |
|||
Éditeur de Spyder |
|||
|
|||
Ceci est un script temporaire. |
|||
""" |
|||
def kPlusProches(k,donnees_point,temp_jour): |
|||
"""erreur""" |
|||
voisins = [] |
|||
if k > len(temp_jour[0]): |
|||
k = len(temp_jour[0]) |
|||
energy = temp_jour.pop() |
|||
energy.sort |
|||
for i in range(len(temp_jour[0])): |
|||
d = distance(temp_jour[i],donnees_point) |
|||
voisins.append((d, i)) |
|||
voisins.sort() |
|||
return [voisins[i][1] for i in range(k)] |
|||
|
|||
def kPlusProches(k,donnees_point,temp_jour): |
|||
"""erreur""" |
|||
voisins = [] |
|||
if k > len(temp_jour[0]): |
|||
k = len(temp_jour[0]) |
|||
energy = temp_jour.pop() |
|||
energy.sort |
|||
for i in range(len(temp_jour[0])): |
|||
d = distance(temp_jour[i],donnees_point) |
|||
voisins.append((d, i)) |
|||
voisins.sort() |
|||
return [voisins[i][1] for i in range(k)] |
|||
|
|||
|
Loading…
Reference in new issue