def update_parameter(clf, key, value):
    """
    Copies clf to a new dict and updates
    clf_new[key] = value
    Also updates the title by replacing the
    placeholder '{key}' by value
    """
    # copy old keys and update the current one
    new_clf = clf.copy()
    new_clf[key] = value
    # set title
    if 'title' in new_clf:
        new_clf['title'] = clf['title'].replace(
            '{{{}}}'.format(key), str(value))
    return new_clf