...

/

Generalized Linear Regression for Multiple Targets

Generalized Linear Regression for Multiple Targets

Learn multitarget linear regression with simple examples and code comparison (custom vs. sklearn) by comparing loss.

Multiple targets

Consider a regression dataset D={(x1,y1),(x2,y2),,(xn,yn)}D=\{(\bold x_1,\bold y_1),(\bold x_2,\bold y_2),\dots,(\bold x_n,\bold y_n)\}, where xiRd\bold x_i \in \R^d and yiRm\bold y_i \in \R^m. A function fW(x)=WTϕ(x)f_W(\bold x) = W^T\phi(\bold x) is a generalized linear model for regression for any given mapping ϕ\phi of the input features x\bold x, and WW is a matrix with mm columns, one for each target. Note that fW(x)Rmf_W(\bold x) \in \R^m.

Try this quiz to review what you’ve learned so far.

Q

In the context of the function fW(x)=WTϕ(x)f_W(\bold x) = W^T\phi(\bold x), if xRd\bold x \in \R^d, ϕ(x)Rk\phi(\bold x) \in \R^k, and WRp×mW \in \R^{p \times m}, then what is the value of pp?

A)

p=kp=k

B)

p=mp=m

The optimal parameters WW^* can be determined by minimizing a regularized squared loss as follows:

W=arg minW{i=1nWTϕ(xi)yi22+λWF2}W^*=\argmin_{W}\bigg\{\sum_{i=1}^n \|W^T\phi(\bold x_i)-\bold y_i\|_2^2 + \lambda \|W\|_F^2\bigg\}

Here, i=1nWTϕ(xi)yi22+λWF2\sum_{i=1}^n \|W^T\phi(\bold x_i)-\bold y_i\|_2^2 + \lambda \|W\|_F^2 ...