tseda.change_point.change_point_estimator module¶
Change-point detection utilities based on the PELT algorithm.
- class tseda.change_point.change_point_estimator.PELT_ChangePointEstimator(series: pandas.Series, model: str = 'rbf')[source]¶
Bases:
objectEstimate change points with the PELT algorithm and return a predicted segment series.
Initialize PELT estimator and fit the algorithm on the input series.
- Parameters:
series – Non-empty numeric series indexed by datetimes.
model – Cost model used by PELT (default
"rbf").
- __init__(series: pandas.Series, model: str = 'rbf') None[source]¶
Initialize PELT estimator and fit the algorithm on the input series.
- Parameters:
series – Non-empty numeric series indexed by datetimes.
model – Cost model used by PELT (default
"rbf").
- predict_series() pandas.Series[source]¶
Return the predicted segment label series.
- Returns:
Series with the same index as the input series and values such as
"segment-1","segment-2", etc.
- class tseda.change_point.change_point_estimator.ChangePointEstimator(series: pandas.Series)[source]¶
Bases:
objectCompatibility wrapper used by existing tests and call sites.
Initialize the estimator with the input series.
- Parameters:
series – Non-empty numeric series indexed by datetimes.
- __init__(series: pandas.Series) None[source]¶
Initialize the estimator with the input series.
- Parameters:
series – Non-empty numeric series indexed by datetimes.
- estimate_change_points(penalty_coeff: float = 2.0) pandas.Series[source]¶
Run PELT and assign segment labels for each observation.
- Parameters:
penalty_coeff – Multiplier applied to
log(n)when building the PELT penalty term.- Returns:
Series of segment labels aligned to the original input index.