code: def test_train_n_points(self):
      regr = LinearRegressionModel(lags_future_covariates=[0])
  
      # same values
      _ = RegressionEnsembleModel(self.get_local_models(), 5, regr)
  
      # too big value to perform the split
      ensemble = RegressionEnsembleModel(self.get_local_models(), 100)
      with pytest.raises(ValueError):
          ensemble.fit(self.combined)
  
      ensemble = RegressionEnsembleModel(self.get_local_models(), 50)
      with pytest.raises(ValueError):
          ensemble.fit(self.combined)
  
      # too big value considering min_train_series_length
      ensemble = RegressionEnsembleModel(self.get_local_models(), 45)
      with pytest.raises(ValueError):
          ensemble.fit(self.combined)
  
      # using regression_train_n_point=-1 without pretraining
      if TORCH_AVAILABLE:
          with pytest.raises(ValueError):
              RegressionEnsembleModel(
                  self.get_global_models(), regression_train_n_points=-1
              )
  
      # using regression_train_n_point=-1 with pretraining
      forecasting_models = [
          LinearRegressionModel(lags=1).fit(self.sine_series),
          LinearRegressionModel(lags=3).fit(self.sine_series),
      ]
      ensemble = RegressionEnsembleModel(
          forecasting_models=forecasting_models,
          regression_train_n_points=-1,
          train_forecasting_models=False,
      )
      ensemble.fit(self.combined)
  
      # 3 values are necessary to predict the first value for the 2nd forecasting model
      assert (
          ensemble.regression_model.training_series == self.combined[3:]
      )
  
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 7 for calling the TestRegressionEnsembleModels obj's underlying member method code with example usage: obj.test_train_n_points() without return types