Exemple #1
0
def test_data_splitting_test_ratio(df_10_rows):

    train, valid, test = data_splitting.split(df_10_rows,
                                              train_ratio=0.7,
                                              valid_ratio=0.2,
                                              test_ratio=0.1,
                                              seed=0)

    assert len(test) == 1
Exemple #2
0
def test_data_splitting_valid_vs_test(df_10_rows):

    train, valid, test = data_splitting.split(df_10_rows,
                                              train_ratio=0.7,
                                              valid_ratio=0.2,
                                              test_ratio=0.1,
                                              seed=0)

    df_check = valid.merge(
        test,
        how="inner",
        right_on=["col_1", "col_2"],
        left_on=["col_1", "col_2"],
        sort=False,
    )

    assert df_check.empty