Timeseries Forecasting
Timeseries forecasting models are characterized by three fields:
- forecast timestamp: the date and time of the predicted event or observation and is passed into the timestamp field. (data type: integer unix timestamp in seconds)
- run_date: the date on which the model was run and the prediction was generated and is optionally passed in as a tag. (recommended data type: str or integer unix timestamp)
- lag: the number of days between the forecast timestamp and run date and is optionally passed in as a tag (recommended data type: int)
You will likely need to extend your model's delayed actuals join window. Reach out to [email protected] for help with this.
For example, if you run a model on Monday to predict the temperature on Friday, the run date would be Monday's date, the forecast timestamp would be a timestamp for a time on Friday and the lag would be four days.
MAPE, MAE, RMSE, MSE, R-Squared, Mean Error
Allowed Metric Families: Regression
Python Batch
Python Single Record
Data Connector
state | pos_approved | run_date | lag | predicted_thermal | reported_thermal | forecast_ts |
---|---|---|---|---|---|---|
ca | true | '12_16_2022' | 3 | 74.5 | 80.2 | 1671572541 |
schema = Schema(
prediction_id_column_name="prediction_id",
feature_column_names=feature_column_names,
timestamp_column_name="forecast_ts",
prediction_label_column_name="predicted_thermal",
actual_label_column_name="reported_thermal",
feature_column_names=["state", "pos_approved"]
tag_column_names=[
"run_date",
"lag",
],
)
response = arize_client.log(
dataframe=df,
schema=schema,
model_id="time-series-batch-ingestion-tutorial",
model_version="1.0.0",
model_type=ModelTypes.REGRESSION,
metrics_validation=[Metrics.REGRESSION],
environment=Environments.PRODUCTION
)
features = {
'state': 'ca',
'pos_approved': True
}
tags = {
'run_date': '12_16_2022',
'lag': 3
}
response = arize_client.log(
model_id='sample-model-1'
model_version='1.0.0',
environment=Environments.PRODUCTION,
model_type=ModelTypes.REGRESSION,
prediction_id='1',
prediction_timestamp= 1671572541,
features=features,
prediction_label=74.5,
actual_label=80.2,
tags=tags
)
Learn how to upload files via various Data Connectors:
Last modified 6mo ago