Python: representations
Source:vignettes/articles/python-representations.Rmd
python-representations.RmdHow a series becomes the array a learner reads, and the set a run is compared across.
grain()
One calendar grain, named, or supplied as a function of the reading
instants returning each reading’s bin start, which is reported as
custom.
multigrain()
Several grains flattened and bound side by side into one block of features.
Left at None the grains are the ones the record
supports, the set auto_grains names. A caller who does not
want the record unreduced among them names the grains instead.
lookback()
A stretch of record of fixed length, ending a fixed lag before each target’s own instant.
Representation
One reduction, named but not yet built.
sequence says whether the bins are ordered in time and
mean something to a convolution: the record unreduced, a calendar grain
and a lookback cut into several bins are sequences; a block of features
bound side by side is not.
Attributes:
-
label- str -
kind- str -
stats- tuple[str, …] -
grain- object -
grains- tuple[str, …] | None -
span- object -
lag- object -
bins- int -
sequence- bool -
year_start- str
auto_grains()
The named grains that give the record at least two bins, from the finest to the coarsest.
The count comes from the calendar in the core rather than from arithmetic here, so a grain is admitted on the same rule that will bin it. It is read off one reading per distinct instant, which carries the record’s whole span and its gaps at the cost of a single unit’s memory, in the zone the time column carries, so a grain is counted on the clock it will be binned by.