code: def test_min_max_scaler_iris(setup):
      X = iris
      scaler = MinMaxScaler()
      # default params
      X_trans = scaler.fit_transform(X)
      assert_array_almost_equal(X_trans.min(axis=0), 0)
      assert_array_almost_equal(X_trans.max(axis=0), 1)
      X_trans_inv = scaler.inverse_transform(X_trans)
      assert_array_almost_equal(X, X_trans_inv)
  
      # not default params: min=1, max=2
      scaler = MinMaxScaler(feature_range=(1, 2))
      X_trans = scaler.fit_transform(X)
      assert_array_almost_equal(X_trans.min(axis=0), 1)
      assert_array_almost_equal(X_trans.max(axis=0), 2)
      X_trans_inv = scaler.inverse_transform(X_trans)
      assert_array_almost_equal(X, X_trans_inv)
  
      # min=-.5, max=.6
      scaler = MinMaxScaler(feature_range=(-0.5, 0.6))
      X_trans = scaler.fit_transform(X)
      assert_array_almost_equal(X_trans.min(axis=0), -0.5)
      assert_array_almost_equal(X_trans.max(axis=0), 0.6)
      X_trans_inv = scaler.inverse_transform(X_trans)
      assert_array_almost_equal(X, X_trans_inv)
  
      # raises on invalid range
      scaler = MinMaxScaler(feature_range=(2, 1))
      with pytest.raises(ValueError):
          scaler.fit(X)
  
file_path: mars/mars/learn/preprocessing/tests/test_data.py
imports: import pytest
  from sklearn.datasets import load_iris
  from sklearn.utils import gen_batches
  from sklearn.utils._testing import assert_array_almost_equal, assert_allclose
  from ....None import tensor
  from ..None import MinMaxScaler, minmax_scale
label_desc: Use image node_id 4 for calling a global function with example usage: test_min_max_scaler_iris(setup) without return types