def prepare_y(y):
    """Make sure y is a vector. Unravel from matrix if necessary (and matrix only
    has 1 column)
    """
    if len(y.shape) > 1:
        if y.shape[1] == 1:
            y = y.ravel()
        else:
            raise ValueError("Y has to be a vector of response values")
    return y