Skip to content

Fix plotting flag defaults and propagation in regression functions - #31

Merged
OVVO-Financial merged 1 commit into
mainfrom
claude/exciting-cori-nwitn6
Jun 15, 2026
Merged

Fix plotting flag defaults and propagation in regression functions#31
OVVO-Financial merged 1 commit into
mainfrom
claude/exciting-cori-nwitn6

Conversation

@OVVO-Financial

Copy link
Copy Markdown
Owner

Summary

This PR fixes the plotting behavior in regression functions to ensure consistent defaults and proper flag propagation through the function call stack. The changes ensure that composed estimators (nns_boost, nns_stack, nns_var, etc.) never open figures during fitting unless explicitly requested by the caller.

Key Changes

  • Changed nns_m_reg default: residual_plot now defaults to False instead of True, making it consistent with other plotting flags
  • Fixed flag propagation: nns_reg now explicitly passes plot and residual_plot flags to nns_m_reg on the multivariate path, ensuring caller intent is preserved
  • Removed redundant rendering: Eliminated the separate _maybe_render_reg() call in nns_reg, consolidating rendering logic
  • Updated documentation: Clarified the plotting policy to explain that all plotting flags default to False and how composed estimators inherit this behavior

Implementation Details

The key insight is that nns_reg forwards its own plotting flags down to nns_m_reg, making the caller's flags (which default to False) the single source of truth. This prevents composed estimators from inadvertently opening figures when they call nns_reg/nns_m_reg internally, even across hundreds of iterations. The multivariate core now respects the caller's explicit intent rather than having its own independent default.

https://claude.ai/code/session_01SCN3z9NTc2iBZKWX4XMWTu

nns_reg's 2-D path dispatched to nns_m_reg without forwarding the plot
flags, so nns_m_reg fell back to its own residual_plot=True default and
opened a residual matplot on every call. boost/stack/var invoke the
regression core many times during fitting, so this leaked a flurry of
background figures despite nns_reg defaulting to plot=False.

Forward plot/residual_plot from nns_reg into nns_m_reg so the caller's
flags govern, and flip nns_m_reg's residual_plot default to False so the
documented "default plot=False opens no figure" contract actually holds
for the multivariate path and any internal caller.
@OVVO-Financial
OVVO-Financial merged commit 20ad736 into main Jun 15, 2026
4 checks passed
@OVVO-Financial
OVVO-Financial deleted the claude/exciting-cori-nwitn6 branch June 15, 2026 03:09
OVVO-Financial added a commit that referenced this pull request Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants