Skip to content

feat(bokeh): implement pdp-basic#6849

Merged
MarkusNeusinger merged 3 commits into
mainfrom
implementation/pdp-basic/bokeh
May 15, 2026
Merged

feat(bokeh): implement pdp-basic#6849
MarkusNeusinger merged 3 commits into
mainfrom
implementation/pdp-basic/bokeh

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Implementation: pdp-basic - python/bokeh

Implements the python/bokeh version of pdp-basic.

File: plots/pdp-basic/implementations/python/bokeh.py

Parent Issue: #2922


🤖 impl-generate workflow

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 15, 2026

AI Review - Attempt 1/3

Image Description

Light render (): The plot displays a smooth partial dependence curve on a warm off-white (#FAF8F1) background. The main teal-green line (#009E73, Okabe-Ito brand color) shows the average predicted partial dependence centered at zero, with a 25% alpha confidence band above and below. A dashed gray reference line at y=0 marks the centering point. At the bottom, orange rug plot marks (#D55E00, Okabe-Ito position 2) show the distribution of training feature values. The title "pdp-basic · bokeh · anyplot.ai" and axis labels "Feature X₀ Value" (x-axis) and "Partial Dependence (centered)" (y-axis) are rendered in dark ink text (28pt title, 22pt axis labels, 18pt ticks). A legend in the bottom-right corner displays "80% CI", "Average PD", and "Data Distribution". All text is crisp and readable against the light background, with subtle grid lines providing reference without competing with data.

Dark render (): The same plot on a warm near-black (#1A1A17) background. Title and axis labels are rendered in light text (#F0EFE8 for primary, #B8B7B0 for secondary tick labels), maintaining full readability. The data colors are identical to the light render: the teal-green confidence band and line are unchanged, and the orange rug marks match exactly. Only chrome (background, text, grid lines) has adapted to the dark theme. The reference line at y=0 remains visible with light gray dashing. No dark-on-dark text failures are present—all labels are clearly legible. The legend is positioned identically with a dark background box (#242420) and light text. Both renders demonstrate perfect theme-adaptive implementation.

Score: 90/100

Category Score Max
Visual Quality 30 30
Design Excellence 12 20
Spec Compliance 15 15
Data Quality 15 15
Code Quality 10 10
Library Mastery 8 10
Total 90 100

Visual Quality (30/30)

  • VQ-01: Text Legibility (8/8) — All text explicitly sized and colored with theme tokens. 28pt title, 22pt axis labels, 18pt tick labels. Both renders pass legibility.
  • VQ-02: No Overlap (6/6) — Legend positioned cleanly; title/axis labels have adequate spacing; rug plot below main area.
  • VQ-03: Element Visibility (6/6) — Confidence band (25% alpha), 5px line width, and rug plot marks all clearly visible and distinguishable.
  • VQ-04: Color Accessibility (2/2) — Okabe-Ito brand green #009E73 and accent orange #D55E00 are CVD-safe with good contrast.
  • VQ-05: Layout & Canvas (4/4) — 4800×2700 landscape format; proper margins; no cut-off elements; generous whitespace.
  • VQ-06: Axis Labels & Title (2/2) — Title includes spec/library/site; axis labels are descriptive ("Partial Dependence (centered)" adds context).
  • VQ-07: Palette Compliance (2/2) — First series is #009E73; accent is Okabe-Ito position 2; backgrounds are correct (#FAF8F1 light, #1A1A17 dark); both renders theme-correct.

Design Excellence (12/20)

  • DE-01: Aesthetic Sophistication (5/8) — Proper theme implementation with thought-through color and styling choices (25% alpha band opacity, dashed grid at 10%). Above baseline but not exceptional.
  • DE-02: Visual Refinement (3/6) — Dashed grid with low alpha is subtle; legend has good padding and background styling; reference line at y=0 is a useful visual aid. Minimal but effective.
  • DE-03: Data Storytelling (4/6) — Good visual hierarchy: centered PDP line as focal point, confidence band adds context, rug plot reveals data distribution. Reference line frames the centering context well.

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) — Correct partial dependence plot showing marginal effect of one feature on ML predictions.
  • SC-02: Required Features (4/4) — Includes confidence interval (80% CI from percentiles), centered PDP, rug plot for data distribution, all spec requirements met.
  • SC-03: Data Mapping (3/3) — X-axis: feature values (0–2.5); Y-axis: centered partial dependence (−9 to 2); proper scaling and range.
  • SC-04: Title & Legend (3/3) — Title "pdp-basic · bokeh · anyplot.ai"; legend labels match features ("80% CI", "Average PD", "Data Distribution").

Data Quality (15/15)

  • DQ-01: Feature Coverage (6/6) — Uses real GradientBoostingRegressor with partial_dependence computation; includes ICE percentiles for bounds; 100-point grid for smooth curves.
  • DQ-02: Realistic Context (5/5) — Friedman Add workflow diagram for new prototype discovery #1 dataset (known non-linear relationship); 500 samples, 5 features, noise=0.5; realistic ML model scenario.
  • DQ-03: Appropriate Scale (4/4) — Feature range (0–2.5) sensible; centered PDP (−9 to 2) appropriate; grid resolution sufficient for smooth visualization.

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3) — Straightforward script, no unnecessary functions/classes or abstractions.
  • CQ-02: Reproducibility (2/2) — Uses np.random.seed(42) and model random_state=42 for deterministic results.
  • CQ-03: Clean Imports (2/2) — All imports are used; importlib approach avoids path shadowing; no unused code.
  • CQ-04: Code Elegance (2/2) — No fake interactivity; proper ColumnDataSource, Band, and Span usage; clean variable names.
  • CQ-05: Output & API (1/1) — Outputs plot-{THEME}.html and plot-{THEME}.png; correct file naming and current API.

Library Mastery (8/10)

  • LM-01: Idiomatic Usage (5/5) — Uses figure(), ColumnDataSource, Band, Span, and Selenium screenshot per bokeh library rules. Theme tokens properly applied throughout.
  • LM-02: Distinctive Features (3/5) — Band for confidence intervals, Span for reference line, and HTML export are solid bokeh patterns. Could explore hover tooltips or interactive callbacks for higher score.

Score Caps Applied

  • None — no caps triggered.

Strengths

  • Flawless theme-adaptive styling: identical data colors in both renders, only chrome flips between light/dark with perfect readability in both.
  • Proper partial dependence visualization with 80% confidence interval (from percentiles of ICE), centered for interpretation, and rug plot showing training data distribution.
  • Clean, reproducible code with proper ML model (GradientBoostingRegressor) and realistic data (Friedman Add workflow diagram for new prototype discovery #1).
  • Correct bokeh patterns: Band for confidence bands, Span for reference lines, ColumnDataSource for data management, Selenium for screenshot.
  • All specification requirements met: feature range, confidence bounds, centering, data distribution visualization.

Weaknesses

  • Design excellence score (12/20) reflects lack of sophisticated visual refinement beyond baseline theme implementation. Could raise score with spine removal (L-shaped frame), more refined grid styling, or visual emphasis techniques.
  • LM-02 (Distinctive Features) is 3/5 — implementation does not explore bokeh's interactive capabilities (HoverTool, callbacks, etc.) which are unique to the library.

Issues Found

None — implementation passes all quality criteria.

AI Feedback for Next Attempt

No repairs needed. Implementation is APPROVED. For future enhancements, consider exploring bokeh's interactive tooltips (HoverTool) to enable data exploration, or refining visual hierarchy through spine removal and more sophisticated grid styling.

Verdict: APPROVED

@github-actions github-actions Bot added quality:90 Quality score 90/100 ai-approved Quality OK, ready for merge labels May 15, 2026
@MarkusNeusinger MarkusNeusinger merged commit feee000 into main May 15, 2026
3 checks passed
@MarkusNeusinger MarkusNeusinger deleted the implementation/pdp-basic/bokeh branch May 15, 2026 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-approved Quality OK, ready for merge quality:90 Quality score 90/100

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant