Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions docs/plot_parity_policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,20 @@ When a ported function has an R `plot` argument, the Python function keeps its
value-only **return** contract (parity asserts only on the returned value). As a
side effect, passing `plot=True` renders a Matplotlib figure through the
`nns.plotting` layer — `nns_reg`, `nns_m_reg`, `nns_arma`, `nns_arma_optim`,
`nns_cdf`, and `nns_seas` are wired this way (plus `residual_plot=True` for the
regression functions). The figures are color/element-faithful but never
pixel-compared, and computation with the default `plot=False` opens no figure.
`nns_cdf`, and `nns_seas` are wired this way (plus an explicit
`residual_plot=True` for the regression functions). The figures are
color/element-faithful but never pixel-compared. Every plotting flag —
`plot`, `plot_regions`, and `residual_plot` on both `nns_reg` and `nns_m_reg`
— defaults to `False`, so computation opens no figure unless a flag is set
explicitly.

This matters for the composed estimators. `nns_boost`, `nns_stack`,
`nns_var`, and any other function that calls `nns_reg`/`nns_m_reg` internally
never pass a plotting flag, so they open no figures during fitting — even when
they invoke the regression core hundreds of times. `nns_reg` forwards its own
`plot`/`residual_plot` flags down to `nns_m_reg` on the multivariate path, so
the caller's flags (default `False`) are the single source of truth and the
multivariate core never plots on its own default.

## Inventory of committed graphics artifacts

Expand Down
2 changes: 1 addition & 1 deletion src/nns/multivariate_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def nns_m_reg(
point_est: NDArray[np.float64] | None = None,
point_only: bool = False,
plot: bool = False,
residual_plot: bool = True,
residual_plot: bool = False,
location: object | None = None,
noise_reduction: NoiseReduction = "off",
dist: str = "L2",
Expand Down
6 changes: 2 additions & 4 deletions src/nns/regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,8 @@ def nns_reg(
dist=dist,
confidence_interval=confidence_interval,
class_levels=class_levels,
)
_maybe_render_reg(
result, plot=plot, plot_regions=plot_regions,
residual_plot=residual_plot, point_est=point_est,
plot=plot,
residual_plot=residual_plot,
)
return result

Expand Down
Loading