Logistic regression is a math method used for saying “yes” or “no” things. Like, it can help tell if an email is spam or not, or if a person will buy something or not. In this, we use special numbers called “coefficients” to make predictions.
Here’s what these coefficients do:
- Coefficient Values: For every piece of information we have, there’s a special number (let’s call it “β”) that goes with it. These numbers help us guess how likely the event is. They show how things change when we change the info slightly, keeping everything else the same.
- Intercept (Bias): Besides the info numbers, we also have one more number called the “intercept” or “bias.” It’s like the starting point for our guessing. When all the info is zero, this number gives us the basic chance of the event happening.
- Log-Odds: To make a guess, we find the log-odds. It’s a way to see how likely the event is. We add up the info numbers times the actual info we have, and then we add the intercept.Log-Odds = β₀ + β₁ * x₁ + β₂ * x₂ + … + βn * xn
- Odds Ratio: We can use the odds ratio to compare how different info affects our guess. If the odds ratio is more than 1, it means the info makes the event more likely. If it’s less than 1, the event is less likely.Odds Ratio = exp(β)
- Probability: Finally, to get a proper chance of the event happening, we use a special function (sigmoid function) to change the log-odds into a number between 0 and 1.Probability (p) = 1 / (1 + e^(-Log-Odds))In all of this:
- β₀ is the starting point.
- β₁, β₂, and so on are the info numbers.
- x₁, x₂, and so on are the actual info we have.
- “e” is a special number (around 2.71828) used in math.