Repository navigation
v0.5.0
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
makeFutureTimestampslists the dates to forecast after a history or a timestamp, like
Python'smake_future_dataframe. The history's own dates come first unless you pass
includeHistory: false. It takes pandas'h,D,W,W-MONtoW-SAT,MSandME, and
matches pandas on month ends, leap years and time of day. See
Future rows.residualspredicts each measurement with a fitted model and returnsactual,predicted
andresidualper row, ready to chart. It never refits. See
Checking the fit.- Monthly horizons.
performanceMetricsandcomparePerformancetake
horizon: "calendar-month"to group forecasts by calendar months from their cutoff, like
Python'sperformance_metrics(monthly=True). Scores then carryhorizonMonthsinstead 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 inperformanceMetricsorcomparePerformance, or as theobjectiveof
searchModels. See
Your own metrics. makeParameterGridexpands base options and lists of values into every combination, as
candidates forsearchModels, and checks each one before the search starts. See
Trying every combination.seasonalityPriorScaleandholidaysPriorScale, like Python'sseasonality_prior_scaleand
holidays_prior_scale. Both default to10and set the prior for every seasonality, or every
event, country holiday and regressor, that doesn't set its ownpriorScale. As in Python,
regressors followholidaysPriorScale. See
Choosing settings.maximumSearchCandidates(32) is exported.
Changed
rows,horizonsandrollingmetric reports include ahorizonfield,"duration"or
"calendar-month", saying which unit their horizons use.- Error fields accept new values:
InputValidationError.inputcan be"parameter-grid", and
EvaluationMetricError.metriccan be a custom metric's name, with a new"zero-denominator"
reason andscore,quantileandfinalizestages. Update exhaustive checks on these fields. parseEventCalendar,parseRegressorDefinitionsandparseCountryHolidaystake an optional
default prior scale for entries without their own. Called alone, they still default to10.
Fixed
- The fit span for a flat trend now counts one parameter per changepoint in
parameter.count,
matching what the engine solves for.changepoint.countstays0, because a flat trend never
bends.
Verification against Python Prophet
- New fixtures check
makeFutureTimestampsagainstmake_future_dataframe, monthly and custom
metrics againstperformance_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