Linear Kernel Function

Instance-Based, Kernel & Probabilistic Methods DS practice problem on Onlearn.

Difficulty: easy.

Topics: Understanding Linear Kernel Function, Dot Product, Gram Matrix, Mercer's Theorem, Euclidean Space, Scalar Projection, Linear Algebra, Statistical Learning Theory, Optimization Theory, Computational Geometry, Numerical Analysis, Vector Space Operations, Kernel Methods, Distance Metrics, Inner Product Spaces, Feature Mapping.

Write a Python function kernel function that computes the linear kernel between two input vectors x1 and x2. The linear kernel is defined as the dot product (inner product) of two vectors.