Skip to content
ML to LLMs
Learning path

Module 5

Instance-based and probabilistic models

Nearest neighbors, Naive Bayes, and support vector machines, three very different ideas of how to classify.

  1. 1. K-nearest neighborsPredict from the most similar stored examples, compute distances by hand, and see why feature scaling can flip a prediction.35 min
  2. 2. Naive BayesClassify with Bayes' rule by combining a class prior with per-feature likelihoods, compute a spam posterior by hand, and know when the independence assumption hurts.30 min
  3. 3. Support vector machinesFind the separating boundary with the widest margin, trade margin for errors with C, and bend the boundary with kernels.30 min

Three classic classifiers, each built on a different idea. KNN predicts from similar stored examples. Naive Bayes combines a prior with per-feature likelihoods using Bayes' rule. SVMs find the boundary with the widest margin and use kernels to bend it.

#LessonYou will be able to
1K-nearest neighborscompute distances, vote, and show why scaling matters
2Naive Bayescompute a posterior by hand and explain the independence assumption
3Support vector machinesexplain margins, support vectors, the C trade-off, and kernels

Interactive lab: K-nearest neighbors

Next moduleModule 6: Trees and ensembles