Interview Guides

Given a feature matrix X of shape n x d, a binary label vector y of length n, a regularization strength lam, a learning rate lr, and a number of iterations steps, derive and implement batch gradient descent for L2-regularized logistic regression. Return the learned weight vector and bias after minimizing the regularized negative log-likelihood.
1 <= n <= 10^31 <= d <= 50X[i][j] is a real number with absolute value at most 10^3y[i] is either 0 or 10 <= lam <= 10^30 < lr <= 11 <= steps <= 10^5