Skip to main content

cross_validate_regressor

Function cross_validate_regressor 

Source
pub fn cross_validate_regressor<M, F, S>(
    make: F,
    x: VR2D<'_>,
    y: VR1D<'_>,
    splits: &[Split],
    score: S,
) -> Result<Vec<f64>, ErrorsJSL>
where M: Regressor, F: Fn() -> M, S: Fn(VR1D<'_>, VR1D<'_>) -> Result<f64, ErrorsJSL>,
Expand description

Scores a regressor on each split: make builds a fresh model, which is fitted on the training rows and scored on the test rows by score(truth, predicted).