Skip to main content

online_evaluate

Function online_evaluate 

Source
pub fn online_evaluate(
    learner: &mut dyn OnlineLearner,
    data: &[(Vec<f64>, f64)],
    train: bool,
) -> Result<(Vec<f64>, OnlineStats), OnlineError>
Expand description

Evaluate an online learner sequentially on a dataset.

When train = true, each sample is used to update the model (prequential evaluation: predict first, then learn). When train = false, only predictions are made and the model is not updated.

Returns (predictions, stats) where predictions[i] is the prediction made before any update on sample i.