Skip to content

V0.1.19

Features

  • Prophet adapter: New FoundationProphet, a prophet.Prophet subclass that runs any foundation model instead of the Stan model. Swap it into an existing Prophet pipeline in one line: fit, make_future_dataframe, predict (ds, yhat, yhat_lower, yhat_upper), plot and Prophet's diagnostics.cross_validation / performance_metrics keep working. See #87.

    import pandas as pd
    
    from foundationforecast.models import Chronos
    from foundationforecast.prophet import FoundationProphet
    
    df = pd.read_csv(
        "https://timecopilot.s3.amazonaws.com/public/data/air_passengers.csv",
        parse_dates=["ds"],
    )
    
    model = Chronos(repo_id="amazon/chronos-bolt-tiny", alias="Chronos-Bolt")
    m = FoundationProphet(model=model)  # instead of Prophet()
    m.fit(df)  # ds, y (+ regressors)
    future = m.make_future_dataframe(periods=12, freq="MS", include_history=False)
    forecast = m.predict(future)
    
  • Historical rows: make_future_dataframe(include_history=True) is filled with rolling-origin backtest forecasts from model.cross_validation (insample="cv", default), with a log message about the cost. insample="none" leaves them NaN; insample_h and insample_n_windows tune the windows.

  • Known-future regressors: Columns registered with add_regressor are passed to the model as X_df, so they work with models that support native exogenous variables (e.g. Chronos-2).
  • Ignored Prophet arguments warn: holidays, growth, seasonalities, changepoints, add_seasonality and add_country_holidays are accepted for compatibility but do not affect a foundation model, and a UserWarning now says so. Passing them as known-future exogenous variables is tracked in #91.
  • Optional extra: prophet is installed with foundationforecast[prophet]; foundationforecast.prophet is not imported by the package root.

Tests

  • Unit tests with a fake Forecaster for fitting, prediction, interval mapping, in-sample backtests, regressors, Prophet diagnostics, copy / pickle and the ignored-argument warnings, plus models tests with Chronos-Bolt and Chronos-2 regressors. See #87.

Documentation

  • Prophet adapter guide with a before/after GIF, the API page for FoundationProphet, and the prophet-adapter.ipynb example (Air Passengers, historical rows, Belgian electricity price with known-future regressors, model comparison with Prophet's diagnostics). README and installation instructions updated.

Full Changelog: https://github.com/TimeCopilot/foundationforecast/compare/v0.1.18...v0.1.19