Implementing Logistic Regression from Scratch