def test_component_specific_lags(self, config):
        """Checking various combination of component-specific lags"""
        (dict_lags, multiple_series) = config
        multivar_target = "lags" in dict_lags and len(dict_lags["lags"]) > 1
        multivar_future_cov = (
            "lags_future_covariates" in dict_lags
            and len(dict_lags["lags_future_covariates"]) > 1
        )

        # create series based on the model parameters
        series = tg.gaussian_timeseries(length=20, column_name="gaussian")
        if multivar_target:
            series = series.stack(tg.sine_timeseries(length=20, column_name="sine"))

        future_cov = tg.linear_timeseries(length=30, column_name="lin_future")
        if multivar_future_cov:
            future_cov = future_cov.stack(
                tg.sine_timeseries(length=30, column_name="sine_future")
            )

        past_cov = tg.linear_timeseries(length=30, column_name="lin_past")

        if multiple_series:
            # second series have different component names
            series = [
                series,
                series.with_columns_renamed(
                    ["gaussian", "sine"][: series.width],
                    ["other", "names"][: series.width],
                )
                + 10,
            ]
            past_cov = [past_cov, past_cov]
            future_cov = [future_cov, future_cov]

        model = LinearRegressionModel(**dict_lags, output_chunk_length=4)
        model.fit(
            series=series,
            past_covariates=past_cov if model.supports_past_covariates else None,
            future_covariates=future_cov if model.supports_future_covariates else None,
        )
        # n < output_chunk_length
        model.predict(
            1,
            series=series[0] if multiple_series else None,
            past_covariates=(
                past_cov[0]
                if multiple_series and model.supports_past_covariates
                else None
            ),
            future_covariates=(
                future_cov[0]
                if multiple_series and model.supports_future_covariates
                else None
            ),
        )

        # n > output_chunk_length
        pred = model.predict(
            7,
            series=series[0] if multiple_series else None,
            past_covariates=(
                past_cov[0]
                if multiple_series and model.supports_past_covariates
                else None
            ),
            future_covariates=(
                future_cov[0]
                if multiple_series and model.supports_future_covariates
                else None
            ),
        )
        # check that lagged features are properly extracted during auto-regression
        if multivar_target:
            np.testing.assert_array_almost_equal(
                tg.sine_timeseries(length=27)[-7:].values(), pred["sine"].values()
            )
Checking various combination of component-specific lags
darts/tests/models/forecasting/test_sklearn_models.py