code: def test_transform_and_smooth_fp(params, measurements, y):
      """Test KalmanFilterTransformerFP `fit` and `transform`.
  
      Creating two instances of KalmanFilterTransformerFP, one instance with parameter
      `denoising` set to False, and the other's set to True. Compare result with
      `FilterPy`'s `batch_filter` and `rts_smoother`.
      """
      from filterpy.kalman.kalman_filter import (
          batch_filter,
          rts_smoother,
      )
  
      # initiate KalmanFilterTransformerFP with denoising=False
      # fit and transform
      adapter_transformer = KalmanFilterTransformerFP(**params)
      adapter_transformer = adapter_transformer.fit(measurements, y=y)
      xt_transformer_adapter = adapter_transformer.transform(
          measurements, y=y
      )
  
      # initiating KalmanFilterTransformerFP with denoising=True,
      # fit and transform
      adapter_smoother = KalmanFilterTransformerFP(
          denoising=True, **params
      )
      adapter_smoother = adapter_smoother.fit(measurements, y=y)
      xt_smoother_adapter = adapter_smoother.transform(
          measurements, y=y
      )
  
      # get data in a form compatible to FilterPy. call batch_filter
      matrices, fp_measurements = init_kf_filterpy(
          measurements=measurements, adapter=adapter_transformer, y=y
      )
      (means, covs, _, _) = batch_filter(**matrices, zs=fp_measurements)
  
      # test transformer
      assert_array_almost_equal(xt_transformer_adapter, means)
  
      # test smoother
      xt_smoother_filterpy = rts_smoother(
          Xs=means, Ps=covs, Fs=matrices["Fs"], Qs=matrices["Qs"]
      )[0]
      assert_array_almost_equal(
          xt_smoother_adapter, xt_smoother_filterpy
      )
  
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 9 for calling a global function with example usage: test_transform_and_smooth_fp(params, measurements, y) without return types