pystra.active_learning.surrogates.PCESurrogate#

Use it: User guide · Worked example · Theory

class PCESurrogate(*, degree=(1, 2, 3, 4, 5), method='lars', q_norm=1.0, max_interaction=None, degree_early_stop=True, q_norm_early_stop=True, n_bootstrap=30, max_terms=10000, seed=None)[source]#

Bases: EnsembleSurrogate

Adaptive sparse Hermite PCE with bootstrap local prediction spread.

Parameters:
  • degree (int | Sequence[int]) – Candidate maximum degrees, default (1, 2, 3, 4, 5). An integer fits a single candidate degree. Sequences must be strictly increasing.

  • method (str) – ‘lars’ (default) selects sparse supports using hybrid LARS and corrected leave-one-out error; ‘ols’ fits each complete candidate.

  • q_norm (float | Sequence[float]) – Hyperbolic truncations in (0, 1], default 1. Sequences increase. A power tuple is admissible when sum(power**q) <= degree**q.

  • max_interaction (int | None) – Maximum number of variables in an interaction, default unrestricted.

  • degree_early_stop (bool) – Default True. Stop degrees after two candidates below the best score; stop q-norms after two successive nonimprovements, as in UQLab 2.2.0. Set False for exhaustive searches, e.g. isolated higher-order terms.

  • q_norm_early_stop (bool) – Default True. Stop degrees after two candidates below the best score; stop q-norms after two successive nonimprovements, as in UQLab 2.2.0. Set False for exhaustive searches, e.g. isolated higher-order terms.

  • n_bootstrap (int) – Number of pairs-bootstrap refits on the selected support, default 30.

  • max_terms (int) – Maximum candidate basis size (10000); excessive requests fail clearly.

  • seed (int | None) – Owns repeatable bootstrap resampling; no global RNG state is changed.

Notes

Adapted from UQLab 2.2.0, copyright Stefano Marelli and Bruno Sudret (ETH Zurich); see THIRD_PARTY_NOTICES. Candidate supports are selected on centered, normalized LAR paths, refitted by OLS and compared using corrected LOO. SVD replaces normal-equation inverses. The bootstrap keeps the selected sparse basis fixed (UQLab’s fast bootstrap), so it does not quantify model-selection or truncation bias. Rank-deficient bootstrap draws use minimum-norm least squares and are counted in fit_result. No Gaussian error bound is implied.

fit_result snapshots the chosen degree, q-norm, coefficients, indices and candidate diagnostics. Every fit starts a fresh adaptive search. Inputs and predictions use independent standard normal coordinates.

Methods

fit

Select degree/truncation/support, then bootstrap its OLS fit.

predict

Return full-design mean and selected-basis bootstrap spread.

predict_replicates

Return individual selected-support bootstrap responses (columns).

fit(points, values)[source]#

Select degree/truncation/support, then bootstrap its OLS fit.

Return type:

None

predict(points)[source]#

Return full-design mean and selected-basis bootstrap spread.

Return type:

tuple

predict_replicates(points)[source]#

Return individual selected-support bootstrap responses (columns).

Replicate columns refer to the same fitted coefficients across calls, enabling probability estimates on a common sample. They do not include model-selection uncertainty. Returned arrays do not alias fitted state.

Return type:

ndarray