rics.ml.time_split.types#

Types related to splitting data.

Module Attributes

DatetimeTypes

Types that may be cast to pandas.Timestamp.

DatetimeIterable

Iterable that may be cast to pandas.DatetimeIndex.

TimedeltaTypes

Types that may be cast to pandas.Timedelta.

Schedule

User schedule type.

Span

User span type.

Flex

Flexibility frequency string for floor/ceil.

DatetimeSplits

A list of bounds.

Classes

DatetimeIndexSplitterKwargs

Keyword arguments for creating a DatetimeIndexSplitter.

DatetimeSplitBounds(start, mid, end)

A 3-tuple which denotes two adjacent datetime ranges.

DatetimeSplitCounts(data, future_data)

Relative importance of data and future_data.

DatetimeTypes: TypeAlias = str | pandas._libs.tslibs.timestamps.Timestamp | datetime.datetime | datetime.date | numpy.datetime64#

Types that may be cast to pandas.Timestamp.

DatetimeIterable#

Iterable that may be cast to pandas.DatetimeIndex.

alias of Iterable[str | Timestamp | datetime | date | datetime64]

TimedeltaTypes: TypeAlias = str | pandas._libs.tslibs.timedeltas.Timedelta | datetime.timedelta | numpy.timedelta64#

Types that may be cast to pandas.Timedelta.

Schedule#

User schedule type.

alias of Union[DatetimeIndex, Iterable[str | Timestamp | datetime | date | datetime64], str, Timedelta, timedelta, timedelta64]

Span#

User span type. Used to determine limits from the timestamps given by a Schedule.

alias of Union[int, Literal[‘all’], str, Timedelta, timedelta, timedelta64]

Flex#

Flexibility frequency string for floor/ceil. Pass False to disable.

alias of Union[bool, Literal[‘auto’], str]

class DatetimeSplitBounds(start: Timestamp, mid: Timestamp, end: Timestamp)[source]#

Bases: NamedTuple

A 3-tuple which denotes two adjacent datetime ranges.

start: Timestamp#

Left (inclusive) limit of the data range.

mid: Timestamp#

Schedule timestamp.

Right (exclusive) limit of the data range, left (inclusive) limit of the future_data range.

end: Timestamp#

Right (exclusive) limit of the future_data range.

DatetimeSplits#

A list of bounds.

alias of list[DatetimeSplitBounds]

class DatetimeSplitCounts(data: int, future_data: int)[source]#

Bases: NamedTuple

Relative importance of data and future_data.

data: int#

Alias for field number 0

future_data: int#

Alias for field number 1

class DatetimeIndexSplitterKwargs[source]#

Bases: TypedDict

Keyword arguments for creating a DatetimeIndexSplitter.

The DatetimeIndexSplitter is the backing type for all splitting logic. It is not exposed directly to users. See split() or one of the related functions for user-facing APIs.

schedule: DatetimeIndex | Iterable[str | Timestamp | datetime | date | datetime64] | str | Timedelta | timedelta | timedelta64#
before: int | Literal['all'] | str | Timedelta | timedelta | timedelta64#
after: int | Literal['all'] | str | Timedelta | timedelta | timedelta64#
step: int#
n_splits: int | None#
flex: bool | Literal['auto'] | str#