STAT3009 · Final review

Classical models → neural models → side information

Ben Dai

CUHK · Department of Statistics and Data Science

Classical models: from averages to latent factors

MODEL LADDER

model prediction what it adds
Global mean \(\mu\) one number for everyone
User / item bias \(\mu+a_u\), \(\mu+b_i\) generous users; popular items
Biased MF \(\mu+a_u+b_i+p_u^\top q_i\) latent user–item interaction

The ladder adds structure, not new data.

IMPLEMENTATIONsklearn estimator

fit(X, y) → predict(X_new); learned attributes end in _.

SELECTIONGridSearchCV

param_grid, cv, scoring="neg_root_mean_squared_error", refit=True.

REPORTvalidation → test

Choose on validation, open test once, keep the split fixed.

fit
learn parameters
→
predict
score pairs
→
validate
choose model
→
test
report once

The estimator workflow stays the same even when the prediction rule changes.

Neural models: learned interaction + side information

MODEL LADDER

model interaction what it adds
MFNet \(p_u^\top q_i\) ID embeddings + biases
NCF \(\mathrm{MLP}([p_u,q_i])\) learned nonlinear interaction
Two-tower \(f_u(p_u)^\top f_i(q_i)\) separate encoders; retrieval
Side-info blocks MFNet + additive \(g_m(\cdot)\) continuous, categorical, text, image

On the Amazon demo: text was the only clear gain; continuous, categorical, and image were flat or neutral.

NETWORKPyTorch nn.Module

init defines layers; forward defines shapes and branches.

TRAININGskorch

NeuralNetRegressor: fit, predict, history; tune with module__ parameters.

TUNINGGridSearchCV

module__K, module__hidden; train_split=False, cv=KFold(…), refit=True.

build
nn.Module
→
fit
skorch
→
tune
GridSearchCV
→
ablate
one block

Neural models change the interaction; side information adds blocks. Always ablate one block at a time.