Derivatives of Logistic Regression