def split_test_train_data(x, y, ratio=0.8):
    """
    split data (x, y) into a train and test set for a given ratio
    """
    n = x.shape[0]
    x_test = x[int(ratio * n):, :]
    y_test = y[int(ratio * n):, :]
    x_train = x[:int(ratio * n), :]
    y_train = y[:int(ratio * n), :]
    return x_train, y_train, x_test, y_test