def test_correct_generated_weights_exponential(self, config):
        """Tests built in weights generation for:
        - varying target series sizes
        - with and without moving window tabularization
        - different weight functions
        - datetime and integer index
        - single and multiple series
        """
        training_size, use_moving_windows, sample_weight, freq, single_series = config

        if not isinstance(freq, int):
            freq = pd.tseries.frequencies.to_offset(freq)
            start = pd.Timestamp("2000-01-01")
        else:
            start = 1

        train_y = linear_timeseries(start=start, length=training_size, freq=freq)

        _, y, _, _, weights = create_lagged_training_data(
            lags=[-4, -1],
            target_series=train_y if single_series else [train_y] * 2,
            output_chunk_length=1,
            uses_static_covariates=False,
            sample_weight=sample_weight,
            output_chunk_shift=0,
            use_moving_windows=use_moving_windows,
        )

        len_y = len(y) if single_series else int(len(y) / 2)
        if sample_weight == "linear":
            expected_weights = np.linspace(0, 1, len(train_y))[-len_y:, None, None]
        else:  # exponential decay
            time_steps = np.linspace(0, 1, len(train_y))
            expected_weights = np.exp(-10 * (1 - time_steps))[-len_y:, None, None]

        if not single_series:
            expected_weights = np.concatenate([expected_weights] * 2, axis=0)

        assert weights.shape == y.shape
        np.testing.assert_array_almost_equal(weights, expected_weights)
Tests built in weights generation for:
        - varying target series sizes
        - with and without moving window tabularization
        - different weight functions
        - datetime and integer index
        - single and multiple series
        
darts/tests/utils/tabularization/test_create_lagged_training_data.py