2024 IAIO Question 5.2

Show we can evaluate the classification sgn(<\mathbf{w}, \mathbf{x}>) on a test example \mathbf{x} using the values of \alpha_i and inner products between \mathbf{x} and the training data <\mathbf{x},\mathbf{x}_i>, for i = 1, \ldots, m. Hence, show how we can run the Perceptron algorithm in a feature space defined by a mapping

\phi : \mathbf{x} \longmapsto \phi(\mathbf{x})

using only the kernel function

\kappa(\mathbf{x}, \mathbf{z}) = <\phi(\mathbf{x}), \phi(\mathbf{z})>.

We have

\begin{align*} sgn \left( <\mathbf{w}, \mathbf{x} > \right) & = sgn \left( < \sum_{i=1}^m \alpha_i y_i \mathbf{x}_i , \mathbf{x} > \right) \\ & = sgn \left( \sum_{i=1}^m < \alpha_i y_i \mathbf{x}_i , \mathbf{x} > \right) \\ & = sgn \left( \sum_{i=1}^m \alpha_i y_i < \mathbf{x}_i , \mathbf{x} > \right) . \end{align*}

Analogously, for the Perceptron algorithm in the feature space, we simply replace \mathbf{x}_i and \mathbf{x} with \phi \left( \mathbf{x}_i \right) and \phi \left( \mathbf{x} \right), respectively.
Thus, we have

\begin{align*} sgn \left( <\mathbf{w}, \phi \left( \mathbf{x} \right) > \right) & = sgn \left( \sum_{i=1}^m \alpha_i y_i < \phi \left( \mathbf{x}_i \right) , \phi \left( \mathbf{x} \right) > \right) \\ & = sgn \left( \sum_{i=1}^m \alpha_i y_i \kappa \left( \mathbf{x}_i , \mathbf{x} \right) \right) . \end{align*}