pub fn fit(
x: &[f64],
y: &[f64],
n: usize,
p: usize,
fit_intercept: bool,
) -> Result<LinearModel, LearningError>Expand description
Fit OLS of y (length n) on a row-major n × p predictor matrix x.
fit_intercept prepends a constant column. Fails closed:
InvalidDimension on a shape mismatch, InsufficientData if n ≤ params,
Singular on collinear predictors.