pymargins.BootstrapOnlyAdapter

class pymargins.BootstrapOnlyAdapter

Base for non-parametric / algorithmic models with no meaningful Σ̂.

Covers tree ensembles, kNN, neural networks, and other algorithmic estimators. Declares only bootstrap support; the inference engine routes all requests for these models through refit-and-recompute.

Subclasses must implement refit().

__init__()

Methods

__init__()

attach(session)

Attach this adapter to a Margins session.

bootstrap_state()

Replay state for a refitted adapter.

coefficients()

Raise: bootstrap-only models have no meaningful coefficient vector.

column_index_of_variable(name)

Return the design-matrix column index corresponding to a variable.

covariance([vcov_spec])

Raise: bootstrap-only models have no meaningful covariance.

design_matrix_from_df(df)

Build a design matrix from a concrete DataFrame of evaluation rows.

predict(beta, X[, offset])

Raise: bootstrap-only models do not provide parametric predict.

refit(resampled_data, *[, index])

Refit the model on resampled data, returning a new adapter.

variable_metadata()

Return per-variable metadata used by averaging and validation.

Attributes

gradient_backend_recommendation

Not used (no delta path); declared for completeness.

n_outcomes

Number of outcome classes for multi-outcome models, default 1.

outcome_labels

Outcome class labels for multi-outcome models, or None.

supported_inference_methods

Bootstrap-only adapters declare only bootstrap support.

supports_jax_autodiff

Bootstrap-only adapters have no parametric predict; no autodiff.

training_data

The training data used to fit the model.