Prepare the data
Collect permissioned item interactions and split them chronologically by user.
Suggest relevant products. Leave room for discovery.
A product recommender ranks eligible catalogue items using preferences or interaction history. Availability, cold starts and popularity bias matter alongside offline ranking accuracy.
Learning concept · Not a validated service
A product recommender ranks eligible catalogue items using preferences or interaction history. Availability, cold starts and popularity bias matter alongside offline ranking accuracy.
A possible application for independent merchants: Help independent merchants suggest in-stock alternatives without hiding the full catalogue. This extension is not delivered by the supplied starter.
Collect permissioned item interactions and split them chronologically by user.
Start with user similarity and add popularity fallback, seen-item exclusion and stock filtering.
Compare recall at k, coverage and new-user behaviour against popularity-only ranking.
Provide a small opt-out recommendation widget with dismiss and reset controls.
The supplied starter creates twelve ratings from four users across five items. It fills missing ratings with zero, computes user-to-user cosine similarity and ranks unseen items using the most similar user’s ratings.
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
)
neighbor = user_similarity[target_user].drop(target_user).idxmax()
unseen_items = matrix.loc[target_user][matrix.loc[target_user] == 0].index
scores = matrix.loc[neighbor, unseen_items].sort_values(ascending=False)The source has a tiny generic rating matrix and no product catalogue or availability rules. There is no held-out ranking evaluation or cold-start fallback. Zero represents an unknown rating, not dislike, and one neighbour can leave candidate items unscored.
Proposed extension: Help independent merchants suggest in-stock alternatives without hiding the full catalogue.
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.