Logistic regression is a statistical method in Machine Learning that helps to analyze the relationship between a dependent variable (target) and independent variable (predictor) by estimating the probability of occurrence of the dependent variable. It is a supervised learning method used for classification problems, where the target variable is categorical.

The primary objective of logistic regression is to predict the probability of an event occurring using a set of predictors. The predicted probability is transformed into a binary variable by setting a cut-off value above which the event can be considered to have occurred, and below which it can be considered not to have occurred.

Logistic regression is used for a wide range of applications ranging from predicting customer churn, fraud detection, spam filtering, credit scoring, and medical diagnosis, etc.

The formulation of Logistic Regression is based on the following concepts:

1. Sigmoid Function: It is a mathematical function that maps any real value to a value between 0 and 1. It is given by the formula 1 / (1 + e^-z) where z=W.T*X+b. “W” represents the weight vector, “X” represents the feature vector, “T” represents the transpose of “W,” and “b” represents the intercept term.

2. Maximum Likelihood Estimation: It is a statistical method used to estimate the parameters of a probability distribution by maximizing the likelihood function. In the case of logistic regression, the likelihood function is given by the product of conditional probabilities of each sample. The idea is to find the optimal set of weights and bias that maximize the likelihood function.

The logistic regression model can be trained using a variety of optimization algorithms like Gradient Descent, Stochastic Gradient Descent, and Newton’s method. The objective of these optimization algorithms is to minimize the cost function, which is a measure of the difference between the predicted and actual values of the target variable. The cost function used in logistic regression is the Log-Likelihood function, which is the logarithm of the likelihood function.

The logistic regression output is usually the predicted probability of the target variable being positive (in binary classification problems). A threshold value is then set to determine the classification outcome. If the predicted probability is above the threshold value, the outcome is positive (1). If it is below the threshold value, the outcome is negative (0).

In conclusion, logistic regression is a powerful statistical method used in Machine Learning for binary classification problems. It estimates the probability of occurrence of a target variable and transforms it into a binary variable by setting a threshold value. Logistic regression is widely used in real-world applications such as fraud detection, credit scoring, and spam filtering, etc.