Skip to main content

fit

Function fit 

Source
pub fn fit(
    x: &[f64],
    y: &[f64],
    n: usize,
    p: usize,
    lambda: f64,
) -> Result<RidgeModel, LearningError>
Expand description

Fit ridge regression with penalty lambda ≥ 0. lambda = 0 reproduces OLS. Fails closed on shape mismatch / n < 2.