What is the difference between L1 and L2 distance metrics and how does this affect k-NN performance?

Data Science with Python Hard

Data Science with Python — Hard

What is the difference between L1 and L2 distance metrics and how does this affect k-NN performance?

Key points

  • L1 sums absolute differences; L2 sums squared differences then takes the square root
  • L1 is robust to outliers and feature differences
  • L2 penalizes large differences more heavily
  • L1 is preferred for k-NN in high dimensions

Ready to go further?

Related questions