Missing Data Imputation and Recommender Systems

Context: FIT2086_MOC · W11 · unsupervised learning used to fill holes in a data matrix · reuses k-Nearest Neighbours with no target column · multivariate route via the Multivariate Normal Distribution and Mixture Models (EM Algorithm) · FIT1043’s wrangling view of the same problem ➔ Data Quality Problems Parent Framework: Machine Learning Styles (Supervised vs Unsupervised)

Quick Revision

  • 🎯 Objective: a matrix (rows = individuals, columns = attributes) with unmeasured entries ➔ estimate each missing entry from relationships between observed attributes ➔ a complete matrix for supervised learning, or predicted ratings to recommend from.
  • 📦 Core Components: univariate ➔ column mean/median/mode | multivariate normal ➔ correlations, one cluster | mixture ➔ several clusters | kNN / collaborative filtering ➔ copy from the most similar rows.
  • ⚡ Key Constraint: in kNN imputation the distance uses only columns both rows observed — a row sharing no observed column with the target cannot be compared at all.

📝 How It Works

1. Two Applications

  • Imputation for supervised learning ➔ many methods need complete predictor values; filling the gaps lets the whole matrix be used (Pima: of exposure cells missing, insulin ).
  • Recommender systems ➔ rows = people, columns = products, entries = ratings or purchases; nearly every cell is missing ➔ estimate the missing ratings and recommend the highest (Netflix challenge).

2. Univariate Imputation

  • Rule ➔ fit a model per column ➔ replace its missing entries with a statistic: mean/median (numeric), mode (categorical).
  • Trade-off ➔ very fast, but ignores relationships between variables — a tall person’s missing weight gets the population average.

3. Multivariate Normal Imputation

  • Rule ➔ model the columns jointly with correlations ➔ estimate a missing entry from the correlated observed entries in its row.
  • Limit ➔ assumes the data form one single cluster; mixture modelling extends it to several.

4. kNN Imputation (Collaborative Filtering)

  • Distance on co-observed columns ➔ — missing values are ignored.
  • Per column ➔ for , predict each missing from the nearest rows that did observe column , using all other columns as explanatory variables ➔ the kNN vote/average of k-Nearest Neighbours.
  • Tuning ➔ choose by Cross-Validation.
  • Assumption ➔ individuals similar on observed attributes are similar on the missing one — very weak, no distribution.

⚖️ Core Decision Matrix

MethodUses relationships?AssumptionCostReach for it when
Univariate (mean/median/mode)nonone beyond the columnvery fastfew gaps, or a quick baseline
Multivariate normalyes, linear correlationsone Gaussian clusterestimate numeric columns, roughly elliptical data
Mixture modelyes, per clusterdata form several clustersEM + choose distinct sub-populations (Pima)
kNNyes, by similaritysimilar rows ⟹ similar valuesdistances at prediction timeratings matrices, mixed or non-linear structure

When It Flips: once the columns are correlated, univariate imputation throws information away; once the data split into clusters, one multivariate normal averages across them — move down the table as structure grows.

📊 Exam Execution Trace & Applied Exercises

Manual Execution Trace

Lecture Netflix example, — fill User 3’s Love Actually (– = unrated).

UserTerminatorLove ActuallyAliensPredatorBridesmaids
1
2
3?––
4––––
StepCandidateCo-observed with User 3DistanceVerdict
1User 1Terminator, Aliens—
2User 2Terminator, Aliensnearest
3User 4noneundefinedcannot compare
4copyUser 2’s Love Actually—? ➔

Applied Exercise

Problem: same table, . Impute User 4’s Terminator.

Final Extracted Output: User 4’s Terminator — a single shared rating decides everything, which is why is tuned and more overlap gives better imputations.

⚠️ Common Mistakes

  • 💡 Counting a missing cell as in the distance ➔ treats “unrated” as “rated zero”; drop the column from the comparison instead.
  • 💡 Using a neighbour that also lacks the target column ➔ it has nothing to copy; only rows that observed column are candidates.
  • 💡 Mean imputation on correlated data ➔ shrinks variance and breaks the relationships a later regression needs.

🧠 Active Recall