Forecasting
Zero-shot forecasting using the Mimosa foundation model.
Sulie’s SDK simplifies time series forecasting, offering both zero-shot and fine-tuned models through the Mimosa foundation model. The All-in-One plan includes 100,000 inference calls, covering both types of forecasting models.
Basic Usage
The example below demonstrates how to forecast renewable energy demand using Sulie’s forecast method.
Note: The maximum context length for time series data is 512 data points, and the maximum prediction horizon is 64 data points. For Enterprise users, these limits increase to 1024 and 128, respectively.
Parameters
Name | Description | Type |
---|---|---|
dataset | A Sulie Dataset or pd.DataFrame with your time series data. | required |
horizon | Number of time steps to forecast into the future. | required |
target_col | Column name for the variable to forecast. | optional |
id_col | Column name to group data by (e.g., different locations). | optional |
timestamp_col | Column containing the timestamp. | optional |
quantiles | Prediction quantiles, e.g. [0.2, 0.8] | optional |
aggr | Aggregation function to use when grouping (sum or mean ). | optional |
frequency | Time series frequency (e.g., H for hourly, D for daily). | optional |
model | Specifies the model to use (defaults to the latest Mimosa version). | optional |
Output
The output of the forecast function is a Forecast
object.
The Forecast
object includes two variables: median
and quantiles
, corresponding to different certainty levels in the predictions. These help you understand the range of possible outcomes, from conservative to optimistic.
You can also visualize the forecasts directly by calling the plot function:
This quickly generates a chart showing the forecast ranges, making it easy to spot trends and variability in the results. Perfect for a fast, clear analysis.
Validate forecast accuracy
The evaluate
function measures the performance of a time series forecasting model
by sampling random time windows from the input dataset, generating forecasts, and
calculating forecast errors. Designed for robustness, it supports evaluation across
single or multiple time series and computes metrics like Weighted Quantile Loss (WQL)
or Weighted Absolute Percentage Error (WAPE). By running multiple iterations, it ensures
reliable aggregation of results, providing insights into the model’s accuracy and
adaptability to various time windows. This function is ideal for validating forecasting
models in scenarios with seasonality, trends, or diverse time series data.
Parameters
Name | Description | Type |
---|---|---|
dataset | A Sulie Dataset or pd.DataFrame with your time series data. | required |
horizon | Number of time steps to forecast into the future. | required |
target_col | Column name for the variable to forecast. | optional |
id_col | Column name to group data by (e.g., different locations). | optional |
metric | Name of the validation metric, MAE , WQL , WAPE . | optional |
metric_aggregation | How a final score is calculated, mean , median . | optional |
iterations | Number of iterations to run. | optional |
model | Specifies the model to use (defaults to the latest Mimosa version). | optional |