Skip to main content
Looking for usage documentation? Check out Relational predictions.

PredictiveContext

View source
A database and training task shared by fitted predictors. Build the split source from a spec’s database and SQL task.
Parameters
Raises ValueError If the validation window ends after the last row at or before test_timestamp.

PredictiveContext.from_yaml

View source
Load a database and training task from YAML.
Parameters
Returns

PredictiveContext.fit

View source
Fit a registered model and return its independent fitted state.
Parameters
Returns

PredictiveContext.precompute_cache

View source
Build the shared DFS feature cache on CPU; return cache_dir. Featurizes exactly what fit reads (the inner split for tuning, the outer refit split), so a later fit(model, cache_dir=...) reads the DFS instead of recomputing it. For a large custom database, run this on a big CPU node, then fit on the GPU. The artifacts are shared by all DFS models.
Parameters
Returns

PredictiveContext.compute_test_labels

View source
Compute labels for the historical test windows from the full database. Only complete test windows are returned. Rows for entities missing from the frozen database are dropped with a warning.
Parameters
Returns
Raises ValueError If the first test window is not fully covered by the data.

PredictiveContext.group_test_entities

View source
Yield each test timestamp and its labeled entity IDs.
Parameters
Yields