def training_size_classification_error(model, sizes, training_set, test_set):
    """
    Trains the model on subsets of the training data.

    :param model - The model to be trained
    :param sizes - The sizes of the training set to be evaluated
    :param training_set - (X,y) the training set
    :param test_set - (X,y) the test set
    :return [([double],[double])] each tuple represenging (x,y) the performance of the model
        on the set of the given size
    """

    training_errors = []
    test_errors = []
    (X_tr, y_tr) = training_set
    (X_te, y_te) = test_set

    for size in sizes:
        model.fit(X_tr[1:size], y_tr[1:size])
        training_errors.append(1 - model.score(X_tr[1:size], y_tr[1:size]))
        test_errors.append(1 - model.score(X_te, y_te))

    return [(sizes, training_errors), (sizes, test_errors)]