コード例 #1
0
 def test_equalize_class_distribution_valid_data_ordered(self):
     X = [[0], [1], [2], [3], [4], [5]]
     y = [1, 2, 1, 2, 1, 1]
     X, y = chest_accel.equalize_class_distribution(X, y)
     expected_X = np.array([[0], [1], [2], [3]])
     expected_y = np.array([1, 2, 1, 2])
     self.assertTrue(np.array_equal(X, expected_X))
     self.assertTrue(np.array_equal(y, expected_y))
コード例 #2
0
ファイル: test_toy_datasets.py プロジェクト: wulfebw/rnn
	def test_equalize_class_distribution_valid_data_unordered(self):
		X = [[0], [1], [2], [3], [4], [5], [6]]
		y = [1, 2, 1, 2, 1, 1, 2]
		X, y = chest_accel.equalize_class_distribution(X, y)
		expected_X = np.array([[0], [1], [2], [3], [4], [6]])
		expected_y = np.array([1, 2, 1, 2, 1, 2])
		self.assertTrue(np.array_equal(X, expected_X))
		self.assertTrue(np.array_equal(y, expected_y))
コード例 #3
0
 def test_equalize_class_distribution_invalid_data(self):
     X = []
     y = []
     X, y = chest_accel.equalize_class_distribution(X, y)
     self.assertTrue(np.array_equal(X, np.array([])))
     self.assertTrue(np.array_equal(y, np.array([])))
コード例 #4
0
ファイル: test_toy_datasets.py プロジェクト: wulfebw/rnn
	def test_equalize_class_distribution_invalid_data(self):
		X = []
		y = []
		X, y = chest_accel.equalize_class_distribution(X, y)
		self.assertTrue(np.array_equal(X, np.array([])))
		self.assertTrue(np.array_equal(y, np.array([])))