def decode_resource_values(res_encoded, num_folds):
    """
    We assume the resource attribute r is encoded as `randint(1, num_folds)`.
    Internally, r is taken as value in the real interval
    `[0.5, num_folds + 0.5]`, which is linearly transformed to `[0, 1]` for
    encoding.

    :param res_encoded: Encoded values r
    :param num_folds: Maximum number of folds
    :return: Original values r (not rounded to int)
    """
    return res_encoded * num_folds + 0.5