Prepare the data
Collect user-item interactions and item metadata, then build a user-item matrix and split held-out items per user for evaluation.
Recommend for a group. Combine member preferences.
Group recommendation aims to produce item lists that reflect the collective preferences of a set of users rather than a single individual. Common challenges include preference aggregation strategies, fairness across members, diversity, and cold-start group members.
Learning concept · Not a validated service
Group recommendation aims to produce item lists that reflect the collective preferences of a set of users rather than a single individual. Common challenges include preference aggregation strategies, fairness across members, diversity, and cold-start group members.
A possible application is a family-music playlist generator that suggests songs acceptable to all listeners; a proposed extension would collect member profiles and provide a reviewable ranked list, but that is not delivered by the starter code.
Collect user-item interactions and item metadata, then build a user-item matrix and split held-out items per user for evaluation.
Start with user-based collaborative filtering: compute user similarities and aggregate neighbours' ratings to score unseen items.
Define an aggregation rule (e.g. average, least misery, weighted sum) to combine member scores into a group score and rank items.
Measure ranking metrics (Precision@K, Recall@K, NDCG) per group and inspect cases where one member dominates or options are unacceptable to any member.
The supplied starter builds a small user-item rating table from six hand-crafted triples, pivots it to a dense user-item matrix, computes cosine similarity between users, finds the most similar single neighbour for one target user, and recommends that neighbour's highest-rated unseen items. It implements a user-based nearest-neighbour recommendation for one user, not a group-aggregation method.
matrix = ratings.pivot_table(index="user", columns="item", values="rating").fillna(0)
user_similarity = pd.DataFrame(
cosine_similarity(matrix),
index=matrix.index,
columns=matrix.index,
)The code does not implement group-level aggregation: it finds a single most-similar user and recommends that neighbour's items to one target user. It uses a tiny toy dataset (six users/items) and no ranking metrics or held-out evaluation suitable for group recommendation.
Proposed extension: collect multiple member profiles per group, implement aggregation rules (average, least-misery, weighted aggregation), and expose a small review UI where group members can veto or upweight items.
This is a potential application pathway, not a delivered product. The supplied starter does not implement this service or validate it with real users.
Networkers Home runs this topic inside its AI Engineer Course, with placement support and hands-on labs.