Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Precomputed Selection represented as a BitString #6

Open
oxinabox opened this issue Dec 7, 2020 · 0 comments
Open

Precomputed Selection represented as a BitString #6

oxinabox opened this issue Dec 7, 2020 · 0 comments

Comments

@oxinabox
Copy link
Member

oxinabox commented Dec 7, 2020

An idea @glennmoy and I were discussing

@glennmoy

> could we not generate a random bit string once, to represent whether a block will go in the validation/holdout?
> 
> This is just pseduo code but the idea would be e.g. 
> - take a large enough date range to capture any reasonable dates we would consider: date_range = `Date(1900, 1, 1):block_size:Date(2100, 1, 1)`
> - Generate a bit string of `length(date_range)` once with equal number of 0s/1s 
> - Mask the `date_range` using the bit string in global_validation/global_holdout
> - Intersect with the dates we provide to get the validation/holdout we care about
> 
> * only uses one random number 
> * no loops
> * exact fraction gets allocated (modulo block size)

@oxinabox replied

If we could actually fit it into some thing like a UInt1024 (which would from https://github.com/rfourquet/BitIntegers.jl)
that would cover us for 1024 blocks. which if doing block size of 1 day is not really enough.

But it would be nice because one could generate the bitstring in seperately to constructing the DateSelector, and pass it into the DateSelector as instead of the seed.
And that would be safe against the random number selector changing.
Such a 1024 bit string would look like 0x328d_8a1e_86f8_5c55_3cfe_223a_5904_02fd

Complicated bit would be that to achieve invarience to start date we probably need to do 200 years of days.
So would need to be a Int65536 which would not work great with BitIntegers.
But we could make it work.
Probably would want to Base64 encode it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant