Skip to main content

learning_curve

Function learning_curve 

Source
pub fn learning_curve<S, F, M>(
    splitter: &S,
    x: &Array2<f64>,
    y: &Array1<f64>,
    fit_fn: F,
    scorer: &(dyn Scorer + Sync),
    train_sizes: &[TrainSize],
) -> Result<LearningCurve>
where S: CvSplitter, F: Fn(&Array2<f64>, &Array1<f64>) -> M + Sync, M: Fn(&Array2<f64>) -> Array1<f64>,
Expand description

Compute a learning curve: for each training size and each fold, fit on a prefix of the fold’s training set and score on both that prefix and the held-out validation set.

train_sizes are resolved against the smallest training set across folds (so every fold can supply every size), then clamped to 1..=min_train and sorted ascending.

With the parallel feature the size × fold grid — which can be much larger than a plain cross-validation — is fanned out over rayon.

§Errors

Propagates any error from splitter.split(x.nrows()).