How to implement Logistic Regression from scratch with Python