def baseline_data(dataset,d1,d2,option):
    
    #load tickers data
    F, IT, C, I = ut.load_ticker_data(dataset)
    
    #construct y labels
    F_y, IT_y, C_y, I_y = ut.construct_y(F, IT, C, I)
    
    #construct train_X
    F_X = fg.get_basic_records(F, d1, d2, option)
    IT_X = fg.get_basic_records(IT, d1, d2, option)
    C_X = fg.get_basic_records(C, d1, d2, option)
    I_X = fg.get_basic_records(I, d1, d2, option)
    
    F_X = fg.normalize_data(F_X)
    IT_X = fg.normalize_data(IT_X)
    C_X = fg.normalize_data(C_X)
    I_X = fg.normalize_data(I_X)

    #finalize train and test data
    X, y = ut.finalize_data(F_X,IT_X,C_X,I_X,
                            F_y,IT_y,C_y,I_y)


    return X, y
def baseline_data(dataset, d1, d2, option):

    #load tickers data
    F, IT, C, I = ut.load_ticker_data(dataset)

    #construct y labels
    F_y, IT_y, C_y, I_y = ut.construct_y(F, IT, C, I)

    #construct train_X
    F_X = fg.get_basic_records(F, d1, d2, option)
    IT_X = fg.get_basic_records(IT, d1, d2, option)
    C_X = fg.get_basic_records(C, d1, d2, option)
    I_X = fg.get_basic_records(I, d1, d2, option)

    #finalize train and test data
    X, y = ut.finalize_data(F_X, IT_X, C_X, I_X, F_y, IT_y, C_y, I_y)

    return X, y
def sequential_data(dataset,d1,d2,days,option):
    
    #load tickers data
    F, IT, C, I = ut.load_ticker_data(dataset)
    
    #construct y labels
    F_y, IT_y, C_y, I_y = ut.construct_y(F, IT, C, I)
    
    #construct train_X
    F_X = fg.get_basic_records(F, d1, d2, "return rate")
    IT_X = fg.get_basic_records(IT, d1, d2, "return rate")
    C_X = fg.get_basic_records(C, d1, d2, "return rate")
    I_X = fg.get_basic_records(I, d1, d2, "return rate")
    F_X = fg.get_sequential_data(F_X, days, option)
    IT_X = fg.get_sequential_data(IT_X, days, option)
    C_X = fg.get_sequential_data(C_X, days, option)
    I_X = fg.get_sequential_data(I_X, days, option)
    #finalize train and test data
    X, y = ut.finalize_data(F_X,IT_X,C_X,I_X,
                            F_y,IT_y,C_y,I_y)

    return X, y
def low_freq_data(dataset, d1, d2, days):

    # load tickers data
    F, IT, C, I = ut.load_ticker_data(dataset)

    # construct y labels
    F_y, IT_y, C_y, I_y = ut.construct_y(F, IT, C, I)

    # construct train_X
    F_X = fg.get_basic_records(F, d1, d2, "open")
    IT_X = fg.get_basic_records(IT, d1, d2, "open")
    C_X = fg.get_basic_records(C, d1, d2, "open")
    I_X = fg.get_basic_records(I, d1, d2, "open")
    F_X = fg.get_lower_freq(F_X, days, option="return rate")
    IT_X = fg.get_lower_freq(IT_X, days, option="return rate")
    C_X = fg.get_lower_freq(C_X, days, option="return rate")
    I_X = fg.get_lower_freq(I_X, days, option="return rate")

    # finalize train and test data
    X, y = ut.finalize_data(F_X, IT_X, C_X, I_X, F_y, IT_y, C_y, I_y)

    return X, y
def low_freq_data(dataset,d1,d2,days):
    
    #load tickers data
    F, IT, C, I = ut.load_ticker_data(dataset)
    
    #construct y labels
    F_y, IT_y, C_y, I_y = ut.construct_y(F, IT, C, I)
    
    #construct train_X
    F_X = fg.get_basic_records(F, d1, d2, "open")
    IT_X = fg.get_basic_records(IT, d1, d2, "open")
    C_X = fg.get_basic_records(C, d1, d2, "open")
    I_X = fg.get_basic_records(I, d1, d2, "open")
    F_X = fg.get_lower_freq(F_X,days,option="return rate")
    IT_X = fg.get_lower_freq(IT_X,days,option="return rate")
    C_X = fg.get_lower_freq(C_X,days,option="return rate")
    I_X = fg.get_lower_freq(I_X,days,option="return rate")
    
    #finalize train and test data
    X, y = ut.finalize_data(F_X,IT_X,C_X,I_X,
                            F_y,IT_y,C_y,I_y)

    return X, y
def baseline_data(dataset,d1,d2,option):
    
    #load tickers data
    F, IT, C, I,tickers = ut.load_ticker_data(dataset)
    
    #construct y labels
    F_y, IT_y, C_y, I_y = ut.construct_y(F, IT, C, I)
    
    #construct train_X
    F_X = fg.get_basic_records(F, d1, d2, option)
    IT_X = fg.get_basic_records(IT, d1, d2, option)
    C_X = fg.get_basic_records(C, d1, d2, option)
    I_X = fg.get_basic_records(I, d1, d2, option)
    
    #finalize train and test data
    X, y,z = ut.finalize_data(F_X,IT_X,C_X,I_X,
                              F_y,IT_y,C_y,I_y,
                              tickers)

    X = X.astype(float)
    y = y.astype(float)
    y = y.astype(int)

    return X, y,z