Classification · Beginner

Logistic Regression

Turn a weighted score into probability and watch the decision boundary move.

Logistic Regression is a linear probabilistic classifier. ModelOrigen exposes its weighted score, sigmoid probability, log loss, gradients, regularization, threshold, and genuine boundary updates.

Step by step

  1. Compute the weighted score z.
  2. Map z to probability with the sigmoid function.
  3. Apply the class threshold.
  4. Calculate binary log loss and optional L2 penalty.
  5. Use gradients to update coefficients.
  6. Watch the new probability field and boundary.

Core formulas

Linear score

z = wᵀx + b

Features are combined into a single score before probability conversion.

Sigmoid

p = 1 / (1 + e^(−z))

Maps any real score to a probability between 0 and 1.

Binary log loss

L = −[y ln p + (1−y) ln(1−p)]

Confident wrong predictions receive a large penalty.

When to use Logistic Regression

  • Binary classification needs a clear, interpretable probability baseline.
  • A roughly linear decision boundary is reasonable.
  • You want coefficients that explain direction of feature influence.

Related interactive lessons

Primary references

scikit-learn LogisticRegression