Esempio n. 1
0
def test_train_test_split_ratios():
    n_class1 = 4
    n_class2 = 8
    transform_type = "Train/Test Split"
    time_series = [TimeSeries(*sample_values(), target='class1')
                   for i in range(n_class1)]
    time_series += [TimeSeries(*sample_values(), target='class2')
                    for i in range(n_class2)]
    outputs = transformation.train_test_split(
        time_series, test_size=0.5, train_size=0.5)
    npt.assert_equal(len(outputs[1]), len(time_series) / 2)
    npt.assert_equal(len(outputs[0]), len(time_series) / 2)
Esempio n. 2
0
def test_train_test_split_basecase():
    npt.assert_equal(transformation.train_test_split([]), ([], []))