Skip to main content

aggregate_regression_mean

Function aggregate_regression_mean 

Source
pub fn aggregate_regression_mean(
    per_model_predictions: &[Vec<f64>],
) -> Result<Vec<f64>, EnsembleError>
Expand description

Element-wise mean of the models’ predictions: the bagged regression forecast (AFML §6.3).

use openquant::ensemble_methods::aggregate_regression_mean;

assert_eq!(aggregate_regression_mean(&[vec![1.0, 2.0], vec![3.0, 4.0]])?, vec![2.0, 3.0]);

§Errors