Logistic Regression Probability Curve Visualizer
Visualize the S-shaped sigmoid curve of a logistic regression model. Set the intercept and slope parameters, define an x-range, and see how predicted probabilities change across the feature space.
Configure Your Logistic Regression Model
Set the intercept and slope parameters to visualize the S-shaped probability curve. See how different coefficients affect the predicted probabilities across your chosen x-range.
Quick Tips:
- 1.Choose a preset or enter custom model parameters
- 2.Set the x-range to focus on your region of interest
- 3.Adjust the decision threshold (default: 0.5)
- 4.View the probability curve and key model insights
Positive Slope:
- - Probability increases with x
- - Higher x = more likely positive
- - S-curve rises left to right
Negative Slope:
- - Probability decreases with x
- - Higher x = less likely positive
- - S-curve falls left to right
Understanding Logistic Regression & Probability Curves
What is Logistic Regression?
Logistic regression is a statistical model used for binary classification—predicting which of two categories an observation belongs to. Unlike linear regression that predicts continuous values, logistic regression predicts the probability that an observation belongs to the positive class.
The model uses the sigmoid (logistic) function to transform any real-valued input into a probability between 0 and 1. This makes it ideal for yes/no, spam/not-spam, purchase/no-purchase type predictions.
The Sigmoid Function
The sigmoid function maps the linear combination of inputs (called the log-odds or linear predictor) to a probability. No matter how large or small the input, the output is always squeezed between 0 and 1.
Key Properties:
- - S-shaped curve (sigmoid shape)
- - Bounded between 0 and 1
- - Steepest at the midpoint (P=0.5)
- - Asymptotically approaches 0 and 1
Key Parameters:
- - β₀ (intercept): shifts curve left/right
- - β₁ (slope): controls steepness
- - Positive β₁: increasing probability
- - Negative β₁: decreasing probability
Understanding Model Parameters
Intercept (β₀)
The intercept determines the log-odds when x = 0. A larger positive intercept shifts the curve left (higher probability at lower x values), while a negative intercept shifts it right. The midpoint (where P = 0.5) occurs at x = -β₀/β₁.
Slope (β₁)
The slope controls how quickly probability changes as x increases. A larger absolute slope means a steeper curve with a more abrupt transition between low and high probability regions. Near-zero slopes produce nearly flat curves.
Decision Threshold
The threshold (default 0.5) determines the classification cutoff. Observations with predicted probability above the threshold are classified as positive. Adjusting this threshold trades off precision vs. recall.
Practical Applications
| Domain | Example | X Variable |
|---|---|---|
| Healthcare | Disease diagnosis | Test score, age, biomarker |
| Marketing | Purchase prediction | Time on site, pages viewed |
| Finance | Loan default risk | Credit score, income ratio |
| Education | Pass/fail prediction | Study hours, prior GPA |
| E-commerce | Churn prediction | Days since last purchase |
Important Considerations
Single Feature Limitation
This visualizer shows simple logistic regression with one feature. Real-world models typically use multiple features, resulting in hyperplanes rather than simple S-curves.
Coefficient Interpretation
Coefficients represent change in log-odds per unit increase in x. To interpret in terms of odds, exponentiate: e^β₁ gives the odds ratio for a one-unit increase in x.
Threshold Selection
The 0.5 threshold is arbitrary. In practice, choose based on the costs of false positives vs. false negatives. Use ROC curves to find optimal thresholds for your specific application.
Model Assumptions
Logistic regression assumes a linear relationship between features and log-odds, independence of observations, and no perfect multicollinearity. Validate these assumptions in practice.
Frequently Asked Questions
Related Data Science Tools
Confusion Matrix Calculator
Analyze classification model performance with precision, recall, and F1 scores.
Correlation Matrix Visualizer
Upload a CSV and visualize correlations between numeric columns with a heatmap.
Feature Scaling & Normalization Helper
Apply Z-Score or Min-Max scaling to numeric features for ML preprocessing.
Dose-Response EC50 Estimator
Fit a 4-parameter logistic model to dose-response data and estimate EC50.
A/B Test Significance Calculator
Calculate statistical significance and lift for A/B test results.
Smoothing & Moving Average Calculator
Apply SMA, EMA, and WMA to time series data for trend analysis.
Explore More Data Science Tools
Build essential skills in data analysis, statistics, and machine learning concepts
Explore All Data Science & Operations Tools