Tutorials › Statistical Learning (Graduate) › Regularized Empirical Risk in an RKHS

RKHS and Representer Theory · Tutorial 708 of 989

Regularized Empirical Risk in an RKHS

Learn to define regularized empirical risk in an RKHS and establish practical sufficient conditions for a minimizer to exist and be unique.

Intermediate 10 min read

What You'll Learn

  • Write empirical loss as a function of finitely many observed predictions and responses.
  • State how the RKHS penalty controls the size of a candidate function.
  • Prove existence under lower semicontinuity and a lower bound on each loss.
  • Identify convexity conditions that make the minimizer unique.
  • Work through penalized objectives and recognize when a minimum can fail to exist.

Why Penalize Empirical Risk?

In supervised learning, a function \(f\) is assessed by how well its predictions match the responses observed at the training inputs. An empirical loss depends only on those finitely many predictions. By itself, it may not distinguish between functions that agree on the training data but behave very differently elsewhere. A squared RKHS norm penalty adds a preference for functions with smaller norm.

The penalty serves a mathematical purpose as well as a modeling one: when the loss is lower bounded, it prevents a sequence of candidate functions from having unbounded RKHS norm while keeping the objective small. That control makes it possible to prove that a minimizer exists. The assumptions on the loss matter; merely writing down a penalty does not guarantee that every objective has a minimizer.

Definition of Regularized Empirical Risk

Let \(\mathcal H\) be a real RKHS of functions on an input set \(\mathcal X\), with reproducing kernel \(k\). The observed data are \((x_i,y_i)\), \(i=1,\ldots,n\), where \(x_i\in\mathcal X\) and \(y_i\in\mathcal Y\). For each observed response, let \(\phi_i:\mathbb R\to(-\infty,\infty]\) be a loss as a function of the prediction. For example, a common loss \(L(t,y)\) gives \(\phi_i(t)=L(t,y_i)\).

Definition: For a regularization parameter \(\lambda>0\), the regularized empirical risk is $$ J_\lambda(f)=\frac{1}{n}\sum_{i=1}^n \phi_i\bigl(f(x_i)\bigr)+\frac{\lambda}{2}\|f\|_{\mathcal H}^2,\qquad f\in\mathcal H. $$ A minimizer is a function \(f^\star\in\mathcal H\) satisfying \(J_\lambda(f^\star)=\inf_{f\in\mathcal H}J_\lambda(f).

This definition separates the two parts of the objective. The empirical term uses only the \(n\) scalar values \(f(x_1),\ldots,f(x_n)\); it does not directly use all the other values of \(f\). The penalty uses the RKHS norm. By the reproducing property, \(f(x)=\langle f,k(\cdot,x)\rangle_{\mathcal H}\), so each evaluation is a continuous linear functional and satisfies \[ |f(x)|\leq \|f\|_{\mathcal H}\sqrt{k(x,x)}. \] Thus finite evaluations are well-defined and controlled by the norm.

The normalization \(1/n\) and the factor \(1/2\) are conventions, not requirements. Changing either changes the numerical scale of \(\lambda\). Here, \(\lambda\) is strictly positive: with \(\lambda=0\), the norm control used in the existence result below is absent.

Worked Objectives

Worked Example: A Penalized Constant Function

Take \(\mathcal X\) to be a single point and \(\mathcal H\) to be the one-dimensional space of constant functions \(f_c(x)=c\), with \(\|f_c\|_{\mathcal H}^2=c^2\). Observe responses \(y_1=0\) and \(y_2=2\), use \(\phi_i(t)=\tfrac12(t-y_i)^2\), and set \(\lambda=1\). Then

$$ J(f_c)=\frac14\bigl((c-0)^2+(c-2)^2\bigr)+\frac12c^2. $$

Expanding the two squared residuals gives

$$ J(f_c)=\frac14(2c^2-4c+4)+\frac12c^2 =c^2-c+1. $$

The derivative with respect to \(c\) is \(2c-1\), so the unique minimizer is \(c=\tfrac12\). Substitution into the original objective verifies its value:

$$ J(f_{1/2})=\frac14\left(\frac14+\frac94\right)+\frac12\left(\frac14\right) =\frac{10}{16}+\frac{2}{16}=\frac34. $$

Without the penalty, the empirical loss is minimized at the average response \(c=1\). With this penalty, the fitted constant is pulled toward zero and equals \(\tfrac12\).

Worked Example: A Linear RKHS with Two Observations

Let \(\mathcal X=\mathbb R\), and let \(\mathcal H\) consist of functions \(f_w(x)=wx\) with \(\|f_w\|_{\mathcal H}^2=w^2\). This is the RKHS for the linear kernel \(k(x,z)=xz\). Use data \((x_1,y_1)=(1,1)\) and \((x_2,y_2)=(2,0)\), squared losses \(\phi_i(t)=\tfrac12(t-y_i)^2\), and \(\lambda=1\). The objective is

$$ J(f_w)=\frac14\bigl((w-1)^2+(2w)^2\bigr)+\frac12w^2. $$

Expanding and combining terms,

$$ J(f_w)=\frac14(5w^2-2w+1)+\frac12w^2 =\frac74w^2-\frac12w+\frac14. $$

Its derivative is \(\tfrac72w-\tfrac12\), which vanishes at \(w=\tfrac17\). The coefficient of \(w^2\) is positive, so this is the unique minimum. Direct substitution gives

$$ J(f_{1/7})=\frac{7}{4}\frac{1}{49}-\frac{1}{14}+\frac14 =\frac{1}{28}-\frac{2}{28}+\frac{7}{28} =\frac{3}{14}. $$

The example shows that the empirical term uses only the two predictions, \(w\) and \(2w\), while the penalty is determined by the RKHS norm \(w^2\).

Existence of a Minimizer

Here is a useful sufficient condition. It does not require convex losses. Lower semicontinuity prevents an objective value from dropping suddenly at a limit, and a lower bound on each loss ensures that the penalty controls any sequence whose objective approaches its infimum.

Theorem: Suppose \(\mathcal H\) is a real RKHS, \(\lambda>0\), and each \(\phi_i:\mathbb R\to(-\infty,\infty]\) is lower semicontinuous and bounded below. Suppose also that \(\phi_i(0)<\infty\) for every \(i\). Then \(J_\lambda\) has a minimizer in \(\mathcal H\).

Proof. Since \(\phi_i(0)<\infty\), the zero function has finite objective, so the infimum \(m=\inf_{f\in\mathcal H}J_\lambda(f)\) is at most \(J_\lambda(0)<\infty\). Let \(m_i\) be a finite lower bound for \(\phi_i\). The penalty is nonnegative, so

$$ J_\lambda(f)\geq \frac1n\sum_{i=1}^n m_i+\frac{\lambda}{2}\|f\|_{\mathcal H}^2. $$

Choose a minimizing sequence \((f_j)\) with \(J_\lambda(f_j)\to m\). Its objective values are bounded above, and the displayed inequality, together with \(\lambda>0\), implies that \((f_j)\) is bounded in \(\mathcal H\). A bounded sequence in a Hilbert space has a weakly convergent subsequence; write that subsequence as \(f_{j_r}\rightharpoonup f\).

For each observed input \(x_i\), evaluation \(g\mapsto g(x_i)=\langle g,k(\cdot,x_i)\rangle_{\mathcal H}\) is a bounded linear functional. Therefore \(f_{j_r}(x_i)\to f(x_i)\). Lower semicontinuity of \(\phi_i\) gives \[ \phi_i(f(x_i))\leq \liminf_{r\to\infty}\phi_i(f_{j_r}(x_i)). \] The squared Hilbert norm is weakly lower semicontinuous. Since there are finitely many loss terms, their sum and the penalty together are weakly lower semicontinuous, and hence \[ J_\lambda(f)\leq \liminf_{r\to\infty}J_\lambda(f_{j_r})=m. \] The definition of \(m\) also gives \(J_\lambda(f)\geq m\). Thus \(J_\lambda(f)=m\), as required. \(\square\)

The theorem gives sufficient conditions, not necessary ones. For example, the loss may take the value \(+\infty\) at some predictions, provided the stated lower semicontinuity, lower bound, and finite value at zero hold.

When Is the Minimizer Unique?

Convexity of the losses supplies a simple uniqueness guarantee. Convexity means \(\phi_i((1-t)a+tb)\leq (1-t)\phi_i(a)+t\phi_i(b)\) for \(a,b\in\mathbb R\) and \(0<t<1\). The norm penalty is strictly convex, so it distinguishes any two different functions, even if they give identical predictions at the observed inputs.

Theorem: If every \(\phi_i\) is convex and \(\lambda>0\), then \(J_\lambda\) is strictly convex on \(\mathcal H\). Consequently, if a minimizer exists, it is unique.

Proof. Let \(f,g\in\mathcal H\) be distinct and \(0<t<1\). Convexity of each loss and linearity of evaluation imply that the empirical term at \((1-t)f+tg\) is no greater than the corresponding weighted average of its values at \(f\) and \(g\). For the penalty, the Hilbert-space identity

$$ \|(1-t)f+tg\|_{\mathcal H}^2 =(1-t)\|f\|_{\mathcal H}^2+t\|g\|_{\mathcal H}^2-t(1-t)\|f-g\|_{\mathcal H}^2 $$

shows a strict reduction, because \(f\ne g\) and \(\lambda t(1-t)>0\). Combining the two inequalities yields

$$ J_\lambda((1-t)f+tg)<(1-t)J_\lambda(f)+tJ_\lambda(g). $$

Thus \(J_\lambda\) is strictly convex. If two distinct functions both minimized it, their strict convex combination would have a smaller objective, a contradiction. \(\square\)

Worked Example: A Nonconvex Loss Can Still Have a Minimum

Consider the one-dimensional constant-function RKHS \(\mathcal H=\{f_c:f_c(x)=c\}\), with norm squared \(c^2\), one observation, and response-fixed loss \(\phi(t)=(t^2-1)^2\). With \(\lambda=1\),

$$ J(f_c)=(c^2-1)^2+\frac12c^2 =c^4-\frac32c^2+1. $$

This loss is not convex on all of \(\mathbb R\), but it is continuous and bounded below, and \(\phi(0)=1\). The existence theorem therefore applies. To locate the minima directly, differentiate:

$$ \frac{d}{dc}J(f_c)=4c^3-3c=c(4c^2-3). $$

The critical points are \(c=0\) and \(c=\pm\sqrt{3}/2\). The quartic tends to \(+\infty\) as \(|c|\to\infty\), so its global minimum must occur at a critical point. Evaluating,

$$ J(f_0)=1,\qquad J(f_{\pm\sqrt{3}/2})=\frac{9}{16}-\frac{18}{16}+\frac{16}{16}=\frac{7}{16}. $$

The two values \(c=\pm\sqrt{3}/2\) are therefore global minimizers. This also shows why convexity is a sufficient condition for uniqueness, not a requirement for existence.

Common Pitfall: A Penalty Alone Does Not Ensure Existence

A frequent mistake is to assume that adding a positive squared-norm penalty guarantees a minimum for any loss. Consider again the constant-function RKHS, but now use the continuous loss \(\phi(t)=-t^4\). For any \(\lambda>0\),

$$ J_\lambda(f_c)=-c^4+\frac{\lambda}{2}c^2\longrightarrow-\infty \quad\text{as }|c|\longrightarrow\infty. $$

There is no minimizer: the objective is unbounded below. The correction is to check the loss assumptions rather than infer existence from the penalty alone. A lower bound on each loss is a convenient sufficient condition for the coercive control in the theorem. In applications, the loss and its domain should be checked explicitly.

Regularized empirical risk is a useful foundation for kernel learning because it states the fitting criterion at the observed inputs while controlling function size in the chosen RKHS. The existence and uniqueness arguments depend on distinct properties: lower semicontinuity and a lower bound support existence, while convexity combined with the squared norm penalty gives uniqueness. Neither conclusion should be assumed without its hypotheses.

Check Your Understanding

Answer each question by referring to the objective and the assumptions used above.

  1. Why must the loss be defined as a function of the prediction after fixing the response, or as a function of both prediction and response?
  2. Which part of the existence proof bounds the norm of a minimizing sequence, and why is \(\lambda>0\) needed?
  3. Why does lower semicontinuity of each \(\phi_i\) apply along a weakly convergent sequence in \(\mathcal H\)?
  4. Does the existence theorem require convex losses? Give the condition in the worked nonconvex example that still ensures existence.
  5. Explain why convex losses and a positive squared-norm penalty imply at most one minimizer.
  6. For the loss \(\phi(t)=-t^4\) in the constant-function RKHS, what happens to the objective as \(|c|\) grows, and which sufficient condition fails?
Clinical Biostats