class_docstr: Tests that data transformers inheriting from `FittableDataTransformer` class behave
  correctly when `global_fit` attribute is `True`.
docstr: Tests that time-averaged mean subtraction transformation behaves
  correctly when `global_fit = False` and when `global_fit = True`.
code: def test_global_fitting(self):
      """
      Tests that time-averaged mean subtraction transformation behaves
      correctly when `global_fit = False` and when `global_fit = True`.
      """
  
      series_1 = TimeSeries.from_values(np.ones((3, 2, 1)))
      series_2 = TimeSeries.from_values(2 * np.ones((3, 2, 1)))
  
      # Local fitting - subtracting mean of each series from itself should return
      # zero-valued series:
      transformed_1, transformed_2 = self.DataTransformerMock(
          global_fit=False
      ).fit_transform([series_1, series_2])
      assert transformed_1 == TimeSeries.from_values(
          np.zeros((3, 2, 1))
      )
      assert transformed_2 == TimeSeries.from_values(
          np.zeros((3, 2, 1))
      )
  
      # Global fitting - mean of `series_1` and `series_2` should be `1.5`, so
      # `series_1` values should be transformed to `-0.5` and `series_2` values
      # should be transformed to `1.5`:
      transformed_1, transformed_2 = self.DataTransformerMock(
          global_fit=True
      ).fit_transform([series_1, series_2])
      assert transformed_1 == TimeSeries.from_values(
          -0.5 * np.ones((3, 2, 1))
      )
      assert transformed_2 == TimeSeries.from_values(
          0.5 * np.ones((3, 2, 1))
      )
  
file_path: darts/darts/tests/dataprocessing/transformers/test_fittable_data_transformer.py
imports: from typing import Any, Mapping, Sequence, Union
  import numpy
  from darts import TimeSeries
  from darts.dataprocessing.transformers.fittable_data_transformer import FittableDataTransformer
  from darts.utils.timeseries_generation import constant_timeseries
label_desc: Use image node_id 1 for calling the TestGlobalFittableDataTransformer obj's underlying member method code with example usage: obj.test_global_fitting() without return types