Skip to content

Releases: AzulGarza/timecopilot

v0.0.21

28 Oct 00:31
1cf7bfd

Choose a tag to compare

Features

  • AWS's Chronos-2 foundational model: Chronos-2 has been added to the foundational models hub. Chronos-2 is a 120M parameter time series foundation model from AWS that provides state-of-the-art forecasting capabilities. You can now use Chronos-2 through the existing Chronos interface. Refer to #245 for more details.

    import pandas as pd
    from timecopilot.models.foundation.chronos import Chronos
    
    df = pd.read_csv(
        "https://timecopilot.s3.amazonaws.com/public/data/events_pageviews.csv",
        parse_dates=["ds"],
    )
    # Use Chronos-2
    model = Chronos(repo_id="s3://autogluon/chronos-2")
    fcst = model.forecast(df, h=12)
    print(fcst)

Full Changelog: v0.0.20...v0.0.21

v0.0.20

09 Oct 03:47
2e41ab3

Choose a tag to compare

Features

  • IBM's FlowState foundational model: FlowState has been added to the foundational models hub. FlowState is the first time-scale adjustable Time Series Foundation Model (TSFM), combining a State Space Model (SSM) Encoder with a Functional Basis Decoder for time-scale invariant forecasting. Refer to #234 for more details.

    import pandas as pd
    from timecopilot.models.foundation.flowstate import FlowState
    
    df = pd.read_csv(
        "https://timecopilot.s3.amazonaws.com/public/data/events_pageviews.csv",
        parse_dates=["ds"],
    )
    # Use the commercial model
    model = FlowState(repo_id="ibm-granite/granite-timeseries-flowstate-r1")
    # Or use the research model
    # model = FlowState(repo_id="ibm-research/flowstate")
    fcst = model.forecast(df, h=12)
    print(fcst)

Fixes

  • TimesFM 2.5 integration: Fixed compatibility issues with TimesFM 2.5 that were introduced in recent updates. The implementation now properly handles the new API changes in TimesFM 2.5. See #235.

  • TimesFM loading from local path: Fixed an issue where TimesFM models couldn't be loaded from local file paths. The model loading mechanism has been updated to properly handle both local and remote model sources. Thanks to @KilianZimmerer for the contribution! See #230.

New Contributors


Full Changelog: v0.0.19...v0.0.20

v0.0.19

22 Sep 23:52
31609ef

Choose a tag to compare

Features

  • Google's TimesFM 2.5 foundational model: TimesFM 2.5 has been added to the foundational models hub. Refer to #224 for more details.

    import pandas as pd
    from timecopilot.models.foundation.timesfm import TimesFM
    
    df = pd.read_csv(
        "https://timecopilot.s3.amazonaws.com/public/data/events_pageviews.csv",
        parse_dates=["ds"],
    )
    model = TimesFM(repo_id="google/timesfm-2.5-200m-pytorch")
    fcst = model.forecast(df, h=12)
    print(fcst)
  • Improved agent prompt: Enhanced the agent prompt for better performance and accuracy. See #218.

Fixes

  • Correct pydantic-ai library: Fixed the pydantic-ai library dependency to ensure proper functionality. See #221.

  • TimesFM quantiles: Fixed quantile handling for TimesFM models to ensure correct probabilistic forecasts. See #225.

Documentation

  • Time series foundation models comparison example: Added comprehensive example on how to compare time series foundational models. See #227.

  • Revamped static site: Major improvements to the static documentation site with better design and navigation. See #226.

Infrastructure

  • Documentation tests across Python versions: Added testing for documentation examples across multiple Python versions to ensure compatibility. See #220.

  • S3 URL standardization: Updated to use S3 URLs instead of URIs for better consistency. See #222.


Full Changelog: v0.0.18...v0.0.19

v0.0.18

09 Sep 03:38
13fd195

Choose a tag to compare

Features

  • Anomaly Detection Capabilities: Added comprehensive anomaly detection functionality to the forecaster, enabling identification of outliers and unusual patterns in time series data. See #213.

    import pandas as pd
    from timecopilot import TimeCopilotForecaster
    from timecopilot.models.stats import SeasonalNaive, Theta
    from timecopilot.models.foundation.chronos import Chronos
    
    # Load your time series data
    df = pd.read_csv(
        "s3://timecopilot/public/data/taylor_swift_pageviews.csv",
        parse_dates=["ds"],
    )
    
    # Create forecaster with multiple models
    tcf = TimeCopilotForecaster(
        models=[
            Chronos(repo_id="amazon/chronos-bolt-mini"),
            SeasonalNaive(),
            Theta(),
        ]
    )
    
    # Detect anomalies with 95% confidence level
    anomalies_df = tcf.detect_anomalies(df=df, h=7, level=95)
    
    # Visualize the results
    tcf.plot(df, anomalies_df)
  • fev Experiments: Added new fev experiments to expand the evaluation results. See #211.

  • Chat-like CLI Capabilities: Introduced an interactive, conversational CLI interface that enables natural language interaction with TimeCopilot. The CLI now supports seamless model switching, anomaly detection integration, and real-time plotting capabilities. See #215.

    # Start the interactive CLI
    uv run timecopilot
    
    # Natural conversation examples:
    > "forecast the next 12 months"
    > "now try this with Chronos"
    > "highlight anomalies in this series"
    > "show me the plot"
    > "explain the results"

Fixes

  • GIFT-Eval Import Corrections: Fixed import statements after refactoring in the GIFT-Eval experiment to ensure proper functionality. See #209.

  • Documentation Link Updates: Corrected links throughout the documentation after the recent refactoring to maintain proper navigation. See #210.

Documentation

  • README Improvements: Enhanced README.md with updated information and improved clarity. See #207.

Full Changelog: v0.0.17...v0.0.18

v0.0.17

28 Aug 03:13
e5fe796

Choose a tag to compare

Features

  • Moirai2 Foundation Model: Added support for the Moirai2 model, a new state-of-the-art foundation model for time series forecasting. See #177.

    import pandas as pd
    from timecopilot.models.foundation.moirai import Moirai
    
    df = pd.read_csv(
        "https://timecopilot.s3.amazonaws.com/public/data/air_passengers.csv", 
        parse_dates=["ds"]
    )
    model = Moirai(repo_id="Salesforce/moirai-2.0-R-small")
    fcst = model.forecast(df, h=12)
    print(fcst)
  • Machine Learning and Neural Forecasting Methods: Expanded the forecasting capabilities with new ML and neural methods including AutoLightGBM, AutoNHITS y AutoTFT. See #181.

  • Static Plot Method: Added a static plotting method for visualizing forecasts without requiring an agent instance. See #183.

    import pandas as pd
    from timecopilot import TimeCopilotForecaster
    from timecopilot.models.foundation.moirai import Moirai
    from timecopilot.models.prophet import Prophet
    from timecopilot.models.stats import AutoARIMA, AutoETS, SeasonalNaive
    
    df = pd.read_csv(
        "https://timecopilot.s3.amazonaws.com/public/data/air_passengers.csv",
        parse_dates=["ds"],
    )
    tcf = TimeCopilotForecaster(
        models=[
            AutoARIMA(), 
            AutoETS(), 
            Moirai(), 
            Prophet(), 
            SeasonalNaive(),
        ]
    )
    fcst_df = tcf.forecast(df=df, h=12, level=[80, 90])
    tcf.plot(df, fcst_df, level=[80, 90])
  • Enhanced Documentation with Examples: Added comprehensive examples section using mkdocs-jupyter, including interactive notebooks for agent quickstart and forecaster usage. See #176 and #198.

  • GIFT-Eval Plotting: Added plots for the GIFT-Eval experiment to better visualize model performance across different datasets. See #180.

  • Improved Date and Target Column Handling: Specify to the agent the handling of date (ds) and target (y) columns. See #139.

Refactorings

  • Clearer Models Structure: Reorganized the models module for better clarity and maintainability. Models are now organized into logical categories: stats, ml, neural, foundation, and ensembles. See #203.

    • Prophet moved from models.benchmarks.prophet to models.prophet
    • Statistical models moved from models.benchmarks.stats to models.stats
    • ML models moved from models.benchmarks.ml to models.ml
    • Neural models moved from models.benchmarks.neural to models.neural
  • Improved DataFrame Concatenation: Optimized DataFrame concatenation in feature extraction loops for better performance. See #105.

Fixes

  • OpenAI Version Compatibility: Unpinned OpenAI version to resolve compatibility issues with recent releases. See #171.

  • Median Ensemble Level Test: Relaxed test constraints for median ensemble levels to improve test reliability. See #175.

  • Documentation URL Format: Updated documentation to use kebab-case URLs for better consistency. See #200.

  • Explicit Keyword Arguments: Added explicit override handling for keyword arguments to prevent unexpected behavior. See #202.

Documentation

  • Enhanced README: Improved README content with additional information and fixed various typos. See #172, #187, #188.

  • New Logo and Branding: Added new logos and favicon for improved visual identity. See #185, #186.

  • Issue Templates: Added GitHub issue templates to streamline bug reporting and feature requests. See #193.

  • Documentation Testing: Added comprehensive tests for documentation to ensure code examples work correctly. See #194.

Infrastructure

  • CI/CD Improvements: Moved linting action to the main CI workflow for better organization. See #174.

  • Discord Release Notifications: Added automated Discord notifications for new releases. See #195, #196, #197.

  • Improved Experiment Naming: Better naming conventions for GIFT-Eval experiments. See #199.

New Contributors


Full Changelog: v0.0.16...v0.0.17

v0.0.16

08 Aug 20:26
d039c3c

Choose a tag to compare

Fixes

  • OpenAI Package Version Pinned: Recent releases of the OpenAI package have been causing a TypeError: Cannot instantiate typing.Union. For more information, see this issue. Details can be found in #167.

Full Changelog: v0.0.15...v0.0.16

v0.0.15

06 Aug 03:26
dc7a784

Choose a tag to compare

Features

  • Sundial foundational model: The Sundial model has been added to the foundational models hub. Refer to #157 for more details.
    import pandas as pd
    from timecopilot.models.foundational.sundial import Sundial
    
    df = pd.read_csv(
        "https://timecopilot.s3.amazonaws.com/public/data/algeria_exports.csv", 
        parse_dates=["ds"],
    )
    model = Sundial()
    fcst = model.forecast(df, h=12)
    print(fcst)

Fixes

  • Enhanced GIFT-Eval Experiment: The experiment now omits models identified as having potential data leakage, following the latest update to the official evaluation criteria. For more information, refer to #158 and experiments/gift-eval.

Full Changelog: v0.0.14...v0.0.15

v0.0.14

04 Aug 22:09
3a898a2

Choose a tag to compare

Experiments

  • Median Ensemble Experiment on GIFT-Eval: Introduced a median ensemble experiment on GIFT-Eval. For more details, refer to #152.

Features

  • Custom Forecaster Integration: Users can now integrate specific models into the agent for evaluation and utilization through the forecasters argument in TimeCopilot's constructor. See #153.
    from timecopilot import TimeCopilot
    from timecopilot.models.benchmarks import SeasonalNaive
    from timecopilot.models.foundational.toto import Toto
    
    tc = TimeCopilot(
        llm="openai:gpt-4o",
        forecasters=[
            SeasonalNaive(),
            Toto(),
        ]
    )
    tc.forecast(
        df="https://timecopilot.s3.amazonaws.com/public/data/air_passengers.csv", 
        h=12,
    )
    result = tc.query("What is the best model for monthly data?")
    print(result.output)

Fixes

  • Restore CLI Prettify Functionality: Resolved an issue with the prettify method affecting the CLI. This fix is included in the current release. See #154.

Full Changelog: v0.0.13...v0.0.14

v0.0.13

31 Jul 01:54
957eaae

Choose a tag to compare

Features

  • Custom seasonalitites. Added custom_seasonalities argument to [get_seasonality][timecopilot.models.utils.forecaster.get_seasonality]. See #147.

    from timecopilot.models.utils.forecaster import get_seasonality
    
    print(get_seasonality("D", custom_seasonalities={"D": 7}))
    # 7
    print(get_seasonality("D")) # default seasonalities are used
    # 1
  • GIFTEval results concatenation. Added functionality to concatenate results for different datasets when GIFTEval(...).evaluate_predictor(...) is used. See #148.

    import pandas as pd
    from timecopilot.gift_eval.eval import GIFTEval
    from timecopilot.gift_eval.gluonts_predictor import GluonTSPredictor
    from timecopilot.models.benchmarks import SeasonalNaive
    
    storage_path = ".pytest_cache/gift_eval"
    GIFTEval.download_data(storage_path)
    
    predictor = GluonTSPredictor(
        forecaster=SeasonalNaive(),
        batch_size=512,
    )
    
    def evaluate_predictor(
        dataset_name: str,
        term: str,
        overwrite_results: bool = False,
    ):
        gifteval = GIFTEval(
            dataset_name=dataset_name,
            term=term,
            output_path="./seasonal_naive",
            storage_path=storage_path,
        )
        gifteval.evaluate_predictor(
            predictor,
            batch_size=512,
            overwrite_results=overwrite_results,
        )
    
    combinations = [
        ("m4_weekly", "short"),
        ("m4_hourly", "short"),
    ]
    
    for i, (dataset_name, term) in enumerate(combinations):
        evaluate_predictor(
            dataset_name=dataset_name,
            term=term,
        )
    eval_df = pd.read_csv("./seasonal_naive/all_results.csv")
    print(eval_df) # it includes eval for the two datasets
    
    # you can use overwrite_results to generate a new file of results 
    evaluate_predictor(
        dataset_name="m4_weekly",
        term="short",
        overwrite_results=True
    )
    eval_df = pd.read_csv("./seasonal_naive/all_results.csv")
    print(eval_df) # it includes eval just for m4_weekly

Refactorings

  • GIFTEval Module: Refactored the GIFTEval module to infer horizon h and frequency freq directly from the dataset when calling GIFTEval(...).evaluate_predictor(...). See #147. New usage:

    import pandas as pd
    from timecopilot.gift_eval.eval import GIFTEval
    from timecopilot.gift_eval.gluonts_predictor import GluonTSPredictor
    from timecopilot.models.benchmarks import SeasonalNaive
    
    storage_path = ".pytest_cache/gift_eval"
    GIFTEval.download_data(storage_path)
    
    predictor = GluonTSPredictor(
        # you can use any forecaster from TimeCopilot
        # and create your own forecaster by subclassing 
        # [Forecaster][timecopilot.models.utils.forecaster.Forecaster]
        forecaster=SeasonalNaive(),
        batch_size=512,
    )
    gift_eval = GIFTEval(
        dataset_name="m4_daily",
        term="short",
        output_path="./seasonal_naive",
        storage_path=storage_path,
    )
    gift_eval.evaluate_predictor(
        predictor,
        batch_size=512,
    )
    eval_df = pd.read_csv("./seasonal_naive/all_results.csv")
    print(eval_df)
  • Median ensemble: Now it applies median plus isotonic regression for probabilistic forecasts. See #149.


Full Changelog: v0.0.12...v0.0.13

v0.0.12

29 Jul 22:52
aee218f

Choose a tag to compare

Features

  • Query Method: Added a query method to the forecaster for flexible, programmatic access to model capabilities. See #134.

    from timecopilot import TimeCopilot
    
    tc = TimeCopilot(llm="openai:gpt-4o")
    tc.forecast(
        df="https://timecopilot.s3.amazonaws.com/public/data/air_passengers.csv", 
        h=12,
    )
    result = tc.query("What is the best model for monthly data?")
    print(result.output)
  • Async TimeCopilot Agent: Introduced the AsyncTimeCopilot class for asynchronous forecasting and querying. See #135 and #138.

    import asyncio
    from timecopilot import AsyncTimeCopilot
    
    async def main():
        tc = AsyncTimeCopilot(llm="openai:gpt-4o")
        await tc.forecast(
            df="https://timecopilot.s3.amazonaws.com/public/data/air_passengers.csv",
            h=12
        )
        answer = await tc.query("Which model performed best?")
        print(answer.output)
    
    asyncio.run(main())
  • Fallback Model Support: The TimeCopilotForecaster now supports a fallback model, which is used if the primary model fails. See #123.

    from timecopilot.forecaster import TimeCopilotForecaster
    from timecopilot.models.foundational.timesfm import TimesFM
    from timecopilot.models.benchmarks.stats import SeasonalNaive
    
    forecaster = TimeCopilotForecaster(
        models=[TimesFM()],
        fallback_model=SeasonalNaive()
    )
  • TimesFM 2.0 Support: Added support for TimesFM 2.0, enabling the use of the latest version of Google's TimesFM model. See #128.

    from timecopilot.models.foundational.timesfm import TimesFM
    
    model = TimesFM(
        # default value
        repo_id="google/timesfm-2.0-500m-pytorch",
    )
  • TabPFN Foundation Model: Added the TabPFN time series foundation model. See #113.

    import pandas as pd
    from timecopilot.models.foundational.tabpfn import TabPFN
    
    df = pd.read_csv("https://timecopilot.s3.amazonaws.com/public/data/algeria_exports.csv", parse_dates=["ds"])
    model = TabPFN()
    fcst = model.forecast(df, h=12)
    print(fcst)
  • Median Ensemble: Introduced a new Median Ensemble model that combines predictions from multiple models to improve forecast accuracy. See #144.

    import pandas as pd
    from timecopilot.models.benchmarks import SeasonalNaive
    from timecopilot.models.ensembles.median import MedianEnsemble
    from timecopilot.models.foundational.chronos import Chronos
    
    
    df = pd.read_csv(
        "https://timecopilot.s3.amazonaws.com/public/data/air_passengers.csv",
        parse_dates=["ds"],
    )
    
    models = [
        Chronos(
            repo_id="amazon/chronos-t5-tiny",
            alias="Chronos-T5",
        ),
        Chronos(
            repo_id="amazon/chronos-bolt-tiny",
            alias="Chronos-Bolt",
        ),
        SeasonalNaive(),
    ]
    median_ensemble = MedianEnsemble(models=models)
    fcst_df = median_ensemble.forecast(
        df=df,
        h=12,
    )
    print(fcst_df)
  • GIFTEval Module: Added the GIFTEval module for advanced evaluation of forecasting models. See #140.

    import pandas as pd
    from timecopilot.gift_eval.eval import GIFTEval, QUANTILE_LEVELS
    from timecopilot.gift_eval.gluonts_predictor import GluonTSPredictor
    from timecopilot.models.benchmarks import SeasonalNaive
    
    storage_path = ".pytest_cache/gift_eval"
    GIFTEval.download_data(storage_path)
    
    gifteval = GIFTEval(
        dataset_name="m4_weekly",
        term="short",
        output_path="./seasonal_naive",
        storage_path=storage_path,
    )
    predictor = GluonTSPredictor(
        forecaster=SeasonalNaive(),
        h=gifteval.dataset.prediction_length,
        freq=gifteval.dataset.freq,
        quantiles=QUANTILE_LEVELS,
        batch_size=512,
    )
    gifteval.evaluate_predictor(
        predictor,
        batch_size=512,
    )
    eval_df = pd.read_csv("./seasonal_naive/all_results.csv")
    print(eval_df)

Fixes

  • Model Compatibility: Added support for the Moirai and TimeGPT models. See #115, #117.
  • GluonTS Forecaster: Improved frequency handling and now uses the median for forecasts. See #124, #127.
  • TimesFM Quantile Names: TimesFM now returns correct quantile names. See #131.
  • Removed Lag Llama: The Lag Llama model has been removed. See #116.
  • DataFrame Handling: Fixed DataFrame copying to avoid index side effects. See #120.

Docs

  • Foundation Model Documentation: Added comprehensive documentation for foundation models, including paper citations and repository links. See #118.
  • Unique Alias Validation: Added validation to prevent column conflicts in TimeCopilotForecaster. See #122.

Full Changelog: v0.0.11...v0.0.12