Derive logistic regression objective and gradients | Upstart