V0.1.19
Features
-
Prophet adapter: New
FoundationProphet, aprophet.Prophetsubclass 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),plotand Prophet'sdiagnostics.cross_validation/performance_metricskeep 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 frommodel.cross_validation(insample="cv", default), with a log message about the cost.insample="none"leaves themNaN;insample_handinsample_n_windowstune the windows. - Known-future regressors: Columns registered with
add_regressorare passed to the model asX_df, so they work with models that support native exogenous variables (e.g. Chronos-2). - Ignored Prophet arguments warn:
holidays,growth, seasonalities, changepoints,add_seasonalityandadd_country_holidaysare accepted for compatibility but do not affect a foundation model, and aUserWarningnow says so. Passing them as known-future exogenous variables is tracked in #91. - Optional extra:
prophetis installed withfoundationforecast[prophet];foundationforecast.prophetis not imported by the package root.
Tests
- Unit tests with a fake
Forecasterfor fitting, prediction, interval mapping, in-sample backtests, regressors, Prophet diagnostics, copy / pickle and the ignored-argument warnings, plusmodelstests with Chronos-Bolt and Chronos-2 regressors. See #87.
Documentation
- Prophet adapter guide with a before/after GIF, the API page for
FoundationProphet, and theprophet-adapter.ipynbexample (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