Repository navigation
v0.4.0
Shortcuts for everyday jobs: forecast in one call, get ranges with every forecast, flag unusual
values, and start a refit from an earlier model. Existing code works as before.
Added
forecastfits a history and predicts your future rows in one call. The result is exactly
whatfitand thenpredictreturn. The model isn't returned, so callfitandpredict
yourself when you want to reuse or save it.predictWithIntervalsreturns each forecast with its value and trend ranges, so you no
longer callpredictandpredictUncertaintyand match up their rows yourself.detectAnomalieschecks new measurements against a model you already fitted and says
whether each is below, within or above its range. The model isn't refitted, so it suits
monitoring: train on last quarter, check this week. Ranges default to 99% wide.anomaliesfits a history and returns the timestamps whose values fall outside their own
99% range, likeProphet.anomaliesin prophet-ruby. The flagged values also shape the fit, so a
large outlier can hide smaller ones; see Finding anomalies.- Warm starts, like Python's
warm_start_params.warmStartParameters(model)reads a fitted
model's parameters, and passing them asmap.warmStartstarts the next fit from there. As in
Python, the changepoint and coefficient values are used only when their counts still match.
crossValidateandsearchModelsuse the warm start for every fold. - A warm start isn't always faster, and a logistic refit after many new rows can settle on a much
worse fit, in Python too. Updating a model with new data
shows how to check for that. - Tracing spans for each new operation, and attributes on the fit span saying whether a fit was
warm-started. defaultIntervalWidth(0.8) anddefaultAnomalyIntervalWidth(0.99) are exported.
Verification against Python Prophet
- New fixtures check warm starts against Python's
warm_start_params, for linear, flat,
logistic and multiplicative models and for refits whose changepoint or coefficient counts no
longer match. - New benchmarks check
anomaliesagainst the same steps written with Python Prophet, on
linear, flat and logistic histories with known outliers. Both libraries must flag every one. - New benchmarks check warm starts against Python's
fit(df, init=warm_start_params(m)):
refit a history from an earlier fit after a day, a week or a month of new rows, for linear,
flat and logistic growth, and time the refit beside a fresh fit.
Full Changelog: v0.3.0...v0.4.0