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
EnsembleError::Emptyif there are no model rows.EnsembleError::EmptyPredictionRowsif the first row is empty.EnsembleError::LengthMismatch("prediction")if the rows differ in length.