docstr: Override of RegressionModel's predict method to allow for the probabilistic case
docstr_tok: ["Override","of","RegressionModel","'s","predict","method","to","allow","for","the","probabilistic","case"]
code: def _predict_and_sample(
      self,
      x: np.ndarray,
      num_samples: int,
      predict_likelihood_parameters: bool,
      **kwargs,
  ) -> np.ndarray:
      """Override of RegressionModel's predict method to allow for the probabilistic case"""
      if self.likelihood is not None:
          return self._predict_and_sample_likelihood(
              x,
              num_samples,
              self.likelihood,
              predict_likelihood_parameters,
              **kwargs,
          )
      else:
          return super()._predict_and_sample(
              x, num_samples, predict_likelihood_parameters, **kwargs
          )
  
file_path: darts/darts/models/forecasting/lgbm.py
imports: from typing import List, Optional, Sequence, Union
  import lightgbm
  import numpy
  from darts.logging import get_logger
  from darts.models.forecasting.regression_model import FUTURE_LAGS_TYPE, LAGS_TYPE, RegressionModelWithCategoricalCovariates, _LikelihoodMixin
  from darts.timeseries import TimeSeries
label_desc: Use image node_id 3 for calling the LightGBMModel obj's underlying member method code with example usage: obj._predict_and_sample(x, num_samples, predict_likelihood_parameters) and returns: self, super