Implement logistic regression scoring without scikit-learn