Skip to contents

timesift() here and timesift() in R take the same two tables and do the same thing: build every candidate representation, fit the learners that can read each one, score them all on one set of held-out folds, and stack the out-of-fold predictions. The binning, the statistics and the array assembly are src/, compiled into both languages and answering to the representation contract, and the fixtures under inst/spec/fixtures/ hold the two to the same numbers.

pip install git+https://github.com/gcol33/timesift
import timesift as ts

fit = ts.timesift(plots, logger, y="sp_*", id="plot_id", time="datetime",
                  models=[ts.elasticnet(), ts.forest()],
                  sift=ts.grains("day", "week", "month"))
print(ts.summary(fit))

y, x and static are selections over their own table: a column name, a list of names, a glob such as "sp_*", or a function of a name. The contract’s last section says what each language carries, so a difference between the two is a recorded decision.

The pages

The representation

What a representation is before any record has been read, and the array it becomes.

The split and the cells

One fold map read by everything that scores, and the cells a score is defined on, computed with no model involved.

Fitting

The run from targets and series, the combiner over its candidates, and fitting across a set of grains on its own.

Learners

The arms that ship, how they are trained, and the interface a learner of your own goes through.

Scoring and comparison

The metrics, the paired contrast between two arms on matched cells, the inflation of a score read at its own best threshold, and what a fitted model read.

Extending

The response head and the metric are registrations, never a fork of the fitting code.

What crosses the boundary

The three artifacts a split is carried in, and the digest that says two arrays are the same array.