code: def test_invalid_aggfuncs(forecasters, aggfunc):
      """Check if invalid aggregation functions return Error."""
      y = make_forecasting_problem()
      forecaster = EnsembleForecaster(
          forecasters=forecasters, aggfunc=aggfunc
      )
      forecaster.fit(y, fh=[1, 2])
      with pytest.raises(ValueError, match=r"not recognized"):
          forecaster.predict()
  
file_path: sktime/sktime/forecasting/compose/tests/test_ensemble.py
imports: import numpy
  import pandas
  import pytest
  from sktime.forecasting.compose import EnsembleForecaster
  from sktime.forecasting.compose._ensemble import VALID_AGG_FUNCS
  from sktime.forecasting.naive import NaiveForecaster
  from sktime.forecasting.trend import PolynomialTrendForecaster
  from sktime.utils._testing.forecasting import make_forecasting_problem
label_desc: Use image node_id 4 for calling a global function with example usage: test_invalid_aggfuncs(forecasters, aggfunc) without return types