docstr: Training regression model of ensemble with output from historical forecasts instead of predict should
  yield better results when the forecasting models are global and regression_train_n_points >> ocl.
  
  config[0] : both ocl = 1
  config[1] : both ocl are multiple of regression_train_n_points
  config[2] : ocl1 is multiple, ocl2 is not but series is long enough to shift the historical forecats start
docstr_tok: ["Training","regression","model","of","ensemble","with","output","from","historical","forecasts","instead","of","predict","should","yield","better","results","when","the","forecasting","models","are","global","and","regression_train_n_points",">",">","ocl",".","config","[","0","]",":","both","ocl","=","1","config","[","1","]",":","both","ocl","are","multiple","of","regression_train_n_points","config","[","2","]",":","ocl1","is","multiple",",","ocl2","is","not","but","series","is","long","enough","to","shift","the","historical","forecats","start"]
code: def test_train_with_historical_forecasts_no_covs(self, config):
      """
      Training regression model of ensemble with output from historical forecasts instead of predict should
      yield better results when the forecasting models are global and regression_train_n_points >> ocl.
  
      config[0] : both ocl = 1
      config[1] : both ocl are multiple of regression_train_n_points
      config[2] : ocl1 is multiple, ocl2 is not but series is long enough to shift the historical forecats start
      """
      ocl1, ocl2 = config
      regression_train_n_points = 20
      train, val = self.combined.split_after(
          self.combined.time_index[-10]
      )
  
      # using predict to generate the future covs for the ensemble model
      ensemble_predict = RegressionEnsembleModel(
          forecasting_models=[
              LinearRegressionModel(lags=5, output_chunk_length=ocl1),
              LinearRegressionModel(lags=2, output_chunk_length=ocl2),
          ],
          regression_train_n_points=regression_train_n_points,
          train_using_historical_forecasts=False,
      )
      ensemble_predict.fit(train)
      pred_predict = ensemble_predict.predict(len(val))
  
      assert (
          len(ensemble_predict.regression_model.training_series)
          == regression_train_n_points
      )
  
      # using historical forecasts to generate the future covs for the ensemble model
      ensemble_hist_fct = RegressionEnsembleModel(
          forecasting_models=[
              LinearRegressionModel(lags=5, output_chunk_length=ocl1),
              LinearRegressionModel(lags=2, output_chunk_length=ocl2),
          ],
          regression_train_n_points=regression_train_n_points,
          train_using_historical_forecasts=True,
      )
      ensemble_hist_fct.fit(train)
      pred_hist_fct = ensemble_hist_fct.predict(len(val))
  
      assert (
          len(ensemble_hist_fct.regression_model.training_series)
          == regression_train_n_points
      )
  
      mape_hfc, mape_pred = mape(pred_hist_fct, val), mape(
          pred_predict, val
      )
      assert mape_hfc < mape_pred or mape_hfc == pytest.approx(
          mape_pred
      )
  
      rmse_hfc, rmse_pred = rmse(pred_hist_fct, val), rmse(
          pred_predict, val
      )
      assert rmse_hfc < rmse_pred or rmse_hfc == pytest.approx(
          rmse_pred
      )
  
imports: from typing import List, Union
  import numpy
  import pandas
  import pytest
  from sklearn.ensemble import RandomForestRegressor
  from sklearn.linear_model import LinearRegression
  from darts import TimeSeries
  from darts.logging import get_logger
  from darts.metrics import mape, rmse
  from darts.models import LinearRegressionModel, NaiveDrift, NaiveSeasonal, RandomForest, RegressionEnsembleModel, RegressionModel, Theta
  from darts.tests.conftest import tfm_kwargs
  from darts.tests.models.forecasting.test_ensemble_models import _make_ts
  from darts.tests.models.forecasting.test_regression_models import train_test_split
  from darts.utils import timeseries_generation
label_desc: Use image node_id 9 for calling the TestRegressionEnsembleModels obj's underlying member method code with example usage: obj.test_train_with_historical_forecasts_no_covs(config) without return types