predict

Function predict 

Source
pub fn predict(x_new: &Matrix, beta0: f64, beta: &[f64]) -> Vec<f64>
Expand description

Computes predictions using unstandardized coefficients.

§Arguments

  • x_new - New data matrix (n_new × p, with intercept column if applicable)
  • beta0 - Intercept on original scale
  • beta - Slope coefficients on original scale (does NOT include intercept column coefficient)

§Returns

Predictions for each row in x_new.

§Note

If x_new has an intercept column (first column of all ones), beta should have p - 1 elements corresponding to the non-intercept columns. If x_new has no intercept column, beta should have p elements.