code: def test_sample(self):
      from imblearn.under_sampling import (
          ClusterCentroids,
          OneSidedSelection,
      )
      from imblearn.over_sampling import ADASYN, SMOTE
      from imblearn.combine import SMOTEENN, SMOTETomek
  
      models = [
          ClusterCentroids,
          OneSidedSelection,
          ADASYN,
          SMOTE,
          SMOTEENN,
          SMOTETomek,
      ]
  
      X = np.random.randn(100, 5)
      y = np.array([0, 1]).repeat([80, 20])
  
      df = pdml.ModelFrame(X, target=y, columns=list("ABCDE"))
  
      for model in models:
          mod1 = model(random_state=self.random_state)
          mod2 = model(random_state=self.random_state)
  
          df.fit(mod1)
          mod2.fit(X, y)
  
          result = df.fit_resample(mod1)
          expected_X, expected_y = mod2.fit_resample(X, y)
  
          self.assertIsInstance(result, pdml.ModelFrame)
          tm.assert_numpy_array_equal(result.target.values, expected_y)
          tm.assert_numpy_array_equal(result.data.values, expected_X)
          tm.assert_index_equal(result.columns, df.columns)
  
          mod1 = model(random_state=self.random_state)
          mod2 = model(random_state=self.random_state)
  
          result = df.fit_sample(mod1)
          expected_X, expected_y = mod2.fit_sample(X, y)
  
          self.assertIsInstance(result, pdml.ModelFrame)
          tm.assert_numpy_array_equal(result.target.values, expected_y)
          tm.assert_numpy_array_equal(result.data.values, expected_X)
          tm.assert_index_equal(result.columns, df.columns)
  
file_path: pandas-ml/pandas_ml/imbaccessors/test/test_imbalance.py
imports: import pytest
  import numpy
  import pandas_ml
  import pandas_ml.util.testing
label_desc: Use image node_id 5 for calling the TestImbalance obj's underlying member method code with example usage: obj.test_sample() without return types