timebasedcv
timebasedcv copied to clipboard
Take top N splits
Description
In #41 we are discussing the possibility of starting with the most recent data. While doing so, also the request of taking only N splits emerged.
This should be easy to accomplish via a helper function along the following lines:
from itertools import islice
def take_n_splits(CV, N):
yield from islice(CV.split(), N)