rics.ml.time_split.settings#
Global settings for the splitting logic.
Classes
Configuration for the 'auto' |
|
Global settings for the |
|
|
Miscellaneous settings that don't fit in any other namespace. |
|
Global settings for the |
- class auto_flex[source]#
Bases:
object
Configuration for the ‘auto’
Flex
logic.This class determines how
(lo, hi)
-tuples are expanded when flexible bounds are enabled.- classmethod set_level(level: Literal['hour', 'day'], *, start_at: str | Timedelta | timedelta | timedelta64, round_to: str | Timedelta | timedelta | timedelta64, tolerance: str | Timedelta | timedelta | timedelta64) None [source]#
Set a
Level
used by the auto-flex logic.Inputs are not verified until an actual split is made.
- Parameters:
level – The level to set; ‘hour’ or ‘day’.
start_at – Span size at which this level starts.
round_to – Frequency to round the range limits to.
tolerance – Maximum amount by which to alter limits.
- Raises:
AttributeError – For unknown level names.
- class Level(start_at: str | Timedelta | timedelta | timedelta64, round_to: str | Timedelta | timedelta | timedelta64, tolerance: str | Timedelta | timedelta | timedelta64)[source]#
Bases:
NamedTuple
Level type used by
auto_flex
.- start_at: str | Timedelta | timedelta | timedelta64#
Span size at which this level starts.
- round_to: str | Timedelta | timedelta | timedelta64#
Frequency to round the range limits to.
- tolerance: str | Timedelta | timedelta | timedelta64#
Maximum amount by which to alter limits.
- class plot[source]#
Bases:
object
Global settings for the
time_split.plot()
-function.- THOUSANDS_SEPARATOR_CUTOFF: int = 10000#
Minimum value before bar_labels include a
THOUSANDS_SEPARATOR
.
- class log_split_progress[source]#
Bases:
object
Global settings for the
log_split_progress()
-function.- FOLD_FORMAT: str = "'{start.auto}' <= [schedule: '{mid.auto}' ({mid:%A})] < '{end.auto}'"#
Pretty-printed fold-key for other messages.
Only the
start
,mid
, andend
keys are available (seeDatetimeSplitBounds
). You may use<key>.auto
to format as a date when time is zero (this is the default).
'2021-12-30' <= [schedule: '2022-01-04' (Tuesday)] < '2022-01-04 18:00:00'
- SECONDS_FORMATTER: str | Callable[[float], str] = 'rics.performance.format_seconds'#
A callable
(seconds) -> formatted_seconds
.Both
seconds
andformatted_seconds
will be available to theEND_MESSAGE
message. If a string is given, the actual callable will be resolved usingrics.misc.get_by_full_name()
.
- START_MESSAGE: str = 'Begin fold {n}/{n_splits}: {fold}.'#
Message indicating that the current fold has been yielded to the user.
Has access to all keys from the previous section, as well as:
The
fold
key (seeFOLD_FORMAT
), andThe
n
key, which is the 1-based position of the fold in splits, andThe
n_folds
key, which is justlen(splits)
.
Begin fold 5/7: '2021-12-30' <= [schedule: '2022-01-04' (Tuesday)] < '2022-01-04 18:00:00'.
- END_MESSAGE: str = "Finished fold {n}/{n_splits}: [schedule: '{mid.auto}' ({mid:%A})] after {formatted_seconds}."#
Message indicating that the user is done with the current fold.
Has access to all keys from the previous sections, as well as:
The
seconds
key, which is the (fractional) time the user spent in the fold, andThe
formatted_seconds
key, obtained using theSECONDS_FORMATTER
.
The value of
seconds
is obtained usingtime.perf_counter()
.Finished fold 5/7: [schedule: '2022-01-04' (Tuesday)] after 5m 21s.
- AUTO_DATE_FORMAT = '%Y-%m-%d'#
Short-form timestamp format_spec used by
<key>.auto
.
- AUTO_DATETIME_FORMAT = '%Y-%m-%d %H:%M:%S'#
Long-form timestamp format_spec used by
<key>.auto
.
- class misc[source]#
Bases:
object
Miscellaneous settings that don’t fit in any other namespace.
- snap_to_end: bool = True#
Controls alignment of timedelta-based splits.
Note
Active only when both schedule and after are
TimedeltaTypes
.If
True
, ensure that the Future data of the final fold ends at the rightmost edge of the available data range. Otherwise, alignment is determined bypandas.date_range()
.