Deep Learning Models#
Neural network models for rating prediction, ranking, and top-N recommendation.
Production models (CI-tested)#
These models live under corerec.engines.*, inherit BaseRecommender, and pass automated tests on every commit.
Model |
Import |
Tutorial |
|---|---|---|
DCN |
|
|
DeepFM |
|
|
SASRec |
|
|
TwoTower |
|
Example (triplet-based models)#
Most production deep models accept (user_ids, item_ids, ratings) triplets. Use binary (0/1) or normalized ratings for models trained with BCE loss (e.g. GNNRec).
from corerec.engines.dcn import DCN
model = DCN(embedding_dim=64, epochs=20, verbose=True)
model.fit(user_ids=user_ids, item_ids=item_ids, ratings=ratings)
score = model.predict(user_id=1, item_id=100)
recs = model.recommend(user_id=1, top_k=10)
model.save("artifacts/dcn") # safe bundle by default
SASRec and BERT4Rec use an interaction matrix instead of raw triplets — see their tutorials.
Sandbox models (experimental)#
Implementations under corerec/sandbox/. Not production-tested.
Model |
Import path |
Tutorial |
|---|---|---|
AFM |
|
|
AutoInt |
|
|
AutoFI |
|
|
BST |
|
|
BiVAE |
|
|
Caser |
|
|
DeepCrossing |
sandbox nn_base |
|
DeepRec |
|
|
DIEN |
|
|
DiFM |
sandbox nn_base |
|
DIN |
|
|
DLRM |
|
|
ENSFM |
|
|
ESCM2 |
|
|
ESMM |
|
|
FGCNN |
|
|
FFM |
|
|
FiBiNet |
|
|
FLEN |
|
|
FM |
|
|
GAN-Rec |
|
|
GateNet |
sandbox nn_base |
|
GRU-CF |
|
|
NFM |
|
|
NextItNet |
|
|
Wide&Deep |
|
|
YouTubeDNN |
sandbox content nn |
|
PNN |
sandbox nn_base |
|
MMoE |
|
|
PLE |
|
|
TDM |
|
|
DCN-Base |
|
|
DeepFM-Base |
|
Sandbox warning
Always import sandbox models from corerec.sandbox.*, not corerec.engines.*. Validate thoroughly before any production use.
When to use deep learning models#
Large interaction datasets with non-linear patterns
Rich side features (DCN, DeepFM)
Sequential behavior (SASRec, BERT4Rec)
Graph structure (GNNRec)
Multi-interest sessions (MIND)
Dual-tower retrieval at scale (TwoTower)