Skip to content

Dev#11

Merged
JTyler13 merged 2 commits intomainfrom
dev
Feb 26, 2026
Merged

Dev#11
JTyler13 merged 2 commits intomainfrom
dev

Conversation

@JTyler13
Copy link
Collaborator

No description provided.

Introduce Gaussian Process (Kriging) as an alternative to polynomial mean models and wire it through the PoD pipeline and UI. Changes in src/digiqual/pod.py: implement fit_robust_mean_model to evaluate both polynomial degrees and a GaussianProcessRegressor via cross-validation, expose model_type_ and model_params_ on the returned model, and update bootstrap_pod_ci to accept model_type/model_params and handle Kriging (disable optimizer during bootstrap). Changes in src/digiqual/core.py: adjust logging/messages and pass the new model_type/model_params into bootstrap_pod_ci. Changes in app/app.py: update UI metrics to display the chosen Mean Model and Error Distribution string. Tests in tests/test_pod.py updated to reflect dynamic model selection, added a Kriging-specific bootstrap test, and adjusted assertions/fixtures accordingly. Overall this enables dynamic mean-model selection (Polynomial vs Kriging) and keeps bootstrap and UI behavior consistent with the new models.
Add targeted-sampling UI and download, introduce model-selection visualization, improve bootstrap diagnostics, and add example scripts.

Key changes:
- app/app.py: add handler for refinement button to call Study.refine(), store generated samples and provide a CSV download UI; add plot_model_selection render output and reorganize results layout.
- app/run_app.py: fix JS filename map key to match new download id ('download_new_samples').
- src/digiqual/pod.py: attach cv_scores_ to fitted mean model, remove plot_cv flag, and add plot_model_selection() to render a normalized bias-variance bar chart + MSE table.
- src/digiqual/core.py: save/show the new model_selection plot when available in SimulationStudy outputs.
- src/digiqual/diagnostics.py: revise bootstrap convergence routine (use degree-2 poly, use relative std dev / CV, average+max thresholds) and update sample_sufficiency report to include thresholds and both avg/max CV metrics.
- scripts/kriging_run.py: new example script generating non-linear (sigmoid) data and running a PoD analysis using SimulationStudy.
- scripts/make_fake_data.py: modify fake-data generators to create deliberate gap/heteroskedastic examples and adjust filenames and sizes for testing; replace normal noise with gamma noise.
- tests/test_pod.py: update imports and add a test that plot_model_selection produces a figure and that fitted model has cv_scores_.

Rationale: provide a visual model-selection tool for bias-variance tradeoff, expose refinement/downloading of newly generated targeted samples in the UI, and make bootstrap convergence checks more robust to heteroskedasticity and tail behavior. Also add example scripts for Kriging and improved synthetic data for diagnostics testing.
@JTyler13 JTyler13 merged commit 4bf00f9 into main Feb 26, 2026
3 checks passed
@JTyler13 JTyler13 deleted the dev branch February 26, 2026 09:42
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.

1 participant