Write a function linear regression that fits a linear regression model, and takes the following two arguments as input
1. X: A numpy array of the shape (N,d) where N is the number of data points, and d is the data dimension. Do not assume anything about N or d other than being a positive integer.
2. Y: A numpy array of the shape (N,) where N is the number of data points.
3. lam: The regularization coefficient λ, which is a scalar positive value. See the objective function below
and returns the linear regression weight vector, beta
β = [β₀ β₁ .... β₂]
which is a numpy array with a shape of (d+1,1). Your function should: