Vector Norms (L1/L2/Frobenius)
Vectors & Geometry DS practice problem on Onlearn.
Difficulty: medium.
Topics: Understanding Vector and Matrix Norms, Manhattan Distance, Euclidean Magnitude, Element-wise Squaring, Absolute Value Summation, Flattening Matrix Arrays, Linear Algebra, Mathematical Optimization, Vector Spaces, Numerical Computing, Multidimensional Analysis, Normed Vector Spaces, Distance Metrics, Matrix Operations, Summation Calculus, Euclidean Geometry.
Implement a class 'VectorNorms' with three methods: 'l1 norm(vector)', 'l2 norm(vector)', and 'frobenius norm(matrix)'. The L1 norm is the sum of absolute values, the L2 norm is the square root of the sum of squared values, and the Frobenius norm is the square root of the sum of absolute squares of all elements in a matrix.