Skip to content

Commit

Permalink
Remove supervised.py unit test for imbalanced-learn
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahshi committed May 16, 2024
1 parent 45a3325 commit eb74777
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions UnitTests/test_supervised.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,21 +241,21 @@ def test_class2mineral_nn(self):
np.testing.assert_array_equal(pred_mineral, expected_pred_mineral)


class mineralML_supervised_balancing(unittest.TestCase):
def setUp(self):
# Create a small, imbalanced dataset for testing
self.train_x = np.array([[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]])
self.train_y = np.array([0, 0, 0, 1, 1])

def test_balance_function(self):
train_x_balanced, train_y_balanced = mm.balance(self.train_x, self.train_y, n=3)
# Check the shape of the output
self.assertEqual(train_x_balanced.shape[0], train_y_balanced.shape[0])
self.assertEqual(train_x_balanced.shape[1], self.train_x.shape[1])

# Check that each class has the correct number of samples
unique, counts = np.unique(train_y_balanced, return_counts=True)
self.assertTrue((counts == 3).all())
# class mineralML_supervised_balancing(unittest.TestCase):
# def setUp(self):
# # Create a small, imbalanced dataset for testing
# self.train_x = np.array([[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]])
# self.train_y = np.array([0, 0, 0, 1, 1])

# def test_balance_function(self):
# train_x_balanced, train_y_balanced = mm.balance(self.train_x, self.train_y, n=3)
# # Check the shape of the output
# self.assertEqual(train_x_balanced.shape[0], train_y_balanced.shape[0])
# self.assertEqual(train_x_balanced.shape[1], self.train_x.shape[1])

# # Check that each class has the correct number of samples
# unique, counts = np.unique(train_y_balanced, return_counts=True)
# self.assertTrue((counts == 3).all())


class test_variational_layer(unittest.TestCase):
Expand Down

0 comments on commit eb74777

Please sign in to comment.