Skip to content

Commit ac01a09

Browse files
spec: add logistic-regression specification (#3552)
## New Specification: `logistic-regression` Related to #3550 --- ### specification.md # logistic-regression: Logistic Regression Curve Plot ## Description A logistic regression visualization showing the characteristic S-shaped (sigmoid) probability curve for binary classification. The plot displays data points colored by their binary class, the fitted logistic curve representing predicted probabilities, confidence intervals around the curve, and an optional decision threshold line. This visualization is essential for understanding how a logistic model maps continuous input features to class probabilities. ## Applications - Visualizing credit risk scoring models where the probability of default varies with income or credit score - Analyzing medical diagnostic thresholds where probability of disease changes with biomarker levels - Understanding marketing conversion rates as a function of customer engagement metrics or ad spend - Demonstrating the decision boundary in binary classification problems for educational purposes ## Data - `x` (numeric) - Continuous independent variable (predictor/feature) plotted on the horizontal axis - `y` (binary) - Binary outcome variable (0 or 1) plotted as data points - `probability` (numeric) - Predicted probability from the logistic model (0 to 1) for the fitted curve - Size: 50-500 data points recommended for clear visualization of both the curve and underlying data - Example: Binary classification data where the outcome probability follows a sigmoidal relationship with the predictor ## Notes - Data points should be jittered slightly on the y-axis (around 0 and 1) for visibility when overlapping - Use distinct colors for the two classes (e.g., blue for class 0, orange for class 1) - The logistic curve should be smooth and prominently displayed (solid line, ~2px width) - Include 95% confidence interval band around the fitted curve with semi-transparent shading - Add a horizontal dashed line at probability = 0.5 to indicate the default decision threshold - Label axes clearly: x-axis with the predictor name, y-axis as "Probability" (0 to 1) - Consider displaying model coefficients or accuracy metrics as annotations - Points should have moderate transparency (alpha ~0.6) to show density patterns --- **Next:** Add `approved` label to the issue to merge this PR. --- :robot: *[spec-create workflow](https://github.com/MarkusNeusinger/pyplots/actions/runs/20866457361)* Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent d33dde8 commit ac01a09

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# logistic-regression: Logistic Regression Curve Plot
2+
3+
## Description
4+
5+
A logistic regression visualization showing the characteristic S-shaped (sigmoid) probability curve for binary classification. The plot displays data points colored by their binary class, the fitted logistic curve representing predicted probabilities, confidence intervals around the curve, and an optional decision threshold line. This visualization is essential for understanding how a logistic model maps continuous input features to class probabilities.
6+
7+
## Applications
8+
9+
- Visualizing credit risk scoring models where the probability of default varies with income or credit score
10+
- Analyzing medical diagnostic thresholds where probability of disease changes with biomarker levels
11+
- Understanding marketing conversion rates as a function of customer engagement metrics or ad spend
12+
- Demonstrating the decision boundary in binary classification problems for educational purposes
13+
14+
## Data
15+
16+
- `x` (numeric) - Continuous independent variable (predictor/feature) plotted on the horizontal axis
17+
- `y` (binary) - Binary outcome variable (0 or 1) plotted as data points
18+
- `probability` (numeric) - Predicted probability from the logistic model (0 to 1) for the fitted curve
19+
- Size: 50-500 data points recommended for clear visualization of both the curve and underlying data
20+
- Example: Binary classification data where the outcome probability follows a sigmoidal relationship with the predictor
21+
22+
## Notes
23+
24+
- Data points should be jittered slightly on the y-axis (around 0 and 1) for visibility when overlapping
25+
- Use distinct colors for the two classes (e.g., blue for class 0, orange for class 1)
26+
- The logistic curve should be smooth and prominently displayed (solid line, ~2px width)
27+
- Include 95% confidence interval band around the fitted curve with semi-transparent shading
28+
- Add a horizontal dashed line at probability = 0.5 to indicate the default decision threshold
29+
- Label axes clearly: x-axis with the predictor name, y-axis as "Probability" (0 to 1)
30+
- Consider displaying model coefficients or accuracy metrics as annotations
31+
- Points should have moderate transparency (alpha ~0.6) to show density patterns
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Specification-level metadata for logistic-regression
2+
# Auto-synced to PostgreSQL on push to main
3+
4+
spec_id: logistic-regression
5+
title: Logistic Regression Curve Plot
6+
7+
# Specification tracking
8+
created: 2026-01-09T21:45:54Z
9+
updated: null
10+
issue: 3550
11+
suggested: MarkusNeusinger
12+
13+
# Classification tags (applies to all library implementations)
14+
# See docs/reference/tagging-system.md for detailed guidelines
15+
tags:
16+
plot_type:
17+
- scatter
18+
- line
19+
- regression
20+
data_type:
21+
- numeric
22+
- categorical
23+
- binary
24+
domain:
25+
- statistics
26+
- machine-learning
27+
- model-evaluation
28+
features:
29+
- regression
30+
- probability
31+
- confidence-interval
32+
- threshold

0 commit comments

Comments
 (0)