code: def test_weights_for_airline_nnls():
      """Test weights."""
      y = load_airline()
      y_train, y_test = temporal_train_test_split(y)
  
      hedge_expert = NNLSEnsemble(
          n_estimators=3, loss_func=mean_squared_error
      )
  
      forecaster = OnlineEnsembleForecaster(
          [
              (
                  "av5",
                  NaiveForecaster(strategy="mean", window_length=5),
              ),
              (
                  "av10",
                  NaiveForecaster(strategy="mean", window_length=10),
              ),
              (
                  "av20",
                  NaiveForecaster(strategy="mean", window_length=20),
              ),
          ],
          ensemble_algorithm=hedge_expert,
      )
  
      forecaster.fit(y_train)
      forecaster.update_predict(y=y_test, cv=cv, reset_forecaster=False)
  
      expected = np.array([0.04720766, 0, 1.03410876])
      np.testing.assert_allclose(
          forecaster.weights, expected, atol=1e-8
      )
  
file_path: sktime/sktime/forecasting/online_learning/tests/test_online_learning.py
imports: import numpy
  import pytest
  from sklearn.metrics import mean_squared_error
  from sktime.datasets import load_airline
  from sktime.forecasting.exp_smoothing import ExponentialSmoothing
  from sktime.forecasting.naive import NaiveForecaster
  from sktime.forecasting.online_learning._online_ensemble import OnlineEnsembleForecaster
  from sktime.forecasting.online_learning._prediction_weighted_ensembler import NNLSEnsemble, NormalHedgeEnsemble
  from sktime.split import SlidingWindowSplitter, temporal_train_test_split
  from sktime.tests.test_switch import run_test_for_class
  from sktime.utils.validation._dependencies import _check_soft_dependencies
label_desc: Use image node_id 3 for calling a global function with example usage: test_weights_for_airline_nnls() without return types