# Exercise scaffold. Reference implementation is in a separate directory."""G12: from-scratch binary logistic regression; no external dependencies."""importmathdefvalidate_xy(X,y):raiseNotImplementedError('Implement this contract from the book.')defsigmoid(z):raiseNotImplementedError('Implement this contract from the book.')deflogit_loss(z,y):raiseNotImplementedError('Implement this contract from the book.')defloss_gradient(w,b,X,y,lam=0.0):raiseNotImplementedError('Implement this contract from the book.')deffit(X,y,lam=0.01,rate=0.1,steps=400):raiseNotImplementedError('Implement this contract from the book.')defpredict(model,X):raiseNotImplementedError('Implement this contract from the book.')