Prepare the data
Collect user–item interactions and item metadata; encode categorical features and build cross-product features for the wide part and dense embeddings for the deep part.
Wide & deep recommendations. Balance memorisation and generalisation.
Wide & deep recommendation models combine a memorisation (wide) component that handles sparse cross-features and a generalisation (deep) component that learns dense representations. Important engineering considerations include feature engineering for categorical cross-features, negative sampling, ranking metrics and online serving with fallbacks and caching.
Learning concept · Not a validated service
Wide & deep recommendation models combine a memorisation (wide) component that handles sparse cross-features and a generalisation (deep) component that learns dense representations. Important engineering considerations include feature engineering for categorical cross-features, negative sampling, ranking metrics and online serving with fallbacks and caching.
A proposed application: deliver personalised top-K item lists to users while preserving diversity and safety rules. Any deployment must keep a human reviewer or business rules in the loop for obvious safety or business-logic overrides; the supplied starter does not implement production safeguards.
Collect user–item interactions and item metadata; encode categorical features and build cross-product features for the wide part and dense embeddings for the deep part.
Start with simple baselines such as popularity and user-based collaborative filtering before adding a wide & deep architecture to compare gains.
Compute Precision@K, Recall@K and NDCG on held-out interactions, and inspect per-user coverage and popularity bias.
Define fallback logic, diversity or business-rule filters, and monitoring for data drift and latency.
The supplied starter creates a tiny ratings DataFrame, pivots it into a user–item matrix, computes cosine similarity between users, finds the most similar neighbour for a target user, and recommends that neighbour's highest-rated unseen items. It implements user-based collaborative filtering on a toy dataset; it does not implement a wide & deep neural model or feature-crossing.
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 starter uses six users/items of hand-written ratings and a user–based cosine-similarity recommender. It does not build or train any wide or deep components, does not use item metadata or cross-features, and provides no offline ranking evaluation beyond returning neighbour scores. Results from this toy data are not indicative of real performance.
A proposed extension: replace the toy table with MovieLens or retail transactions, add feature-crosses and one-hot wide features plus a small deep network for embeddings; compare against the current user-similarity baseline using NDCG@10 and Precision@10.
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.