Skip to content

Add rejection sampling capability #16

@sdl1

Description

@sdl1

It would be useful to be able to select the seed for (e.g.) the RandomSelector based on user-specified criteria. This would allow an implementation of more sophisticated sampling methods (cf. #7 ) via rejection sampling, with a compact representation (the seed) of the final date set. Something like the following:

function acceptance(validation_dates, holdout_dates)
    # We want 1st of January to be in the validation dates
    return DateTime(2021, 1, 1) in validation_dates
end

# Gives a seed with the desired properties to use with RandomSelector
seed = rejection_sample(RandomSelector, date_range, acceptance)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions