WRITE · TRACE · UNDERSTAND
Project: fit, select, refit and serialize a ridge workflow
Rows contain unique string id, numeric feature list x and target y.
Read lesson: Project: fit, select, refit and serialize a ridge workflow →
Your experiment
Rows contain unique string id, numeric feature list x and target y. Require three nonempty identity-disjoint finite rectangular partitions and positive finite penalties. For each penalty, fit population means/stds and centered-target ridge only on train; constant-feature scale is one. Select minimum validation MSE, smaller penalty on an exact tie. Refit preprocessing and ridge on train+validation, then evaluate test once. Return alpha, validation_mse, test_mse, predictions, fit_ids and a JSON-compatible artifact with means, scales, coefficients and unpenalized intercept. Solve (Z.T@Z+alpha*I)w=Z.T@(y-mean_y).
Python runs in your browser. Your draft stays on this device.
What to look for
Review every fitted statistic's provenance. Reproduce predictions after JSON serialization, test constant columns, poison held-out labels and explain how dataset/schema versions would enter a real artifact registry. 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.
