docstr: Inverse transforms a (sequence of) series by calling the user-implemented `ts_inverse_transform` method.
  
  In case a sequence is passed as input data, this function takes care of parallelising the
  transformation of multiple series in the sequence at the same time. Additionally,
  if the `mask_components` attribute was set to `True` when instantiating `InvertibleDataTransformer`,
  then any provided `component_mask`s will be automatically applied to each input `TimeSeries`;
  please refer to 'Notes' for further details on component masking.
  
  Any additionally specified `*args` and `**kwargs` are automatically passed to `ts_inverse_transform`.
  
  Parameters
  ----------
  series
      the (sequence of) series be inverse-transformed.
  args
      Additional positional arguments for the :func:`ts_inverse_transform()` method
  component_mask : Optional[np.ndarray] = None
      Optionally, a 1-D boolean np.ndarray of length ``series.n_components`` that specifies
      which components of the underlying `series` the inverse transform should consider.
  kwargs
      Additional keyword arguments for the :func:`ts_inverse_transform()` method
  
  Returns
  -------
  Union[TimeSeries, List[TimeSeries]]
      Inverse transformed data.
  
  Notes
  -----
  If the `mask_components` attribute was set to `True` when instantiating `InvertibleDataTransformer`,
  then any provided `component_mask`s will be automatically applied to each `TimeSeries` input to
  transform; `component_mask`s are simply boolean arrays of shape `(series.n_components,)` that
  specify which components of each `series` should be transformed using `ts_inverse_transform` and which
  components should not. If `component_mask[i]` is `True`, then the `i`th component of each
  `series` will be transformed by `ts_inverse_transform`. Conversely, if `component_mask[i]` is `False`,
  the `i`th component will be removed from each `series` before being passed to `ts_inverse_transform`;
  after transforming this masked series, the untransformed `i`th component will be 'added back'
  to the output. Note that automatic `component_mask`ing can only be performed if the `ts_inverse_transform`
  does *not* change the number of timesteps in each series; if this were to happen, then the transformed
  and untransformed components are unable to be concatenated back together along the component axis.
  
  If `mask_components` was set to `False` when instantiating `InvertibleDataTransformer`, then any provided
  `component_masks` will be passed as a keyword argument `ts_inverse_transform`; the user can then manually
  specify how the `component_mask` should be applied to each series.
code: def inverse_transform(
      self,
      series: Union[TimeSeries, Sequence[TimeSeries]],
      *args,
      component_mask: Optional[np.array] = None,
      **kwargs,
  ) -> Union[TimeSeries, List[TimeSeries]]:
      """Inverse transforms a (sequence of) series by calling the user-implemented `ts_inverse_transform` method.
  
      In case a sequence is passed as input data, this function takes care of parallelising the
      transformation of multiple series in the sequence at the same time. Additionally,
      if the `mask_components` attribute was set to `True` when instantiating `InvertibleDataTransformer`,
      then any provided `component_mask`s will be automatically applied to each input `TimeSeries`;
      please refer to 'Notes' for further details on component masking.
  
      Any additionally specified `*args` and `**kwargs` are automatically passed to `ts_inverse_transform`.
  
      Parameters
      ----------
      series
          the (sequence of) series be inverse-transformed.
      args
          Additional positional arguments for the :func:`ts_inverse_transform()` method
      component_mask : Optional[np.ndarray] = None
          Optionally, a 1-D boolean np.ndarray of length ``series.n_components`` that specifies
          which components of the underlying `series` the inverse transform should consider.
      kwargs
          Additional keyword arguments for the :func:`ts_inverse_transform()` method
  
      Returns
      -------
      Union[TimeSeries, List[TimeSeries]]
          Inverse transformed data.
  
      Notes
      -----
      If the `mask_components` attribute was set to `True` when instantiating `InvertibleDataTransformer`,
      then any provided `component_mask`s will be automatically applied to each `TimeSeries` input to
      transform; `component_mask`s are simply boolean arrays of shape `(series.n_components,)` that
      specify which components of each `series` should be transformed using `ts_inverse_transform` and which
      components should not. If `component_mask[i]` is `True`, then the `i`th component of each
      `series` will be transformed by `ts_inverse_transform`. Conversely, if `component_mask[i]` is `False`,
      the `i`th component will be removed from each `series` before being passed to `ts_inverse_transform`;
      after transforming this masked series, the untransformed `i`th component will be 'added back'
      to the output. Note that automatic `component_mask`ing can only be performed if the `ts_inverse_transform`
      does *not* change the number of timesteps in each series; if this were to happen, then the transformed
      and untransformed components are unable to be concatenated back together along the component axis.
  
      If `mask_components` was set to `False` when instantiating `InvertibleDataTransformer`, then any provided
      `component_masks` will be passed as a keyword argument `ts_inverse_transform`; the user can then manually
      specify how the `component_mask` should be applied to each series.
      """
      if hasattr(self, "_fit_called"):
          raise_if_not(
              self._fit_called,
              "fit() must have been called before inverse_transform()",
              logger,
          )
  
      desc = f"Inverse ({self._name})"
  
      # Take note of original input for unmasking purposes:
      if isinstance(series, TimeSeries):
          input_series = [series]
          data = [series]
      else:
          input_series = series
          data = series
  
      if self._mask_components:
          data = [
              self.apply_component_mask(
                  ts, component_mask, return_ts=True
              )
              for ts in data
          ]
      else:
          kwargs["component_mask"] = component_mask
  
      input_iterator = _build_tqdm_iterator(
          zip(data, self._get_params(n_timeseries=len(data))),
          verbose=self._verbose,
          desc=desc,
          total=len(data),
      )
  
      transformed_data = _parallel_apply(
          input_iterator,
          self.__class__.ts_inverse_transform,
          self._n_jobs,
          args,
          kwargs,
      )
  
      if self._mask_components:
          unmasked = []
          for ts, transformed_ts in zip(input_series, transformed_data):
              unmasked.append(
                  self.unapply_component_mask(
                      ts, transformed_ts, component_mask
                  )
              )
          transformed_data = unmasked
  
      return (
          transformed_data[0]
          if isinstance(series, TimeSeries)
          else transformed_data
      )
  
file_path: darts/darts/dataprocessing/transformers/invertible_data_transformer.py
imports: from abc import abstractmethod
  from typing import Any, List, Mapping, Optional, Sequence, Union
  import numpy
  from darts import TimeSeries
  from darts.logging import get_logger, raise_if_not
  from darts.utils import _build_tqdm_iterator, _parallel_apply
  from .base_data_transformer import BaseDataTransformer
label_desc: Use image node_id 3 for calling the InvertibleDataTransformer obj's underlying member method code with example usage: obj.inverse_transform(series) and returns: unknown