docstr: Fits/trains the model using the provided list of features time series and the target time series.
  
  Parameters
  ----------
  series
      TimeSeries or Sequence[TimeSeries] object containing the target values.
  past_covariates
      Optionally, a series or sequence of series specifying past-observed covariates
  future_covariates
      Optionally, a series or sequence of series specifying future-known covariates
  val_series
      TimeSeries or Sequence[TimeSeries] object containing the target values for evaluation dataset
  val_past_covariates
      Optionally, a series or sequence of series specifying past-observed covariates for evaluation dataset
  val_future_covariates : Union[TimeSeries, Sequence[TimeSeries]]
      Optionally, a series or sequence of series specifying future-known covariates for evaluation dataset
  max_samples_per_ts
      This is an integer upper bound on the number of tuples that can be produced
      per time series. It can be used in order to have an upper bound on the total size of the dataset and
      ensure proper sampling. If `None`, it will read all of the individual time series in advance (at dataset
      creation) to know their sizes, which might be expensive on big datasets.
      If some series turn out to have a length that would allow more than `max_samples_per_ts`, only the
      most recent `max_samples_per_ts` samples will be considered.
  verbose
      An integer or a boolean that can be set to 1 to display catboost's default verbose output
  **kwargs
      Additional kwargs passed to `catboost.CatboostRegressor.fit()`
docstr_tok: ["Fits\/trains","the","model","using","the","provided","list","of","features","time","series","and","the","target","time","series",".","Parameters","--","--","--","--","--","series","TimeSeries","or","Sequence","[","TimeSeries","]","object","containing","the","target","values",".","past_covariates","Optionally",",","a","series","or","sequence","of","series","specifying","past-observed","covariates","future_covariates","Optionally",",","a","series","or","sequence","of","series","specifying","future-known","covariates","val_series","TimeSeries","or","Sequence","[","TimeSeries","]","object","containing","the","target","values","for","evaluation","dataset","val_past_covariates","Optionally",",","a","series","or","sequence","of","series","specifying","past-observed","covariates","for","evaluation","dataset","val_future_covariates",":","Union","[","TimeSeries",",","Sequence","[","TimeSeries","]","]","Optionally",",","a","series","or","sequence","of","series","specifying","future-known","covariates","for","evaluation","dataset","max_samples_per_ts","This","is","an","integer","upper","bound","on","the","number","of","tuples","that","can","be","produced","per","time","series",".","It","can","be","used","in","order","to","have","an","upper","bound","on","the","total","size","of","the","dataset","and","ensure","proper","sampling",".","If","`","None","`",",","it","will","read","all","of","the","individual","time","series","in","advance","(","at","dataset","creation",")","to","know","their","sizes",",","which","might","be","expensive","on","big","datasets",".","If","some","series","turn","out","to","have","a","length","that","would","allow","more","than","`","max_samples_per_ts","`",",","only","the","most","recent","`","max_samples_per_ts","`","samples","will","be","considered",".","verbose","An","integer","or","a","boolean","that","can","be","set","to","1","to","display","catboost","'s","default","verbose","output","*","*","kwargs","Additional","kwargs","passed","to","`","catboost.CatboostRegressor.fit","(",")","`"]
code: def fit(
      self,
      series: Union[TimeSeries, Sequence[TimeSeries]],
      past_covariates: Optional[
          Union[TimeSeries, Sequence[TimeSeries]]
      ] = None,
      future_covariates: Optional[
          Union[TimeSeries, Sequence[TimeSeries]]
      ] = None,
      val_series: Optional[
          Union[TimeSeries, Sequence[TimeSeries]]
      ] = None,
      val_past_covariates: Optional[
          Union[TimeSeries, Sequence[TimeSeries]]
      ] = None,
      val_future_covariates: Optional[
          Union[TimeSeries, Sequence[TimeSeries]]
      ] = None,
      max_samples_per_ts: Optional[int] = None,
      verbose: Optional[Union[int, bool]] = 0,
      **kwargs,
  ):
      """
      Fits/trains the model using the provided list of features time series and the target time series.
  
      Parameters
      ----------
      series
          TimeSeries or Sequence[TimeSeries] object containing the target values.
      past_covariates
          Optionally, a series or sequence of series specifying past-observed covariates
      future_covariates
          Optionally, a series or sequence of series specifying future-known covariates
      val_series
          TimeSeries or Sequence[TimeSeries] object containing the target values for evaluation dataset
      val_past_covariates
          Optionally, a series or sequence of series specifying past-observed covariates for evaluation dataset
      val_future_covariates : Union[TimeSeries, Sequence[TimeSeries]]
          Optionally, a series or sequence of series specifying future-known covariates for evaluation dataset
      max_samples_per_ts
          This is an integer upper bound on the number of tuples that can be produced
          per time series. It can be used in order to have an upper bound on the total size of the dataset and
          ensure proper sampling. If `None`, it will read all of the individual time series in advance (at dataset
          creation) to know their sizes, which might be expensive on big datasets.
          If some series turn out to have a length that would allow more than `max_samples_per_ts`, only the
          most recent `max_samples_per_ts` samples will be considered.
      verbose
          An integer or a boolean that can be set to 1 to display catboost's default verbose output
      **kwargs
          Additional kwargs passed to `catboost.CatboostRegressor.fit()`
      """
  
      if val_series is not None:
          kwargs["eval_set"] = self._create_lagged_data(
              target_series=val_series,
              past_covariates=val_past_covariates,
              future_covariates=val_future_covariates,
              max_samples_per_ts=max_samples_per_ts,
          )
  
      if self.likelihood == "quantile":
          # empty model container in case of multiple calls to fit, e.g. when backtesting
          self._model_container.clear()
          for quantile in self.quantiles:
              this_quantile = str(quantile)
              # translating to catboost argument
              self.kwargs[
                  "loss_function"
              ] = f"Quantile:alpha={this_quantile}"
              self.model = CatBoostRegressor(**self.kwargs)
  
              super().fit(
                  series=series,
                  past_covariates=past_covariates,
                  future_covariates=future_covariates,
                  max_samples_per_ts=max_samples_per_ts,
                  verbose=verbose,
                  **kwargs,
              )
  
              self._model_container[quantile] = self.model
  
          return self
  
      super().fit(
          series=series,
          past_covariates=past_covariates,
          future_covariates=future_covariates,
          max_samples_per_ts=max_samples_per_ts,
          verbose=verbose,
          **kwargs,
      )
  
      return self
  
file_path: darts/darts/models/forecasting/catboost_model.py
imports: from typing import List, Optional, Sequence, Tuple, Union
  import numpy
  from catboost import CatBoostRegressor
  from darts.logging import get_logger
  from darts.models.forecasting.regression_model import RegressionModel, _LikelihoodMixin
  from darts.timeseries import TimeSeries
label_desc: Use image node_id 2 for calling the CatBoostModel obj's underlying member method code with example usage: obj.fit(series, past_covariates, future_covariates, val_series, val_past_covariates, val_future_covariates, max_samples_per_ts, verbose) and returns: self, self