Source: https://www.restore.ac.uk/srme/www/fac/soc/wie/research-new/srme/modules/mod4/module_4_-_logistic_regression.pdf