Gentle Introduction to Vector Norms in Machine Learning
Last Updated on August 9, 2019
Calculating the length or magnitude of vectors is often required either directly as a regularization method in machine learning, or as part of broader vector or matrix operations.
In this tutorial, you will discover the different ways to calculate vector lengths or magnitudes, called the vector norm.
After completing this tutorial, you will know:
- The L1 norm that is calculated as the sum of the absolute values of the vector.
- The L2 norm that is calculated as the square root of the sum of the squared vector values.
- The max norm that is calculated as the maximum vector values.
Kick-start your project with my new book Linear Algebra for Machine Learning, including step-by-step tutorials and the Python source code files for all examples.
Let’s get started.
- Update Mar/2018: Fixed typo in max norm equation.
- Update Sept/2018: Fixed typo related to the size of the vectors defined.