def reccomandation(self, x):
""""""
y = np.array([[math.nan] * nombre_films()])
for key in self.films:
y[0][self.conv.renvoyer_index(key)] = self.films[key]
max_i = 0
n_max = 0
t = np.dot(x, self._theta.T)
print(t)
for i, el in enumerate(y[0]):
if np.isnan(el) and t[i, 0] > n_max:
print("film : ", self.conv.renvoyer_nom_index(i), "note :", n_max)
n_max = t[i, 0]
max_i = i
print(t)
print(self._theta)
return self.conv.renvoyer_nom_index(max_i)
评论列表
文章目录