Shrinkage

shrinkage::CrossValidationDatafit

Shrinkage for Rust · rust · 0.3.0

pub trait CrossValidationDatafit: SmoothDatafit

A univariate datafit that can be rebuilt on a training-fold response.

Implementations preserve the family and intercept setting. They validate training responses before solver preparation and supply a compatible score.

Associated types

WithResponse

type WithResponse<'a>: CrossValidationDatafit;

Same family and settings borrowing a replacement response.

Methods

response

fn response(&self) -> &[f64]

Observed response in original row order.

supports_metric

fn supports_metric(&self, metric: ValidationMetric) -> bool

Whether this family supports the requested metric.

validate_training

fn validate_training(&self) -> Result<(), FitError>

Validate a nonempty response, including degenerate training-fold policy.

Errors

Reject invalid responses or training folds without a finite null model.

validation_metric

fn validation_metric(&self) -> ValidationMetric

Default held-out metric for this family.

with_response

fn with_response<'a>(
    &self,
    response: &'a [f64]
) -> <Self as CrossValidationDatafit>::WithResponse<'a>

Rebuild the family without retaining observations from other folds.

Implementation of CrossValidationDatafit

impl CrossValidationDatafit for shrinkage::Binomial<'_>

Implementation of CrossValidationDatafit

impl CrossValidationDatafit for shrinkage::Gaussian<'_>