podqast
Machine Learning GuideOCDevelAll episodes

MLG 014 Shallow Algos 3

48 min
Next episodeMLG 015 Performance41 min
Get its new episodes on Latest. No account

Anomaly detection, recommender systems and Markov chains end the shallow learning series: anomaly detection flags outliers on a bell curve, recommenders predict ratings, and Markov chains model state transitions. Also covers content vs collaborative filtering, and Monte Carlo simulation vs MCMC.
Links • Notes and resources at ocdevel.com/mlg/14

What is anomaly detection? Finding the rare example that doesn't fit, such as a fraudulent credit card charge or a misbehaving server: fit a bell curve to normal behavior and flag whatever lands far out in its tails.
The normal distribution (bell curve) Also called the Gaussian distribution. Its mean sets the center and its standard deviation the width. Not all data is normal: house prices are right-skewed, so a log-normal fits them better.
How the anomaly detection algorithm works • Fit a Gaussian to training data that is almost all normal examples.

Content filtering vs collaborative filtering Both predict a user's rating of an item, as linear regression predicts a house price (MLG 005).

Production recommenders blend both, now mostly with deep learning.
Recommender systems vs market basket analysis A recommender suggests a substitute: you liked a Hershey bar, try a Kit Kat. Market basket analysis (Apriori, MLG 012) suggests a complement: marshmallows and graham crackers go with chocolate.
What is a Markov chain? A probabilistic model of a process: states joined by arrows, each carrying a transition probability. Under the Markov property the next state depends only on the current one, because the current state (a player's level, position and velocity) sums up whatever in the past still matters. Arrows can loop back, so a chain is a graph, not a tree. It is stored as a transition matrix, with probabilities counted from observed transitions.
A restaurant, from The Great Courses' Mathematical Decision Making (Lecture 21):
enter → wait for a table (50% stay, 50% get seated) → decide → order → wait for food → …
The likelier a state loops back to itself, the longer people wait there: a bottleneck.
A Markov chain is a model, not a learning algorithm. Reinforcement learning (MLG 029) builds on Markov decision processes, which add actions and rewards.
Monte Carlo simulation vs MCMC When a question about a chain, like a player's expected final score, is too complex for a formula, run the process many times, picking each next state at random by its probabilities, and average the outcomes. That is Monte Carlo simulation.
Markov chain Monte Carlo (MCMC) samples from a distribution too hard to sample directly, by running a Markov chain whose long-run distribution is that target. Metropolis–Hastings is the classic algorithm.
Where to learn anomaly detection and recommenders Course 3 of Andrew Ng's [Machine Learning Specialization](https://ocdevel.com/mlg/resources#mlg_andr

Also about food and drink
Every episode about Food & drink
More from Machine Learning Guide