Timedelta-schedule, 5 days before-data.#

Using an unbounded timedelta-schedule, with custom bar labels.

import pandas
from rics import configure_stuff
from rics.ml.time_split import log_split_progress, plot, split

configure_stuff(datefmt="")

data = pandas.date_range("2022", "2022-1-21", freq="38min").to_series()
config = dict(schedule="3d", before="5d", available=data)

plot(**config, bar_labels=[(f"{i}-left", f"{i}-right") for i in range(4)])
time_split.split(schedule='3d', before='5d', available=pandas.Series)
👻 Configured some stuff just the way I like it!

<Axes: title={'center': "time_split.split(schedule='3d', before='5d', available=pandas.Series)"}, ylabel='Fold'>

Unbounded (timedelta-string or CRON) schedules require available data to materialize the schedule. When using the plot-function, this data is also used to create bar labels unless they’re explicitly given, as seen above.

for fold in log_split_progress(split(**config), logger="my-logger"):
    print("Doing work..")
[rics.ml.time_split:INFO] Available data limits have been expanded (since flex='auto'):
  start: 2022-01-01 00:00:00 -> <no change>
    end: 2022-01-20 23:26:00 -> 2022-01-21 (+34m)
[my-logger:INFO] Begin fold 1/4: '2022-01-02' <= [schedule: '2022-01-07' (Friday)] < '2022-01-10'.
Doing work..
[my-logger:INFO] Finished fold 1/4: [schedule: '2022-01-07' (Friday)] after 24μs.
[my-logger:INFO] Begin fold 2/4: '2022-01-05' <= [schedule: '2022-01-10' (Monday)] < '2022-01-13'.
Doing work..
[my-logger:INFO] Finished fold 2/4: [schedule: '2022-01-10' (Monday)] after 23μs.
[my-logger:INFO] Begin fold 3/4: '2022-01-08' <= [schedule: '2022-01-13' (Thursday)] < '2022-01-16'.
Doing work..
[my-logger:INFO] Finished fold 3/4: [schedule: '2022-01-13' (Thursday)] after 22μs.
[my-logger:INFO] Begin fold 4/4: '2022-01-11' <= [schedule: '2022-01-16' (Sunday)] < '2022-01-19'.
Doing work..
[my-logger:INFO] Finished fold 4/4: [schedule: '2022-01-16' (Sunday)] after 22μs.

Total running time of the script: (0 minutes 0.340 seconds)

Gallery generated by Sphinx-Gallery