WRITE · TRACE · UNDERSTAND
Project: train logistic regression and restore the best validation checkpoint
Require nonempty identity-disjoint rectangular finite feature partitions with binary integer y, positive finite learning_rate, integer steps>=1 and finite l2>=0.
Read lesson: Project: train logistic regression and restore the best validation checkpoint →
Your experiment
Require nonempty identity-disjoint rectangular finite feature partitions with binary integer y, positive finite learning_rate, integer steps>=1 and finite l2>=0. Standardize from train population means/stds only; constant scales become one. Start weights/bias at zero. Each full-batch gradient step uses mean sigmoid error, L2 on weights only, then measures unregularized validation log loss. Keep the earliest strict best checkpoint by copying weights. Restore it for final test evaluation. Return weights,bias,means,scales,best_step,validation_loss,test_loss,predictions and validation history. Use stable logaddexp for sigmoid and loss.
Python runs in your browser. Your draft stays on this device.
What to look for
Review gradient normalization, regularization, fitted transformations and checkpoint ownership. Explain validation selection bias and preserve an independent final test population. Replay follows the main orchestration function; helper computations execute and are checked separately.
Watch your code work
Ready to experimentWrite a solution or load the worked answer, then choose Trace & check.
Step through arrays, variables and training curves produced by your own Python.
