code: def test_multiple_ts(self, mode):
      lags = 4
      lags_past_covariates = 3
      model = RegressionModel(
          lags=lags,
          lags_past_covariates=lags_past_covariates,
          multi_models=mode,
      )
  
      target_series = tg.linear_timeseries(
          start_value=0, end_value=49, length=50
      )
      past_covariates = tg.linear_timeseries(
          start_value=100, end_value=149, length=50
      )
      past_covariates = past_covariates.stack(
          tg.linear_timeseries(
              start_value=400, end_value=449, length=50
          )
      )
  
      target_train, target_test = target_series.split_after(0.7)
      (
          past_covariates_train,
          past_covariates_test,
      ) = past_covariates.split_after(0.7)
      model.fit(
          series=[target_train, target_train + 0.5],
          past_covariates=[
              past_covariates_train,
              past_covariates_train + 0.5,
          ],
      )
  
      predictions = model.predict(
          10,
          series=[target_train, target_train + 0.5],
          past_covariates=[past_covariates, past_covariates + 0.5],
      )
  
      assert (
          len(predictions[0]) == 10
      ), f"Found {len(predictions)} instead"
  
      # multiple TS, both future and past covariates, checking that both covariates lead to better results than
      # using a single one (target series = past_cov + future_cov + noise)
      np.random.seed(42)
  
      linear_ts_1 = tg.linear_timeseries(
          start_value=10, end_value=59, length=50
      )
      linear_ts_2 = tg.linear_timeseries(
          start_value=40, end_value=89, length=50
      )
  
      past_covariates = tg.sine_timeseries(length=50) * 10
      future_covariates = (
          tg.sine_timeseries(length=50, value_frequency=0.015) * 50
      )
  
      target_series_1 = (
          linear_ts_1 + 4 * past_covariates + 2 * future_covariates
      )
      target_series_2 = (
          linear_ts_2 + 4 * past_covariates + 2 * future_covariates
      )
  
      target_series_1_noise = (
          linear_ts_1
          + 4 * past_covariates
          + 2 * future_covariates
          + tg.gaussian_timeseries(std=7, length=50)
      )
  
      target_series_2_noise = (
          linear_ts_2
          + 4 * past_covariates
          + 2 * future_covariates
          + tg.gaussian_timeseries(std=7, length=50)
      )
  
      target_train_1, target_test_1 = target_series_1.split_after(0.7)
      target_train_2, target_test_2 = target_series_2.split_after(0.7)
  
      (
          target_train_1_noise,
          target_test_1_noise,
      ) = target_series_1_noise.split_after(0.7)
      (
          target_train_2_noise,
          target_test_2_noise,
      ) = target_series_2_noise.split_after(0.7)
  
      # testing improved denoise with multiple TS
  
      # test 1: with single TS, 2 covariates should be better than one
      model = RegressionModel(
          lags=3, lags_past_covariates=5, multi_models=mode
      )
      model.fit([target_train_1_noise], [past_covariates])
  
      prediction_past_only = model.predict(
          n=len(target_test_1),
          series=[target_train_1_noise, target_train_2_noise],
          past_covariates=[past_covariates] * 2,
      )
  
      model = RegressionModel(
          lags=3,
          lags_past_covariates=5,
          lags_future_covariates=(5, 0),
          multi_models=mode,
      )
      model.fit(
          [target_train_1_noise], [past_covariates], [future_covariates]
      )
      prediction_past_and_future = model.predict(
          n=len(target_test_1),
          series=[target_train_1_noise, target_train_2_noise],
          past_covariates=[past_covariates] * 2,
          future_covariates=[future_covariates] * 2,
      )
  
      error_past_only = rmse(
          [target_test_1, target_test_2],
          prediction_past_only,
          inter_reduction=np.mean,
      )
      error_both = rmse(
          [target_test_1, target_test_2],
          prediction_past_and_future,
          inter_reduction=np.mean,
      )
  
      assert error_past_only > error_both
      # test 2: with both covariates, 2 TS should learn more than one (with little noise)
      model = RegressionModel(
          lags=3,
          lags_past_covariates=5,
          lags_future_covariates=(5, 0),
          multi_models=mode,
      )
      model.fit(
          [target_train_1_noise, target_train_2_noise],
          [past_covariates] * 2,
          [future_covariates] * 2,
      )
      prediction_past_and_future_multi_ts = model.predict(
          n=len(target_test_1),
          series=[target_train_1_noise, target_train_2_noise],
          past_covariates=[past_covariates] * 2,
          future_covariates=[future_covariates] * 2,
      )
      error_both_multi_ts = rmse(
          [target_test_1, target_test_2],
          prediction_past_and_future_multi_ts,
          inter_reduction=np.mean,
      )
  
      assert error_both > error_both_multi_ts
  
imports: import copy
  import functools
  import itertools
  import math
  from unittest.mock import patch
  import numpy
  import pandas
  import pytest
  from sklearn.ensemble import HistGradientBoostingRegressor, RandomForestRegressor
  from sklearn.linear_model import LinearRegression
  import darts
  from darts import TimeSeries
  from darts.dataprocessing.encoders import FutureCyclicEncoder, PastDatetimeAttributeEncoder
  from darts.logging import get_logger
  from darts.metrics import mae, rmse
  from darts.models import CatBoostModel, LightGBMModel, LinearRegressionModel, NotImportedModule, RandomForest, RegressionModel, XGBModel
  from darts.utils import timeseries_generation
  from darts.utils.multioutput import MultiOutputRegressor
label_desc: Use image node_id 18 for calling the TestRegressionModels obj's underlying member method code with example usage: obj.test_multiple_ts(mode) without return types