diff --git a/README.md b/README.md index c5a1c43..47db7c1 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,11 @@ This is not an officially supported Google product. We recommend at least 16GB RAM to load TimesFM dependencies. +## Update - July 15, 2024 + +- Launched [finetuning support](https://github.com/google-research/timesfm/blob/master/notebooks/finetuning.ipynb) that lets you finetune the weights of the pretrained TimesFM model on your own data. +- Launched [~zero-shot covariate support](https://github.com/google-research/timesfm/blob/master/notebooks/covariates.ipynb) with external regressors. + ## Checkpoint timesfm-1.0-200m timesfm-1.0-200m is the first open model checkpoint: @@ -195,6 +200,49 @@ forecast_df = tfm.forecast_on_df( ) ``` +## Covariates Support + +We now have an external regressors library on top of TimesFM that can support static covariates as well as dynamic covariates available in the future. We have an usage example in `notebooks/covariates.ipynb`. + +Let's take a toy example of forecasting sales for a grocery store: + +**Task:** Given the observed the daily sales of this week (7 days), forecast the daily sales of next week (7 days). + +``` +Product: ice cream +Daily_sales: [30, 30, 4, 5, 7, 8, 10] +Category: food +Base_price: 1.99 +Weekday: [0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3, 4, 5, 6] +Has_promotion: [Yes, Yes, No, No, No, Yes, Yes, No, No, No, No, No, No, No] +Daily_temperature: [31.0, 24.3, 19.4, 26.2, 24.6, 30.0, 31.1, 32.4, 30.9, 26.0, 25.0, 27.8, 29.5, 31.2] +``` + +``` +Product: sunscreen +Daily_sales: [5, 7, 12, 13, 5, 6, 10] +Category: skin product +Base_price: 29.99 +Weekday: [0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3, 4, 5, 6] +Has_promotion: [No, No, Yes, Yes, No, No, No, Yes, Yes, Yes, Yes, Yes, Yes, Yes] +Daily_temperature: [31.0, 24.3, 19.4, 26.2, 24.6, 30.0, 31.1, 32.4, 30.9, 26.0, 25.0, 27.8, 29.5, 31.2] +``` + +In this example, besides the `Daily_sales`, we also have covariates `Category`, `Base_price`, `Weekday`, `Has_promotion`, `Daily_temperature`. Let's introduce some concepts: + +**Static covariates** are covariates for each time series. +- In our example, `Category` is a **static categorical covariate**, +- `Base_price` is a **static numerical covariates**. + +**Dynamic covariates** are covaraites for each time stamps. +- Date / time related features can be usually treated as dynamic covariates. +- In our example, `Weekday` and `Has_promotion` are **dynamic categorical covariates**. +- `Daily_temperate` is a **dynamic numerical covariate**. + +**Notice:** Here we make it mandatory that the dynamic covariates need to cover both the forecasting context and horizon. For example, all dynamic covariates in the example have 14 values: the first 7 correspond to the observed 7 days, and the last 7 correspond to the next 7 days. + +We can now provide the past data of the two products along with static and dynamic covariates as a batch input to TimesFM and produc forecasts that take into the account the covariates. To learn more, check out the example in `notebooks/covariates.ipynb`. + ## Finetuning We have provided an example of finetuning the model on a new dataset in `notebooks/finetuning.ipynb`.