tsseg.algorithms.prophet package
Prophet — trend change point detection via Facebook Prophet.
Description
This detector wraps Facebook Prophet’s piecewise-linear trend model. Prophet specifies a large number of potential change points uniformly placed in the first 80 % of the time series, then applies an L1-regularised (sparse) prior on the rate-change magnitudes so that most potential points go unused. The detector extracts the locations of the significant rate changes from the fitted model.
Key parameters:
n_changepoints— number of potential change points.changepoint_prior_scale(tunable insidecost_params) — controls trend flexibility (default 0.05; increase for a more flexible trend).changepoint_range(tunable insidecost_params) — fraction of the history where change points are allowed (default 0.8).
n_changepoints recommended)prophet and cmdstanpyParameters
Name |
Type |
Default |
Description |
|---|---|---|---|
|
int / None |
|
Number of potential change points. |
|
callable / None |
|
Callable that determines |
|
str |
|
Strategy for multivariate series ( |
|
float |
|
Tolerance for change-point deduplication. |
|
int |
|
Time axis. |
Usage
from tsseg.algorithms import ProphetDetector
detector = ProphetDetector(n_changepoints=10)
labels = detector.fit_predict(X)
Implementation: Wrapper around facebook/prophet. MIT.
Reference: Taylor & Letham (2018), Forecasting at Scale, The American Statistician.
Submodules
tsseg.algorithms.prophet.detector module
Prophet-based change-point detector exposed as an aeon segmenter.
- class tsseg.algorithms.prophet.detector.ProphetDetector(*, n_changepoints=5, n_changepoint_func=None, axis=0, multivariate_strategy='ensembling', tolerance=0.01)[source]
Bases:
BaseSegmenterProphet forecaster wrapped as an aeon-compatible change-point detector.
- set_fit_request(*, axis: bool | None | str = '$UNCHANGED$') ProphetDetector
Configure whether metadata should be requested to be passed to the
fitmethod.Note that this method is only relevant when this estimator is used as a sub-estimator within a meta-estimator and metadata routing is enabled with
enable_metadata_routing=True(seesklearn.set_config()). Please check the User Guide on how the routing mechanism works.The options for each parameter are:
True: metadata is requested, and passed tofitif provided. The request is ignored if metadata is not provided.False: metadata is not requested and the meta-estimator will not pass it tofit.None: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED) retains the existing request. This allows you to change the request for some parameters and not others.Added in version 1.3.
- set_predict_request(*, axis: bool | None | str = '$UNCHANGED$') ProphetDetector
Configure whether metadata should be requested to be passed to the
predictmethod.Note that this method is only relevant when this estimator is used as a sub-estimator within a meta-estimator and metadata routing is enabled with
enable_metadata_routing=True(seesklearn.set_config()). Please check the User Guide on how the routing mechanism works.The options for each parameter are:
True: metadata is requested, and passed topredictif provided. The request is ignored if metadata is not provided.False: metadata is not requested and the meta-estimator will not pass it topredict.None: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED) retains the existing request. This allows you to change the request for some parameters and not others.Added in version 1.3.