Building hybrid recommenders in Neo4j: Jaccard, FastRP, and kNN
With only 20% rating density and almost no low scores, collaborative filtering alone collapses. Enriching the graph with Genre and Director nodes is what makes hybrid scoring work.

Arnold Muzarurwi
Data Analyst candidate
Why one approach isn't enough
Collaborative filtering asks what similar users liked. Content-based filtering asks what similar items share. Each fails exactly where the other succeeds — especially on a graph that is only 20% dense.
I built a hybrid Neo4j recommender on 20 users, 25 movies, and 100 ratings, then made the sparsity problem worse by discovering that 94% of ratings were 4–5 stars. With almost no negative signal, collaborative filtering loses the ability to distinguish genuine preference from lukewarm acceptance.
Enrichment is the real unlock
The raw import is a bipartite User–Movie graph. That is not enough for hybrid scoring. I extracted Genre and Director entities into first-class nodes with IN_GENRE and DIRECTED_BY relationships.
Once those nodes exist, FastRP embeddings can propagate preference through structural paths that pure co-rating overlap cannot reach. That is especially valuable for cold-start users who have few ratings but clear genre/director affinities.
Three signals, one score
- Jaccard similarity for collaborative taste overlap
- FastRP + kNN cosine for structural and content similarity
- Genre/director bonuses for explicit content relevance
Louvain communities on the user similarity graph aligned with intuitive genre taste clusters — confirming the enriched graph captured meaningful preference structure, not just noise.
Evaluation (and its limits)
On a directional hold-out test, both held-out films landed in the top 10 (Precision@10 = 1.0). That demonstrates the hybrid system can recover held-out items — it does not establish statistical reliability. A production evaluation needs k-fold CV with precision@k, recall@k, and NDCG across all users.
Cutoff sensitivity also mattered: in a sparse graph, a Jaccard threshold of 0.5 isolates users. Lower cutoffs preserve scarce collaborative signal.
What I would do next
Per-user rating normalization, temporal decay, MovieLens-scale validation, and framing recommendation as GDS link prediction. The architecture holds; the evaluation needs to grow up.
Want to discuss this work? Get in touch.
