code: def _fit_then_transform(self, expected, input):
      # Test fit_transform
      input_copy = input.copy()
      ohe = SparseOneHotEncoder()
      transformation = ohe.fit_transform(input)
      self.assertIsInstance(transformation, scipy.sparse.csr_matrix)
      np.testing.assert_array_almost_equal(
          expected.astype(float), transformation.todense()
      )
      self._check_arrays_equal(input, input_copy)
  
      # Test fit, and afterwards transform
      ohe2 = SparseOneHotEncoder()
      ohe2.fit(input)
      transformation = ohe2.transform(input)
      self.assertIsInstance(transformation, scipy.sparse.csr_matrix)
      np.testing.assert_array_almost_equal(
          expected, transformation.todense()
      )
      self._check_arrays_equal(input, input_copy)
  
file_path: auto-sklearn/test/test_pipeline/implementations/test_SparseOneHotEncoder.py
imports: import numpy
  import scipy.sparse
  import sklearn.datasets
  import sklearn.model_selection
  import sklearn.pipeline
  import sklearn.tree
  from sklearn.impute import SimpleImputer
  from sklearn.tree import DecisionTreeClassifier
  from autosklearn.pipeline.implementations.CategoryShift import CategoryShift
  from autosklearn.pipeline.implementations.SparseOneHotEncoder import SparseOneHotEncoder
  import unittest
label_desc: Use image node_id 4 for calling the TestSparseOneHotEncoder obj's underlying member method code with example usage: obj._fit_then_transform(expected, input) without return types