|
| 1 | +### Features |
| 2 | + |
| 3 | +* **Query Method**: Added a `query` method to the forecaster for flexible, programmatic access to model capabilities. See [#134](https://github.com/AzulGarza/timecopilot/pull/134). |
| 4 | + ```python |
| 5 | + from timecopilot import TimeCopilot |
| 6 | + |
| 7 | + tc = TimeCopilot(llm="openai:gpt-4o") |
| 8 | + tc.forecast( |
| 9 | + df="https://timecopilot.s3.amazonaws.com/public/data/air_passengers.csv", |
| 10 | + h=12, |
| 11 | + ) |
| 12 | + result = tc.query("What is the best model for monthly data?") |
| 13 | + print(result.output) |
| 14 | + ``` |
| 15 | + |
| 16 | +* **Async TimeCopilot Agent**: Introduced the `AsyncTimeCopilot` class for asynchronous forecasting and querying. See [#135](https://github.com/AzulGarza/timecopilot/pull/135) and [#138](https://github.com/AzulGarza/timecopilot/pull/138). |
| 17 | + ```python |
| 18 | + import asyncio |
| 19 | + from timecopilot import AsyncTimeCopilot |
| 20 | + |
| 21 | + async def main(): |
| 22 | + tc = AsyncTimeCopilot(llm="openai:gpt-4o") |
| 23 | + await tc.forecast( |
| 24 | + df="https://timecopilot.s3.amazonaws.com/public/data/air_passengers.csv", |
| 25 | + h=12 |
| 26 | + ) |
| 27 | + answer = await tc.query("Which model performed best?") |
| 28 | + print(answer.output) |
| 29 | + |
| 30 | + asyncio.run(main()) |
| 31 | + ``` |
| 32 | + |
| 33 | +* **Fallback Model Support**: The `TimeCopilotForecaster` now supports a fallback model, which is used if the primary model fails. See [#123](https://github.com/AzulGarza/timecopilot/pull/123). |
| 34 | + ```python |
| 35 | + from timecopilot.forecaster import TimeCopilotForecaster |
| 36 | + from timecopilot.models.foundational.timesfm import TimesFM |
| 37 | + from timecopilot.models.benchmarks.stats import SeasonalNaive |
| 38 | + |
| 39 | + forecaster = TimeCopilotForecaster( |
| 40 | + models=[TimesFM()], |
| 41 | + fallback_model=SeasonalNaive() |
| 42 | + ) |
| 43 | + ``` |
| 44 | + |
| 45 | +* **TimesFM 2.0 Support**: Added support for TimesFM 2.0, enabling the use of the latest version of Google's TimesFM model. See [#128](https://github.com/AzulGarza/timecopilot/pull/128). |
| 46 | + ```python |
| 47 | + from timecopilot.models.foundational.timesfm import TimesFM |
| 48 | + |
| 49 | + model = TimesFM( |
| 50 | + # default value |
| 51 | + repo_id="google/timesfm-2.0-500m-pytorch", |
| 52 | + ) |
| 53 | + ``` |
| 54 | + |
| 55 | +* **TabPFN Foundation Model**: Added the [TabPFN](https://github.com/PriorLabs/TabPFN) time series foundation model. See [#113](https://github.com/AzulGarza/timecopilot/pull/113). |
| 56 | + ```python |
| 57 | + import pandas as pd |
| 58 | + from timecopilot.models.foundational.tabpfn import TabPFN |
| 59 | + |
| 60 | + df = pd.read_csv("https://timecopilot.s3.amazonaws.com/public/data/algeria_exports.csv", parse_dates=["ds"]) |
| 61 | + model = TabPFN() |
| 62 | + fcst = model.forecast(df, h=12) |
| 63 | + print(fcst) |
| 64 | + ``` |
| 65 | + |
| 66 | +* **Median Ensemble**: Introduced a new Median Ensemble model that combines predictions from multiple models to improve forecast accuracy. See [#144](https://github.com/AzulGarza/timecopilot/pull/144). |
| 67 | + ```python |
| 68 | + import pandas as pd |
| 69 | + from timecopilot.models.benchmarks import SeasonalNaive |
| 70 | + from timecopilot.models.ensembles.median import MedianEnsemble |
| 71 | + from timecopilot.models.foundational.chronos import Chronos |
| 72 | + |
| 73 | + |
| 74 | + df = pd.read_csv( |
| 75 | + "https://timecopilot.s3.amazonaws.com/public/data/air_passengers.csv", |
| 76 | + parse_dates=["ds"], |
| 77 | + ) |
| 78 | + |
| 79 | + models = [ |
| 80 | + Chronos( |
| 81 | + repo_id="amazon/chronos-t5-tiny", |
| 82 | + alias="Chronos-T5", |
| 83 | + ), |
| 84 | + Chronos( |
| 85 | + repo_id="amazon/chronos-bolt-tiny", |
| 86 | + alias="Chronos-Bolt", |
| 87 | + ), |
| 88 | + SeasonalNaive(), |
| 89 | + ] |
| 90 | + median_ensemble = MedianEnsemble(models=models) |
| 91 | + fcst_df = median_ensemble.forecast( |
| 92 | + df=df, |
| 93 | + h=12, |
| 94 | + ) |
| 95 | + print(fcst_df) |
| 96 | + ``` |
| 97 | + |
| 98 | +* **GIFTEval Module**: Added the [GIFTEval](https://github.com/SalesforceAIResearch/gift-eval/) module for advanced evaluation of forecasting models. See [#140](https://github.com/AzulGarza/timecopilot/pull/140). |
| 99 | + ```python |
| 100 | + import pandas as pd |
| 101 | + from timecopilot.gift_eval.eval import GIFTEval, QUANTILE_LEVELS |
| 102 | + from timecopilot.gift_eval.gluonts_predictor import GluonTSPredictor |
| 103 | + from timecopilot.models.benchmarks import SeasonalNaive |
| 104 | + |
| 105 | + storage_path = ".pytest_cache/gift_eval" |
| 106 | + GIFTEval.download_data(storage_path) |
| 107 | + |
| 108 | + gifteval = GIFTEval( |
| 109 | + dataset_name="m4_weekly", |
| 110 | + term="short", |
| 111 | + output_path="./seasonal_naive", |
| 112 | + storage_path=storage_path, |
| 113 | + ) |
| 114 | + predictor = GluonTSPredictor( |
| 115 | + forecaster=SeasonalNaive(), |
| 116 | + h=gifteval.dataset.prediction_length, |
| 117 | + freq=gifteval.dataset.freq, |
| 118 | + quantiles=QUANTILE_LEVELS, |
| 119 | + batch_size=512, |
| 120 | + ) |
| 121 | + gifteval.evaluate_predictor( |
| 122 | + predictor, |
| 123 | + batch_size=512, |
| 124 | + ) |
| 125 | + eval_df = pd.read_csv("./seasonal_naive/all_results.csv") |
| 126 | + print(eval_df) |
| 127 | + ``` |
| 128 | + |
| 129 | +### Fixes |
| 130 | + |
| 131 | +* **Model Compatibility**: Added support for the Moirai and TimeGPT models. See [#115](https://github.com/AzulGarza/timecopilot/pull/115), [#117](https://github.com/AzulGarza/timecopilot/pull/117). |
| 132 | +* **GluonTS Forecaster**: Improved frequency handling and now uses the median for forecasts. See [#124](https://github.com/AzulGarza/timecopilot/pull/124), [#127](https://github.com/AzulGarza/timecopilot/pull/127). |
| 133 | +* **TimesFM Quantile Names**: TimesFM now returns correct quantile names. See [#131](https://github.com/AzulGarza/timecopilot/pull/131). |
| 134 | +* **Removed Lag Llama**: The Lag Llama model has been removed. See [#116](https://github.com/AzulGarza/timecopilot/pull/116). |
| 135 | +* **DataFrame Handling**: Fixed DataFrame copying to avoid index side effects. See [#120](https://github.com/AzulGarza/timecopilot/pull/120). |
| 136 | + |
| 137 | +### Docs |
| 138 | + |
| 139 | +* **Foundation Model Documentation**: Added comprehensive documentation for foundation models, including paper citations and repository links. See [#118](https://github.com/AzulGarza/timecopilot/pull/118). |
| 140 | +* **Unique Alias Validation**: Added validation to prevent column conflicts in `TimeCopilotForecaster`. See [#122](https://github.com/AzulGarza/timecopilot/pull/122). |
| 141 | + |
| 142 | +--- |
| 143 | + |
| 144 | +**Full Changelog**: https://github.com/AzulGarza/timecopilot/compare/v0.0.11...v0.0.12 |
0 commit comments