def partition(x, y, feature_index, split_value):
    """return partitioned x & y corresponding to a split in the x's at feature
    with index and value specified. e.g. 'partition(x, y, 0, 2.5)' will split
    x & y in corresponding to x[0] being split at the value 2.5"""
    lte_indexes = x[:, feature_index] <= split_value
    return x[lte_indexes], y[lte_indexes], x[~lte_indexes], y[~lte_indexes]