def test_horiz_split_last_index_train_set(self): train_set, test_set = train_test_split(make_dataset(8, 10), lazy=True) # no IndexError is thrown train_set[5]
def test_horiz_split_overindexing_train_set(self): train_set, test_set = train_test_split(make_dataset(8, 10), lazy=True) with self.assertRaisesRegex( IndexError, 'Exceeded the size of the training sequence.'): train_set[6]
def test_single_timeseries_no_horizon_no_n(self): with self.assertRaises(AttributeError): # even if the default axis is 0, but since it is a single timeseries, default axis is 1 train_test_split(constant_timeseries(123, 10), test_size=2, vertical_split_type=MODEL_AWARE)
def test_empty_dataset(self): with self.assertRaises(AttributeError): train_test_split([])
def test_parameters_for_axis_0(self): train_test_split(make_dataset(2, 10), axis=0, test_size=1) # expecting no exception self.assertTrue(True)