Search⌘ K
AI Features

Logistic Regression Predictions Using Sigmoid

Explore how logistic regression converts feature data into predicted probabilities using the sigmoid function. Learn how coefficients influence classifications and understand the linear decision boundary concept for binary prediction.

From Logistic Regression coefficients to predictions using sigmoid

Before the next exercise, let’s take a look at how the coefficients for logistic regression are used to calculate predicted probabilities, and ultimately make predictions for the class of the response variable.

Recall that logistic regression predicts the probability of class membership, according to the sigmoid equation. In the case of two features with an intercept, the equation is as follows:

p=11+e(θ0+θ1X1+θ2X2)p = \frac{1}{1+e^{-(θ_0 + θ_1X_1 + θ_2X_2)}}

When you call the fit method of a logistic regression model object in scikit-learn using the training data, the θ0θ_0, θ1θ_1 ...