def _predict(
        self,
        x: np.ndarray,
        num_samples: int,
        predict_likelihood_parameters: bool,
        random_state: Optional[int] = None,
        **kwargs,
    ) -> np.ndarray:
        """Generate predictions.

        Generates deterministic predictions if no `Likelihood` was used.
        Otherwise, generates probabilistic predictions. Either sampled from the predicted distribution,
        or the predicted distribution parameters directly.
        """
        x, _ = self._format_samples(x)
        if self.likelihood is not None:
            return self.likelihood.predict(
                model=self,
                x=x,
                num_samples=num_samples,
                predict_likelihood_parameters=predict_likelihood_parameters,
                **kwargs,
            )

        prediction = self.model.predict(x, **kwargs)
        k = x.shape[0]
        return prediction.reshape(k, self.pred_dim, -1)
Generate predictions.

        Generates deterministic predictions if no `Likelihood` was used.
        Otherwise, generates probabilistic predictions. Either sampled from the predicted distribution,
        or the predicted distribution parameters directly.
        
darts/models/forecasting/sklearn_model.py