Exemple #1
0
def test_make_recurrent_no_partitioning4():
    ORDER_BY = "times"
    N_RECURRENT_SAMPLES = 5

    df = sample_data2()
    arr, y = make_recurrent(df, N_RECURRENT_SAMPLES, ORDER_BY, verbose=True, price_column="val1", time_threshold=86400)
    check_results(arr, df, N_RECURRENT_SAMPLES)
Exemple #2
0
def test_make_recurrent_partitioning4():
    ORDER_BY = "times"
    PARTITION_BY = "day"
    N_RECURRENT_SAMPLES = 3

    df = sample_data2()
    df[PARTITION_BY] = pd.to_datetime(df["times"]).dt.to_period("D")
    arr, y = make_recurrent(df, N_RECURRENT_SAMPLES, ORDER_BY, PARTITION_BY, verbose=True, price_column="val1", time_threshold=86400)
    check_results(arr, df, N_RECURRENT_SAMPLES, PARTITION_BY)