Make binary logistic regression robust to mislabeled points by modelling each label as coming, with probability , from a fair coin instead of the classifier:
Parameterize so it stays in .
Implement fit_robust_logreg(X, y, n_iter, lr, rho0=-2.0):
X is (N, D) (include a ones column for a bias), y in .rho0, and take n_iter simultaneous steps (both gradients evaluated at the current point).(w, pi, history) with pi at the end and history the mean log-likelihood before each step (length n_iter).Derive the gradients yourself.