pub struct FitConfig {Show 45 fields
pub family: Option<String>,
pub negative_binomial_theta: Option<f64>,
pub link: Option<String>,
pub flexible_link: bool,
pub offset_column: Option<String>,
pub noise_offset_column: Option<String>,
pub frailty: Option<FrailtySpec>,
pub baseline_target: String,
pub baseline_scale: Option<f64>,
pub baseline_shape: Option<f64>,
pub baseline_rate: Option<f64>,
pub baseline_makeham: Option<f64>,
pub time_basis: String,
pub time_degree: usize,
pub time_num_internal_knots: usize,
pub time_smooth_lambda: f64,
pub survival_likelihood: String,
pub survival_distribution: String,
pub threshold_time_k: Option<usize>,
pub threshold_time_degree: usize,
pub sigma_time_k: Option<usize>,
pub sigma_time_degree: usize,
pub noise_formula: Option<String>,
pub logslope_formula: Option<String>,
pub z_column: Option<String>,
pub weight_column: Option<String>,
pub expectile_tau: Option<f64>,
pub ctn_stage1: Option<CtnStage1Recipe>,
pub scale_dimensions: bool,
pub adaptive_regularization: Option<bool>,
pub ridge_lambda: f64,
pub transformation_normal: bool,
pub firth: bool,
pub outer_max_iter: Option<usize>,
pub outer_wall_clock_budget_secs: Option<f64>,
pub gpu_policy: GpuPolicy,
pub resource_policy: Option<ResourcePolicy>,
pub group_metadata: Option<BTreeMap<String, Value>>,
pub coefficient_groups: Vec<CoefficientGroupSpec>,
pub penalty_block_gamma_priors: Vec<(String, f64, f64)>,
pub latents: Option<Value>,
pub analytic_penalties: Option<Value>,
pub topology_auto_selector: Option<TopologyAutoSelector>,
pub smooth_overrides: Option<Value>,
pub persist_warm_start_disk: bool,
}Fields§
§family: Option<String>Family: “gaussian”, “binomial”, “poisson”, “negative-binomial”, “gamma”, “tweedie” (alias “tw”; variance power fixed at p = 1.5), or None for auto-detect.
negative_binomial_theta: Option<f64>Fixed size/overdispersion parameter for family="negative-binomial".
link: Option<String>Link: “identity”, “logit”, “probit”, “cloglog”, “sas”, “beta-logistic”, or None.
flexible_link: boolWhether to use flexible (wiggle-augmented) link.
offset_column: Option<String>Optional additive offset column for the primary linear predictor.
noise_offset_column: Option<String>Optional additive offset column for the noise/log-scale predictor.
frailty: Option<FrailtySpec>Optional family-level frailty modifier.
baseline_target: StringBaseline target: “linear”, “weibull”, “gompertz”, “gompertz-makeham”.
baseline_scale: Option<f64>§baseline_shape: Option<f64>§baseline_rate: Option<f64>§baseline_makeham: Option<f64>§time_basis: StringTime basis: “ispline” or “none”.
time_degree: usize§time_num_internal_knots: usize§time_smooth_lambda: f64§survival_likelihood: StringSurvival likelihood mode: “location-scale”, “transformation”, “weibull”, “marginal-slope”, “latent”, or “latent-binary”.
survival_distribution: StringResidual distribution: “gaussian”, “logistic”, “gumbel”.
threshold_time_k: Option<usize>§threshold_time_degree: usize§sigma_time_k: Option<usize>§sigma_time_degree: usize§noise_formula: Option<String>If set, fit a location-scale model with this formula for the noise parameter.
logslope_formula: Option<String>Formula for the log-slope model (survival marginal-slope or Bernoulli marginal-slope).
z_column: Option<String>Column name for the z (exposure/dose) variable in marginal-slope models.
weight_column: Option<String>Optional non-negative per-row training weights column.
expectile_tau: Option<f64>Expectile asymmetry τ ∈ (0, 1) for family = "expectile".
When family resolves to "expectile" the fit minimizes the
Newey–Powell asymmetric squared loss Σ wᵢ(τ)·(yᵢ − μᵢ)² with
wᵢ(τ) = τ if yᵢ > μᵢ else 1 − τ, tracing the conditional
τ-expectile — the smooth analogue of the τ-quantile. τ = 0.5
reduces exactly to the Gaussian-identity mean fit. The whole penalized
smooth + REML λ-selection machinery is reused via a Least
Asymmetrically Weighted Squares (LAWS) outer loop. None defaults to
the median expectile τ = 0.5 when the family is "expectile"; it is
ignored for every other family. The asymmetry may also be written inline
as family = "expectile(0.9)", which fills this field at resolve time.
ctn_stage1: Option<CtnStage1Recipe>Internal CTN Stage-1 provenance for the marginal-slope z column.
When the marginal-slope z was generated by a transformation-normal
Stage-1 fit, the orchestration layer fills this with the Stage-1 recipe.
Its presence is the sole auto-enable signal for cross-fitted, Neyman-
orthogonal score calibration (#461): the materializer cross-fits the CTN
to produce out-of-fold z and the score-influence Jacobian J, replaces
the raw z with z_oof, and absorbs J as a leakage-projection block in
Stage-2. This is in-process plumbing only — there is no CLI flag, env var,
or feature gate. None ⇒ raw z with the free-warp score_warp
fallback. See CtnStage1Recipe.
scale_dimensions: bool§adaptive_regularization: Option<bool>Enable exact spatial adaptive regularization for standard formula fits.
None uses the quality-first automatic policy. The current automatic
policy leaves LAREG off unless explicitly requested because the
optimizer’s REML-selected local weights can over-regularize small
high-yield spatial signals.
ridge_lambda: f64§transformation_normal: boolRoute the fit through the transformation-normal family. When set, the
formula terms are treated as the covariate side of the transformation
model and the response basis is built internally. Incompatible with
noise_formula and with Surv(...) responses.
firth: boolEnable Firth bias reduction for standard single-parameter families.
outer_max_iter: Option<usize>Optional cap on the REML/LAML outer smoothing-parameter iterations for
standard formula fits. None uses the production default.
outer_wall_clock_budget_secs: Option<f64>Optional wall-clock budget (seconds) for the outer smoothing search
(gam#979). Threaded to the survival marginal-slope fit, whose constrained
joint-Newton can fail to certify convergence and otherwise grind without
bound; with this set the fit returns its best-so-far iterate (or a
catchable error) within the budget instead of hanging. None keeps the
generous built-in default for that path and is unbounded elsewhere.
gpu_policy: GpuPolicyGPU backend selection policy. Auto uses supported device kernels for
large workloads, Off pins execution to CPU kernels, and Force fails
loudly when a requested GPU kernel has no compiled backend.
resource_policy: Option<ResourcePolicy>Optional override of the gam_runtime::resource::ResourcePolicy used when
planning spatial bases (TPS / Matern / Duchon) during term construction.
When None, the default-library policy is used.
group_metadata: Option<BTreeMap<String, Value>>Optional per-group metadata supplied by the caller. Fitting ignores this field; saved-model builders pass it through so deployment consumers can recover group provenance.
coefficient_groups: Vec<CoefficientGroupSpec>Optional user-defined coefficient groups with separate precision parameters. Group-local priors, including catalog-metadata-informed Gamma precision hyperpriors, are resolved during design setup.
penalty_block_gamma_priors: Vec<(String, f64, f64)>Optional per-existing-penalty-block Gamma(shape, rate) precision hyperpriors keyed by penalty-block label. This is the catalog-metadata-informed-prior hook for models that do not need a new user-defined coefficient group.
latents: Option<Value>Python gamfit.fit(..., latents={...}) configuration. This reaches
the standard formula workflow as an owned latent-coordinate block:
the named smooth’s synthetic covariates are rebuilt from t, and
joint REML optimizes [rho, vec(t)] through latent design hyper-dirs.
analytic_penalties: Option<Value>Python gamfit.fit(..., penalties=[...]) analytic-penalty descriptors,
validated against the declared latent-coordinate blocks before a
standard latent fit starts.
topology_auto_selector: Option<TopologyAutoSelector>Formula-path latent topology selector descriptor. The selector itself fits candidates through the ordinary workflow; this slot lets callers request and validate that path from the same config registry.
smooth_overrides: Option<Value>gamfit.fit(..., smooths={...}) Python kwarg routed through the FFI
bridge. JSON object keyed by formula symbol (single column name or
comma-joined tuple) → smooth descriptor ({"kind": "duchon", "centers": [[...], ...], ...}). Applied as a post-processing step on
the TermCollectionSpec produced by the formula DSL: each smooth
term whose feature_cols match a registry key has its kind-specific
tunables (centers, knots, kernel hyperparameters) overridden with the
user-supplied values. The single canonical lowering path guarantees
smooths={"x": Duchon(centers=K)} (integer) produces a bit-identical
block spec to writing duchon(x, centers=K) in the formula; only
explicit array-valued centers= differs, routing through
CenterStrategy::UserProvided instead of FarthestPoint/EqualMass.
persist_warm_start_disk: boolEngage the cross-process ON-DISK persistent warm-start layer (#1082).
Default false: only the always-on in-memory warm start runs, so a
single fit and throwaway/replicate/CI-coverage loops pay zero disk I/O
(no WarmStartStore dir/eviction scan, no record load/store). Set
true to engage cross-process / repeat-fit resume: the flag threads
FitConfig → FitOptions → ExternalOptimOptions down to the standard
RemlState, which then calls enable_persistent_warm_start_disk().
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for FitConfig
impl !UnwindSafe for FitConfig
impl Freeze for FitConfig
impl Send for FitConfig
impl Sync for FitConfig
impl Unpin for FitConfig
impl UnsafeUnpin for FitConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.