def split_train_test(X, y, test_percentage):
    """
    Randomly split given dataset into training- and testing sets
    :param X: Design matrix to split
    :param y: Response vector to split
    :param test_percentage: Percentage of samples to use as test
    :return: Two tuples of: (train set X, train set y), (test set X, test set y)
    """
    X = X.sample(frac=1)
    y = y.reindex_like(X)

    n = round(test_percentage * len(y))
    return (X[:-n], y[:-n]), (X[-n:], y[-n:])