code: def test_min_max_scaler_zero_variance_features(setup):
      # Check min max scaler on toy data with zero variance features
      X = [[0.0, 1.0, +0.5], [0.0, 1.0, -0.1], [0.0, 1.0, +1.1]]
  
      X_new = [[+0.0, 2.0, 0.5], [-1.0, 1.0, 0.0], [+0.0, 1.0, 1.5]]
  
      # default params
      scaler = MinMaxScaler()
      X_trans = scaler.fit_transform(X)
      X_expected_0_1 = [
          [0.0, 0.0, 0.5],
          [0.0, 0.0, 0.0],
          [0.0, 0.0, 1.0],
      ]
      assert_array_almost_equal(X_trans, X_expected_0_1)
      X_trans_inv = scaler.inverse_transform(X_trans)
      assert_array_almost_equal(X, X_trans_inv)
  
      X_trans_new = scaler.transform(X_new)
      X_expected_0_1_new = [
          [+0.0, 1.0, 0.500],
          [-1.0, 0.0, 0.083],
          [+0.0, 0.0, 1.333],
      ]
      assert_array_almost_equal(
          X_trans_new, X_expected_0_1_new, decimal=2
      )
  
      # not default params
      scaler = MinMaxScaler(feature_range=(1, 2))
      X_trans = scaler.fit_transform(X)
      X_expected_1_2 = [
          [1.0, 1.0, 1.5],
          [1.0, 1.0, 1.0],
          [1.0, 1.0, 2.0],
      ]
      assert_array_almost_equal(X_trans, X_expected_1_2)
  
      # function interface
      X_trans = minmax_scale(X)
      assert_array_almost_equal(X_trans, X_expected_0_1)
      X_trans = minmax_scale(X, feature_range=(1, 2))
      assert_array_almost_equal(X_trans, X_expected_1_2)
  
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 5 for calling a global function with example usage: test_min_max_scaler_zero_variance_features(setup) without return types