Skip to content

v0.5.0

Choose a tag to compare

@jer-k jer-k released this 30 Oct 01:43
· 74 commits to main since this release
b942f35

Helpers for the steps around a forecast: list the dates to forecast, check how well a model fits,
score forecasts by month or with your own metrics, and try every combination of settings. Existing
code works as before.

Added

  • makeFutureTimestamps lists the dates to forecast after a history or a timestamp, like
    Python's make_future_dataframe. The history's own dates come first unless you pass
    includeHistory: false. It takes pandas' h, D, W, W-MON to W-SAT, MS and ME, and
    matches pandas on month ends, leap years and time of day. See
    Future rows.
  • residuals predicts each measurement with a fitted model and returns actual, predicted
    and residual per row, ready to chart. It never refits. See
    Checking the fit.
  • Monthly horizons. performanceMetrics and comparePerformance take
    horizon: "calendar-month" to group forecasts by calendar months from their cutoff, like
    Python's performance_metrics(monthly=True). Scores then carry horizonMonths instead of
    horizonMs. See
    Grouping by calendar month.
  • Custom metrics, like Python's register_performance_metric. Pass your own definition next to
    the built-in names in performanceMetrics or comparePerformance, or as the objective of
    searchModels. See
    Your own metrics.
  • makeParameterGrid expands base options and lists of values into every combination, as
    candidates for searchModels, and checks each one before the search starts. See
    Trying every combination.
  • seasonalityPriorScale and holidaysPriorScale, like Python's seasonality_prior_scale and
    holidays_prior_scale. Both default to 10 and set the prior for every seasonality, or every
    event, country holiday and regressor, that doesn't set its own priorScale. As in Python,
    regressors follow holidaysPriorScale. See
    Choosing settings.
  • maximumSearchCandidates (32) is exported.

Changed

  • rows, horizons and rolling metric reports include a horizon field, "duration" or
    "calendar-month", saying which unit their horizons use.
  • Error fields accept new values: InputValidationError.input can be "parameter-grid", and
    EvaluationMetricError.metric can be a custom metric's name, with a new "zero-denominator"
    reason and score, quantile and finalize stages. Update exhaustive checks on these fields.
  • parseEventCalendar, parseRegressorDefinitions and parseCountryHolidays take an optional
    default prior scale for entries without their own. Called alone, they still default to 10.

Fixed

  • The fit span for a flat trend now counts one parameter per changepoint in parameter.count,
    matching what the engine solves for. changepoint.count stays 0, because a flat trend never
    bends.

Verification against Python Prophet

  • New fixtures check makeFutureTimestamps against make_future_dataframe, monthly and custom
    metrics against performance_metrics, and the global prior scales against Python's constructor
    options.
  • New benchmarks score cross-validation by calendar month and with custom metrics against the
    same work in Python, on identical forecast rows, and rank a model search by a custom metric.
  • New benchmarks fit country holidays, events, a seasonality and a regressor with small global
    prior scales, with and without per-component overrides.

Full Changelog: v0.4.0...v0.5.0