code: def test_transform_and_smooth_pk(params, measurements):
      """Test KalmanFilterTransformerPK `fit` and `transform`.
  
      Creating two instances of KalmanFilterTransformerPK, one instance with parameter
      `denoising` set to False, and the other's set to True. Compare result with
      `pykalman-bardo`'s `filter` and `smooth`.
      """
      mask_measurements = np.ma.masked_invalid(np.copy(measurements))
  
      # adapter transformer
      adapter_transformer = KalmanFilterTransformerPK(
          **params
      )  # init_pykalman_adapter(state_dim=state_dim, **params)
      xt_adapter_transformer = adapter_transformer.fit_transform(
          measurements
      )
  
      # adapter denoising
      adapter_denoising = KalmanFilterTransformerPK(
          **params, denoising=True
      )
      xt_adapter_denoising = adapter_denoising.fit_transform(
          measurements
      )
  
      # pykalman
      kf_pykalman = init_kf_pykalman(
          measurement_dim=measurements.shape[1], **params
      )
      if "estimate_matrices" in params.keys():
          kf_pykalman = kf_pykalman.em(mask_measurements)
      xt_pykalman_transformer, _ = kf_pykalman.filter(mask_measurements)
      xt_pykalman_denoising, _ = kf_pykalman.smooth(mask_measurements)
  
      # test filter()
      assert np.array_equal(
          xt_adapter_transformer, xt_pykalman_transformer
      )
  
      # test smooth()
      assert np.array_equal(xt_adapter_denoising, xt_pykalman_denoising)
  
file_path: sktime/sktime/transformations/series/tests/test_kalman_filter.py
imports: import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal
  from sktime.transformations.series.kalman_filter import KalmanFilterTransformerFP, KalmanFilterTransformerPK
  from sktime.utils.validation._dependencies import _check_soft_dependencies
label_desc: Use image node_id 6 for calling a global function with example usage: test_transform_and_smooth_pk(params, measurements) without return types