code: def test_targetvalidator_inversetransform():
      """
      Test that the encoding/decoding works in 1D
      """
      validator = TargetValidator(is_classification=True)
      validator.fit(
          pd.DataFrame(
              data=["a", "a", "b", "c", "a"], dtype="category"
          ),
      )
      y = validator.transform(
          pd.DataFrame(
              data=["a", "a", "b", "c", "a"], dtype="category"
          ),
      )
      np.testing.assert_array_almost_equal(np.array([0, 0, 1, 2, 0]), y)
  
      y_decoded = validator.inverse_transform(y)
      assert ["a", "a", "b", "c", "a"] == y_decoded.tolist()
  
      assert validator.classes_.tolist() == ["a", "b", "c"]
  
      validator = TargetValidator(is_classification=True)
      multi_label = pd.DataFrame(
          np.array([[1, 0, 0, 1], [0, 0, 1, 1], [0, 0, 0, 0]]),
          dtype=bool,
      )
      validator.fit(multi_label)
      y = validator.transform(multi_label)
  
      y_decoded = validator.inverse_transform(y)
      np.testing.assert_array_almost_equal(y, y_decoded)
  
      # Multilabel classification is not encoded
      # For this reason, classes_ attribute does not contain a class
      np.testing.assert_array_almost_equal(
          validator.classes_, np.array([])
      )
  
imports: import numpy
  import pandas
  import sklearn.datasets
  import sklearn.model_selection
  from pandas.api.types import is_bool_dtype, is_numeric_dtype
  from scipy import sparse
  from sklearn.utils.multiclass import type_of_target
  from autosklearn.data.target_validator import TargetValidator
  import pytest
label_desc: Use image node_id 12 for calling a global function with example usage: test_targetvalidator_inversetransform() without return types