def cross_predict_model(fitter, X, Y, plan):
    """train a model Y~X using the cross validation plan and return predictions"""
    preds = [None] * X.shape[0]
    for g in range(len(plan)):
        pi = plan[g]
        model = fitter.fit(X.iloc[pi['train']], Y.iloc[pi['train']])
        predg = model.predict(X.iloc[pi['test']])
        for i in range(len(pi['test'])):
            preds[pi['test'][i]] = predg[i]
    return preds
