Neural
Collaborative
Filtering
(NCF)
LECTURE ON RECOMMENDER SYSTEMS USING DEEP LEARNING
PREPARED BY DR DAVID F. RAKOTOMANANJARA
Introduction to
Collaborative Filtering
- Collaborative Filtering is a method of making
recommendations based on user-item
interactions.
- Two main types:
• User-User Collaborative Filtering
• Item-Item Collaborative Filtering
- Limitation: Struggles with sparse data and
cold-start problems.
What is Neural
Collaborative Filtering?
- NCF is a deep learning-based approach for
collaborative filtering.
- Combines neural networks with latent features
to model user-item interactions.
- Learns complex non-linear patterns for better
recommendations.
Latent Features and
Embeddings
- Latent Features: Hidden patterns representing
user preferences and item properties.
- Embeddings: Dense vector representations of
users and items.
- Captures semantic similarities and
interactions.
NCF Architecture
Overview
- Input Layer: User and Item IDs
- Embedding Layers: Convert IDs into dense
vectors
- Concatenation Layer: Combines user and item
embeddings
- Hidden Layers: Captures non-linear
interactions
- Output Layer: Predicts interaction probability
(e.g., click or purchase)
NCF Architecture
Overview
Mathematical
Formulation
- User embedding: \( E_u \) and Item
embedding: \( E_i \)
- Interaction: \( x = [E_u, E_i] \)
- Hidden Layers: \( h = ReLU(Wx + b) \)
- Output Layer: \( \hat{y} = Sigmoid(h) \)
Model Training and
Evaluation
- Loss Function: Binary Cross-Entropy for implicit
feedback
- Optimizer: Adam or SGD
- Evaluation Metrics:
• Accuracy
• Precision, Recall, F1-Score
• AUC (Area Under the Curve)
Example using
MovieLens Dataset
- MovieLens 100K dataset:
• 100,000 ratings from 1,000 users on 1,700
movies.
- Convert ratings to implicit feedback (e.g., 1 if
rating >= 4, else 0)
- Train NCF model using PyTorch or TensorFlow.
Advantages and
Limitations
- Advantages:
• Captures non-linear interactions
• Learns complex latent features
- Limitations:
• Requires large datasets and high
computational power
• Can be prone to overfitting.
Applications and Use
Cases
- E-commerce Recommendations (Amazon,
Alibaba)
- Movie Recommendations (Netflix, Hulu)
- Music Recommendations (Spotify, Apple
Music)
- Personalized News Feed and Ads
Conclusion and Q&A
- Neural Collaborative Filtering is a powerful
deep learning approach for recommendations.
- It overcomes the limitations of traditional
collaborative filtering.
- Questions and Discussion.