Spaces:
Sleeping
Sleeping
actually recommend for proper user
Browse files
recommendation-api/recommender.py
CHANGED
@@ -7,7 +7,7 @@ def get_recommendations_for_user(learn: Learner, user_id: str, limit: int = 5):
|
|
7 |
not_listened_tracks = get_unlistened_tracks_for_user(user_id)
|
8 |
|
9 |
# Get predictions for tracks
|
10 |
-
input_dataframe = pd.DataFrame({'user_id': [
|
11 |
test_dl = learn.dls.test_dl(input_dataframe)
|
12 |
predictions = learn.get_preds(dl=test_dl)
|
13 |
|
|
|
7 |
not_listened_tracks = get_unlistened_tracks_for_user(user_id)
|
8 |
|
9 |
# Get predictions for tracks
|
10 |
+
input_dataframe = pd.DataFrame({'user_id': [user_id] * len(not_listened_tracks), 'entry': not_listened_tracks})
|
11 |
test_dl = learn.dls.test_dl(input_dataframe)
|
12 |
predictions = learn.get_preds(dl=test_dl)
|
13 |
|