DAUDET Paul
3 years ago
1 changed files with 19 additions and 0 deletions
@ -0,0 +1,19 @@ |
|||
# -*- 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)] |
|||
|
Loading…
Reference in new issue