Introduction
Logistic regression is a classification algorithm used to assign observations to a discrete set of classes. Unlike linear regression which outputs continuous
number values, logistic regression transforms its output using the logistic sigmoid function to return a probability value which can then be mapped to two or
more discrete classes.
Logistic regression is used to calculate the probability of a binary event occurring and to deal with issues of classification. For example, predicting if an
incoming email is spam or not spam, or predicting if a credit card transaction is fraudulent or not fraudulent. In a medical context, logistic regression may be
used to predict whether a tumor is benign or malignant. In marketing, it may be used to predict if a given user (or group of users) will buy a certain product
or not.…