Logistic regression needed a way to turn any raw score, positive or negative, huge or tiny, into a valid probability between 0 and 1. That job belongs to a single, elegant function: the sigmoid function.