Your question is L2-Regularized Logistic Regression Solver. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
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.
def train_logistic_regression(X, y, lam, lr, steps):