def get_cate(model, dataset, k=10):
    """Compute the CATE for k-fold validation

    Arguments
    ---------
    dataset: BaseDataSet
        Dataset to train and validate on.
    model: BaseModel
        Model to train and validate with.
    k: int
        Number of folds

    Returns
    -------
    results: list[tuple]
        A set of results for each of the folds, where one result consists of
        a list of cate estimates and a list of indices to which the results
        belong, which together form a tuple.
    """
    results = []
    for train_data, test_data in dataset.kfolds(k=k):
        model.train(model.preprocess(train_data.standard_df))
        cur_cate = model.predict_cate(test_data.standard_df)
        results.append((cur_cate, test_data.idx))
    return results