Given X (n, d), targets y (n,) and scalar lam >= 0, return the (d+1,) coefficient vector:
X
(n, d)
y
(n,)
lam >= 0
(d+1,)
||Xw + b - y||^2 + lam * ||w||^2
Input
X = [[1.] [2.] [3.]] y = [2. 4. 6.] lam = 0.0
Output
[0. 2.]
This one's part of Premium. Unlock the full NumPy track plus every other premium problem on the site.
solve(...)