def predict(
        self,
        n: int,
        future_covariates: Optional[TimeSeries] = None,
        num_samples: int = 1,
        predict_likelihood_parameters: bool = False,
        verbose: bool = False,
        show_warnings: bool = True,
        random_state: Optional[int] = None,
        **kwargs,
    ) -> TimeSeries:
        """Forecasts values for `n` time steps after the end of the training series.

        If some future covariates were specified during the training, they must also be specified here.

        Parameters
        ----------
        n
            Forecast horizon - the number of time steps after the end of the series for which to produce predictions.
        future_covariates
            The time series of future-known covariates which can be fed as input to the model. It must correspond to
            the covariate time series that has been used with the :func:`fit()` method for training, and it must
            contain at least the next `n` time steps/indices after the end of the training target series.
        num_samples
            Number of times a prediction is sampled from a probabilistic model. Must be `1` for deterministic models.
        predict_likelihood_parameters
            If set to `True`, the model predicts the parameters of its `likelihood` instead of the target. Only
            supported for probabilistic models with a likelihood, `num_samples = 1` and `n<=output_chunk_length`.
            Default: ``False``.
        verbose
            Optionally, set the prediction verbosity. Not effective for all models.
        show_warnings
            Optionally, control whether warnings are shown. Not effective for all models.
        random_state
            Controls the randomness of probabilistic predictions.

        Returns
        -------
        TimeSeries, a single time series containing the `n` next points after then end of the training series.
        """
        super().predict(n, num_samples, random_state=random_state)
        if predict_likelihood_parameters:
            self._sanity_check_predict_likelihood_parameters(
                n, self.output_chunk_length, num_samples
            )

        # avoid generating encodings again if subclass has already generated them
        future_covariates = future_covariates or self.future_covariate_series
        if not self._supress_generate_predict_encoding:
            # stored future covariates already contain the encodings: this is not a problem as the
            # encoders regenerate the encodings
            if self.encoders is not None and self.encoders.encoding_available:
                _, future_covariates = self.generate_predict_encodings(
                    n=n,
                    series=self.training_series,
                    past_covariates=None,
                    future_covariates=future_covariates,
                )
        self._verify_passed_predict_covariates(future_covariates)

        if future_covariates is not None:
            start = self.training_series.end_time() + self.training_series.freq
            offset = n - 1 if future_covariates.has_datetime_index else n
            future_covariates = future_covariates[
                start : start + offset * self.training_series.freq
            ]
            if len(future_covariates) != n:
                raise_log(
                    ValueError(
                        f"For the given forecasting horizon `n={n}`, the provided `future_covariates` "
                        f"series must contain at least the next `n={n}` time steps/indices after the "
                        f"end of the target `series` that was used to train the model."
                    ),
                    logger=logger,
                )

        return self._predict(
            n,
            future_covariates=future_covariates,
            num_samples=num_samples,
            predict_likelihood_parameters=predict_likelihood_parameters,
            random_state=random_state,
            **kwargs,
        )
Forecasts values for `n` time steps after the end of the training series.

        If some future covariates were specified during the training, they must also be specified here.

        Parameters
        ----------
        n
            Forecast horizon - the number of time steps after the end of the series for which to produce predictions.
        future_covariates
            The time series of future-known covariates which can be fed as input to the model. It must correspond to
            the covariate time series that has been used with the :func:`fit()` method for training, and it must
            contain at least the next `n` time steps/indices after the end of the training target series.
        num_samples
            Number of times a prediction is sampled from a probabilistic model. Must be `1` for deterministic models.
        predict_likelihood_parameters
            If set to `True`, the model predicts the parameters of its `likelihood` instead of the target. Only
            supported for probabilistic models with a likelihood, `num_samples = 1` and `n<=output_chunk_length`.
            Default: ``False``.
        verbose
            Optionally, set the prediction verbosity. Not effective for all models.
        show_warnings
            Optionally, control whether warnings are shown. Not effective for all models.
        random_state
            Controls the randomness of probabilistic predictions.

        Returns
        -------
        TimeSeries, a single time series containing the `n` next points after then end of the training series.
        
darts/models/forecasting/forecasting_model.py