Get Started

Norms and Distances

Your distance function defines what "similar" means. Choose wrong and everything downstream breaks.

90 minutesBuildPythonMembers

Learning Objectives

  • Implement L1, L2, cosine, Mahalanobis, Jaccard, and edit distance functions from scratch
  • Select the appropriate distance metric for a given ML task and explain why alternatives fail
  • Connect L1 and L2 norms to LASSO and Ridge regularization and their geometric constraint regions
  • Demonstrate how the same dataset produces different nearest neighbors under different metrics