code: def fit_then_transform(
      expected, input, categorical_features="all", minimum_fraction=None
  ):
      # Test fit_transform
      ohe = OneHotEncoder(
          categorical_features=categorical_features,
          minimum_fraction=minimum_fraction,
      )
      transformation = ohe.fit_transform(input.copy())
      assert_array_almost_equal(
          expected.astype(float), transformation.todense()
      )
  
      # Test fit, and afterwards transform
      ohe2 = OneHotEncoder(
          categorical_features=categorical_features,
          minimum_fraction=minimum_fraction,
      )
      ohe2.fit(input.copy())
      transformation = ohe2.transform(input.copy())
      assert_array_almost_equal(expected, transformation.todense())
  
imports: import numpy
  import scipy.sparse
  from numpy.testing import assert_array_almost_equal
  from sklearn.datasets import load_iris, load_boston
  from sklearn.linear_model import LinearRegression
  from sklearn.pipeline import make_pipeline
  from sklearn.model_selection import cross_val_score, KFold
  from nose.tools import assert_equal
  from tpot.builtins import OneHotEncoder, auto_select_categorical_features, _transform_selected
label_desc: Use image node_id 1 for calling a global function with example usage: fit_then_transform(expected, input, categorical_features, minimum_fraction) without return types