def regularization_classification_error(model_reg, regs, training_set,
                                        test_set):
    """
    Trains the model with various values of the regularization parameter

    :param model_reg - Function of type Double -> Model
    :param regs - The regularization parameter values to be evaluated
    :param traning_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
        given the regularization parameter settings
    """

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

    for reg in regs:
        model = model_reg(reg)
        model.fit(X_tr, y_tr)
        training_errors.append(1 - model.score(X_tr, y_tr))
        test_errors.append(1 - model.score(X_te, y_te))

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