(X, Y, ratio_of_test_size)
return tr_X, te_X, tr_Y, te_Y
Split training data by ratio
Split training data by ratio
Split training data by ratio
def train_test_split(X, Y, ratio_of_test_size):
    ''' Split training data by ratio '''
    IS_SPLIT_BY_SKLEARN_FUNC = True

    # Use sklearn.train_test_split
    if IS_SPLIT_BY_SKLEARN_FUNC:
        RAND_SEED = 1
        tr_X, te_X, tr_Y, te_Y = sklearn.model_selection.train_test_split(
            X, Y, test_size=ratio_of_test_size, random_state=RAND_SEED)

    # Make train/test the same.
    else:
        tr_X = np.copy(X)
        tr_Y = Y.copy()
        te_X = np.copy(X)
        te_Y = Y.copy()
    return tr_X, te_X, tr_Y, te_Y
def train_test_split ( X , Y , ratio_of_test_size ) : IS_SPLIT_BY_SKLEARN_FUNC = True # Use sklearn.train_test_split if IS_SPLIT_BY_SKLEARN_FUNC : RAND_SEED = 1 tr_X , te_X , tr_Y , te_Y = sklearn . model_selection . train_test_split ( X , Y , test_size = ratio_of_test_size , random_state = RAND_SEED ) # Make train/test the same. else : tr_X = np . copy ( X ) tr_Y = Y . copy ( ) te_X = np . copy ( X ) te_Y = Y . copy ( ) return tr_X , te_X , tr_Y , te_Y