RelFMTabularForecaster
RelFMTabularForecaster( *, database: str, schema: str, context: b.Concept, label_column: str, time_column: str, max_context_length: int, item_id_column: Optional[str] = None, validation: Optional[b.Concept] = None, eval_metric: Optional[str] = None, test_batch_size: Optional[int] = None, stream_logs: bool = True, dataset_alias: Optional[str] = None, device: Literal["cpu", "cuda"] = "cpu", n_estimators: int = 8, random_state: Optional[int] = 42, sample_size: Optional[int] = None, sampling_strategy: str = "stratified", quantile_levels: Optional[List[float]] = None, norm_methods: Optional[Union[str, List[str]]] = None)Forecasting flat-table RelFM — see RelFMTabular.
forecast(domain=...) requires domain to carry pre-populated future
(item_id, time) skeleton rows (no label column), same convention as
RelFMTabularPredictor.predictions(domain=...). Output properties on
prediction_concept: predicted_value (point estimate) plus, when
quantile_levels is set, one quantile_<level> property per level
(e.g. quantile_10/quantile_50/quantile_90 for
[0.1, 0.5, 0.9]) — plain attribute access, no getattr needed.
The forecast lands exactly on domain’s own (item_id, time) rows —
each series may ask for its own dates, at its own spacing. An item with no
history in context, or a duplicate (item_id, time) row in
domain, is refused before the job runs. A domain date that falls
inside context’s own date range raises a leakage warning in
get_status()["warnings"], since the model has already seen the true
value for that date.
Parameters
(databasestr) - Snowflake database to save predictions in.
(schemastr) - Snowflake schema to save predictions in.
(contextConcept) - History/panel Concept — naturally identified by(item_id, time)together (a composite identity, unlikeRelFMTabularPredictor’s single natural key), carryinglabel_columnamong its own properties.
(label_columnstr) - Name of the value property oncontext/validation.
(time_columnstr) - Datetime property name oncontext/validation/theforecast()domain.
(max_context_lengthint) - Max history length (in time steps) looked back over.
(item_id_columnstr, default:None) - Series-partition property name for panel/multi-series forecasting. Omit for a single-series forecast.
(validationConcept, default:None) - Optional labeled validation split.
(eval_metricstr, default:None) - One of"mae","rmse", or"mape".
(test_batch_sizeint|None, default:None)
(stream_logsint|None, default:None)
(dataset_aliasint|None, default:None)
(deviceint|None, default:None)
(n_estimatorsint|None, default:None)
(random_stateint|None, default:42) - SeeRelFMTabular.
(sample_sizeint|None, default:42) - SeeRelFMTabular.
(sampling_strategyint|None, default:42) - SeeRelFMTabular.
(quantile_levelsint|None, default:42) - SeeRelFMTabular.
(norm_methodsint|None, default:42) - SeeRelFMTabular.
Examples
relfm_forecast = RelFMTabularForecaster( database="MYDB", schema="MYSCHEMA", context=SalesHistory, label_column="sales", time_column="date", item_id_column="storeid", max_context_length=60,)FutureWindow.forecast = relfm_forecast.forecast(domain=FutureWindow)Methods
.forecast()
RelFMTabularForecaster.forecast(domain: b.Concept) -> b.RelationshipForecast future values for every (item_id, time) row of a domain Concept.
Context is context alone — if validation was also passed to the
constructor, it is not automatically folded in as additional
context (the SDK notebook this is modeled on builds two separate
TabularTasks for score-context vs. predict-context, since
context_table is fixed at task-definition time). Call
score against validation separately if needed.
Parameters:
(domainConcept) - Future(item_id, time)rows to forecast for — nolabel_column, but withtime_column(anditem_id_column, if this is a multi-series/panel forecast) present. See the class docstring: the actual dates forecast are determined by wherecontext’s history ends, not bydomain’s date values.
Returns:
Relationship- A forecast relationship:{domain} -> prediction.