code: def test_sample_ensemble(self):
      from imblearn.ensemble import BalanceCascade, EasyEnsemble
  
      models = [BalanceCascade, EasyEnsemble]
  
      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)
  
          results = df.fit_resample(mod1)
          expected_X, expected_y = mod2.fit_resample(X, y)
  
          self.assertIsInstance(results, list)
          for r in results:
              self.assertIsInstance(r, pdml.ModelFrame)
              tm.assert_index_equal(r.columns, df.columns)
  
          mod1 = model(random_state=self.random_state)
          mod2 = model(random_state=self.random_state)
  
          results = df.fit_sample(mod1)
          expected_X, expected_y = mod2.fit_sample(X, y)
  
          self.assertIsInstance(results, list)
          for r in results:
              self.assertIsInstance(r, pdml.ModelFrame)
              tm.assert_index_equal(r.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 6 for calling the TestImbalance obj's underlying member method code with example usage: obj.test_sample_ensemble() without return types