Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.