Open SyxP opened 11 months ago
Given a sequence c_1, c_2, ..., c_n, ... which are outputs of a (possibly infinite) iterator. The windows(c, k) should return an iterator with first entry [c_1, c_2, ..., c_k], second entry [c_2, c_3, ..., c_{k+1}] and so on.
c_1, c_2, ..., c_n, ...
windows(c, k)
[c_1, c_2, ..., c_k]
[c_2, c_3, ..., c_{k+1}]
The name is from a common technique called sliding window, mentioned here https://en.cppreference.com/w/cpp/ranges/slide_view .
MLDataUtils.jl provides these btw. in a variety of varieties
Given a sequence
c_1, c_2, ..., c_n, ...
which are outputs of a (possibly infinite) iterator. Thewindows(c, k)
should return an iterator with first entry[c_1, c_2, ..., c_k]
, second entry[c_2, c_3, ..., c_{k+1}]
and so on.The name is from a common technique called sliding window, mentioned here https://en.cppreference.com/w/cpp/ranges/slide_view .