<aside> đź’ˇ
A Logistic Regression Classifier is a machine learning method used for classification problems. It predicts whether something belongs to class 0 or class 1 (for example, “negative review” vs. “positive review”). Instead of giving just a hard label, it gives a probability between 0 and 1.
</aside>
First, it calculates a score using a linear equation of the input features.
Then, it passes this score through the sigmoid (logistic) function, which converts the score into a probability.

Formula,
$$ \begin{align*}\text{Score} &= w_0 + w_1 x_1 + w_2 x_2 + \dots + w_n x_n \end{align*} $$
Here, $w_i$ are weights and $x_i$ are input features.
The score is just a weighted sum of the inputs.
Formula,
$$ \begin{align*}\text{Score} &= w_0 + w_1 x_1 + w_2 x_2 + \dots + w_n x_n \\\\P(y = 1 \mid \mathbf{x}) &= \frac{1}{1 + e^{-\text{Score}}} \\\\P(y = 1 \mid \mathbf{x}) &= \frac{1}{1 + e^{-(w_0 + w_1 x_1 + w_2 x_2 + \dots + w_n x_n)}}\end{align*} $$
This ensures the output is always between 0 and 1.
Negative score → probability close to 0. Positive score → probability close to 1.
