Changelog#
This changelog highlights notable updates. For full commit history, refer to GitHub.
Unreleased#
Fix
EAggloDetector(member=...)for sorted negative or fractional cluster labels that collided during relabelling. Equivalent initial partitions now produce the same segmentation instead of raisingZeroDivisionError.Move the E-Agglo diagnostic and calibration scripts and the SNLDS audit script and results to
scripts/diagnostics/.examples/now contains only the worked gallery examples and their supporting files; detector guides use the updated commands.Clarify the getting-started guide’s constructor-based guidance: passing
ydoes not set change-point or state counts for the illustrated detectors, and DynP still uses a fixed count whenn_cpsis omitted. Correct the link to the installation guide.Add a Contributor Covenant Code of Conduct, contribution workflow, security policy and support guide, with GitHub issue forms and a pull request template.
New online detector
FLOSSDetector(FLOSS, Gharghabi et al., ICDM 2017), the online counterpart ofFLUSSDetector: it keeps the lastsliding_window_sizepoints (10,000 by default), updates their one-directional matrix profile point by point withstumpy.floss, and reports a change point where the one-directional corrected arc curve drops belowthreshold(0.45 by default), at leastexclusion_factor * window_sizepoints after the previous one. Univariate and multivariate (mean of the curves of the channels), unsupervised; needs theflussextra.FLUSSDetectorand its outputs are unchanged.New
OnlineF1Score(max_delay=...)metric for online event logs. Matching uses the first detection time in each true change’s half-open deadline interval, bounded by the next change. Returns F1@D, precision, recall, mean/median detection delay, false alarms per 10,000 observed points and mean localization error. Existing metrics and detector outputs are unchanged.SNLDSDetectoris now reproducible at a fixedrandom_state: two fits give the same weights and labels, and two calls topredicton one fitted model give the same labels. The inference network samples the continuous states in a TensorFlow while loop that runs up to ten steps in parallel; with one stateful seed, the steps took their noise draws in a variable order. Each step now samples with a stateless seed derived from one seeded draw per call and the step index, retaining the parallel loop. Thenon_deterministictag is now set only whenrandom_state=None. Outputs change (other noise draws from the same distribution), so SNLDS scores need to be recomputed, as they already did after the new training defaults below.Online detection: new base class
tsseg.algorithms.base_online.BaseOnlineSegmenterand tagcapability:online(Falsefor every existing detector). An online detector ingests a stream withupdate(X), which returns the change points detected meanwhile as events (position,detection_time,score; append-only log inevents_);predict(X)replays the stream on a copy, so batch use, metrics and the generic tests are unchanged. Existing detectors and their outputs are unchanged.New online detector
ClaSSDetector(ClaSS, Ermshaus et al., PVLDB 2024), vendored from claspy 0.2.8 (BSD-3-Clause) with the split rule of the authors’ code: a change point within5 * window_sizeof the window edge is rejected and the next segment starts at the reported change point (claspy placed a change that had just entered the window early). Univariate, unsupervised,numbarequired (tsseg[accelerators]). Mean Covering 0.848 on the 75 TSSB series (claspy: 0.838; authors’ code: 0.807). 2024), vendored from claspy 0.2.8 (BSD-3-Clause; same change points and detection times as claspy). Univariate, unsupervised,numbarequired (tsseg[accelerators]). Mean Covering 0.838 on the 75 TSSB series (authors’ code: 0.807).The
acceleratorsextra and the Conda environment recipe no longer request Cython, which tsseg does not use. Numba and detector behaviour are unchanged. Install Cython explicitly for other packages or manual source builds that require it; existing installations retain it.New online detector
ChangeFinderOnlineDetector(ChangeFinder, Takeuchi & Yamanishi, TKDE 2006). Its change point score is that ofChangeFinderDetector, equal at every point and computed as the stream arrives; an alarm is raised when the score crosses a threshold (by default the mean plus two standard deviations of the positive scores seen so far), at leastmin_distancepoints (20, the paper’s alarm policy) after the previous one, and the change point is placed at the largest first-stage score among the lastsmooth_windowpoints. Univariate and multivariate (L2 norm of the channels), unsupervised.ChangeFinderDetectorand its outputs are unchanged.
0.5.0 (2026-11-29)#
Upgrading from 0.4.0: outputs change for TireDetector (every domain,
including the default domain="both"), TiccDetector (window_size >
1), SNLDSDetector (new training defaults) and FLUSSDetector (its
default "ensembling" strategy); earlier scores of these detectors need to
be recomputed. Outputs may change for EspressoDetector (three or more chain
expansions), for the "ensembling" strategy of BOCDDetector,
BeastDetector and ChangeFinderDetector (whose default tolerance is
now 1% for BOCD and ChangeFinder), for model="normal" of the ruptures
detectors and for LaplacianDetector on duplicate frames or zero
bandwidths. The other detectors keep their outputs with their defaults.
Active detector constructors are keyword-only: positional calls still work
with a FutureWarning for at least one release. New:
FLUSSDetector(multivariate_strategy="cac_mean").
ESPRESSO’s matrix profile now returns z-normalised Euclidean distances directly. The FFT helper already took their square root; a second root at the self-join return transformed the distances again. Nearest-neighbour indices are unchanged. Semantic densities and change points may change with three or more chain expansions, whose cost budget depends on the distance values; no detection-quality improvement is established.
SNLDSDetectorhas new training defaults:learning_rate=1e-3(was1e-4),use_temperature_annealing=Falseanduse_cross_entropy_reg=False(both wereTrue);n_train_stepsstays 2,000. This is the regime of the paper’s bouncing ball experiment. Compressed into 2,000 steps, the Reacher schedules kept the learned transitions near uniform, and the labels switched hundreds of times. On the nine bundled MoCap trials (true number of states, three seeds each), the mean ARI goes from 0.078 to 0.171 and the bidirectional covering from 0.035 to 0.203 (better on 26 of 27 fits), with three times fewer label changes and the same fit time. Default outputs change, and earlier SNLDS scores need to be recomputed; the former behaviour isSNLDSDetector(learning_rate=1e-4, use_temperature_annealing=True, use_cross_entropy_reg=True). SNLDS stays experimental: a single MoCap fit of the 27 reaches an ARI of 0.7, and the labels still change about 1,100 times per trial for 5 to 10 true changes.The extras table of the README and of the installation guide now lists every detector that
tsseg[accelerators]speeds up:GaussianHMMDetectorand the numba backend ofPeltDetector,DynpDetector,BinSegDetector,BottomUpDetector,WindowDetectorandSeededBinSegDetectorwere missing. All of them still run without numba.The Gaussian likelihood cost (
model="normal"ofPeltDetector,DynpDetector,BinSegDetector,BottomUpDetectorandWindowDetector) no longer depends on the scale of the series, and itspen_scale="bic"is the BIC penalty. Three defects are fixed:pen_scale="bic"scaled the penalty by the absolute log-determinant of the whole series, which moves with its scale and is close to 0 on z-normalised channels, so white noise was cut at every admissible point; it is nowpenalty * log(n) * d(d+3)/2, the d means and d(d+1)/2 covariances of one more segment. The covariance ridge was an absolute1e-6, so on a series of small amplitude it masked the changes; it is now1e-6times the mean channel variance of the series. Segments of at most d samples, whose covariance is singular, were admissible and only the ridge set their cost; the cost’smin_sizeis nowmax(2, d + 1), which the searches apply at fit (WindowDetectorraisesNotEnoughPointswhenwidth // 2is smaller). The segment covariance is the maximum likelihood one (ddof=0) for every dimension, as it already was for one channel. Outputs change formodel="normal"only.EspressoDetectornow uses MATLAB’s half-away-from-zero rounding for the matrix-profile exclusion radius and compares chain separation with the unrounded quarter-window threshold, as in the original implementation. Outputs may change for some custom window sizes; the default64and windows32and128are unaffected by these corrections.FLUSSDetectoracceptsmultivariate_strategy="cac_mean": the corrected arc curves of the channels are averaged, then the change points are extracted from that mean curve as on a univariate series (at mostn_segments - 1minima below 1, or the minima belowthresholdwithn_segments=None). This is the multivariate FLUSS of Gharghabi et al. (DMKD 2019, section 3.4).profileholds the mean curve;toleranceandconsensusare not used. Opt-in: the default ("ensembling") and the other strategies keep their outputs, and univariate series ignore the strategy.TireDetectornow expresses its comparison lag, domain-weight distances and both smoothing half-widths asceil(window_size / stride)window rows. Outputs change forstride > 1: these scales no longer grow with the stride, and fractional score centers are retained during interpolation. Scores atstride=1are unchanged for comparable window pairs. When no pair can be compared, postprocessing returns zero scores.TireDetector(domain="FD")no longer trains the time domain autoencoder, whose features it discarded. Its outputs change at equalrandom_state(that training drew from the torch random stream before the frequency domain autoencoder was initialised, so the time domain settings changed the result) and it runs faster. This fix affectsdomain="FD"only.TireDetectornow follows the paper (De Ryck et al. 2021) on three points, so its outputs change in every domain, including the defaultdomain="both", and earlier TIRE scores need to be recomputed:each channel is rescaled to [-1, 1] on the whole series before the windows are cut (§III-B). The time domain autoencoders received the raw values, out of reach of their
tanhoutput on unnormalised data, and channels of larger amplitude weighed more. A constant channel is set to 0. A constant series still gives zero scores and no change point, even withn_segments, now without training the autoencoders (its frequency features were NaN);on multivariate series the frequency domain input is the Fourier transform of the window of each channel, rescaled channel by channel and concatenated (eq. 3). The concatenated windows were transformed with
nfftpoints, which cut them: with the defaults (window_size=20,nfft=30) only the first channel and ten points of the second were seen. Univariate frequency features are unchanged;the shared features are smoothed by the triangular moving average in the
"TD"and"FD"domains too, not only in"both"(eq. 11, as in the original code).
TiccDetectornow trains on every complete window, including the final observations, and uses every window in assignment costs, log-likelihood and BIC. The reference solver truncated the finalwindow_size - 1windows, padded them with zeros and omitted their costs, which also assigned arbitrary state 0 to the tail withbeta=0. Fitted outputs and selected state counts can change whenwindow_size > 1; earlier TICC scores need to be recomputed. Window-start label alignment, the final-label extension, constructor defaults and the unusedthresholdare retained.Change the default
toleranceofChangeFinderDetectorandBOCDDetectorfrom0to0.01(1% of the series length), asFLUSSDetectorand the default margin ofF1Score. The tolerance only acts withmultivariate_strategy="ensembling": with0, only identical indices of different channels were grouped, so a change seen a few samples apart by several channels got one vote per channel and a guided run (n_cpsormax_cps) kept the earliest change points (channel change points[100, 600],[104, 603]and[350]on 1000 samples with two change points asked for gave[100, 104], now one change point near 100 and one near 600). Withoutn_cps, ChangeFinder ensembling usedmin_distanceas the tolerance and now uses 1% of the length. Ensembling outputs change and earlier ensembling scores need to be recomputed; the default strategies ("l2"for ChangeFinder,"native"for BOCD) are not affected. An explicittolerance=0keeps the previous outputs, and so does a series shorter than 100 samples, where 1% rounds down to 0 samples.LaplacianDetectorretains exact-zero mutual-neighbour links with affinity 1 instead of dropping duplicate frames from the recurrence graph. A zero recurrence or path bandwidth uses its positive-bandwidth limit: zero distances get weight 1 and positive distances get weight 0. A path with median squared distance zero previously gave every edge weight 1, including jumps between distinct plateaus. Graphs can now be disconnected and affected outputs can change. The cosine metric, public parameters, positive-bandwidth formulas and state-count selector are unchanged.Fix the fusion of the per-channel change points of
multivariate_strategy="ensembling"(BOCDDetector,BeastDetector,FLUSSDetector,ChangeFinderDetector). The change points of all channels were pooled into one list, so several points of a single channel outvoted channels that agree, and points closer thantoleranceto the previous one were chained into one cluster returned as its median, possibly an index detected by no channel ([10, 14, 18, 22]on four channels withtolerance=4gave[16]). Each observed change point is now supported by the channels with a change point withintolerance; change points are taken by decreasing support, then by closeness of the supporting channels, and one withintoleranceof a change point already taken is dropped. The number of change points asked for is an upper bound: fewer are returned when the dropped candidates leave too few.consensus_change_pointsapplies the same rule. Withtolerance=0(the default of BOCD, BEAST and ChangeFinder withn_cps) outputs are unchanged; otherwise ensembling outputs change and earlier scores need to be recomputed. The default strategies ("native","l2") are not affected, except FLUSS, whose default is"ensembling"withtolerance=0.01.aggregate_change_pointsis unchanged and no longer used by the detectors.Active detector constructors now expose keyword-only parameters with
axis: int = 0last. Existing positional calls retain their original argument binding and emitFutureWarning; compatibility will remain for at least one released version before removal in a future breaking release.AutoPlaitDetector,EAggloDetector,GreedyGaussianDetector,InformationGainDetectorandRandomDetectornow acceptaxisat construction. Other parameter names and defaults are unchanged; deprecated detectors retain their signatures.
0.4.0 (2026-11-18)#
Upgrading from 0.3.2: outputs change for BOCDDetector (new defaults: native
multivariate Gaussian likelihood and MAP decoding), for BeastDetector on
multivariate series, for SNLDSDetector, and for any detector constructed
with axis=1; earlier scores of these detectors need to be recomputed. With
the default axis=0, the other detectors keep their outputs, except a refit
of TSCP2Detector, which no longer reuses the threshold learned on its first
series (now in threshold_). GaussianF1Score pairs change points
optimally (scores can only increase) and WeightedAdjustedRandIndex may
differ slightly on short series; the metrics accept scored_intervals for
partially annotated references. Unused helpers of the TIRE, CLaP and E2USD
modules are removed without deprecation. New:
LaplacianDetector, CachalotDetector and TrendFilteringDetector
(extra tsseg[l1tf]).
Fix numerical errors in
SNLDSDetector: the complete-data score now associates each emission with the destination state, and ELBO/IWAE use the exact log likelihood marginalized over discrete paths instead of omitting their posterior entropy. Gaussian covariance parameters configured as trainable are now tracked by Keras and receive gradients;rnn_type="lstm"now constructs both initial states on Keras 3. Segmentation outputs change. The detector remains experimental. Its documentation separates historical scores from the corrected implementation and explains computational and modelling limitations; a diagnostic script supports small before/after runs.New
TrendFilteringDetector: l1 trend filtering (Kim, Koh, Boyd and Gorinevsky, SIAM Review 2009) as a convex-relaxation baseline. On every channel it estimates the piecewise-linear trend that minimises1/2||y - x||^2 + lambda ||D x||_1through the dual box-QP of the paper (section 5.2), by OSQP with an exact active-set polish, and reports the kinks of the trend as change points;lambda_max_(paper, eq. 7) gives the scale of the penalty, above which the estimate is the best affine fit. Multivariate series use the “sum of l1 norms” extension (section 7.5); the group-penalty variant needs a conic solver and is not implemented. Optional dependency:tsseg[l1tf](OSQP, Apache-2.0).Standardise the Cachalot README and detector guide: clarify the distinction between its total-variation Lasso candidates and the complete algorithm, document time and memory costs, verify references, and remove benchmark scores and implementation history from the overview. The taxonomy’s convex relaxation category also covers candidate generation followed by post-selection, with Cachalot identified as a Lasso / reduced-DP hybrid.
EAggloDetectorcomputes the quadratic initial distance loops and candidate-merge scans inside Numba, skips repeated membership scans for default singleton clusters, and evaluates penalties without retaining a Python list for every partition. The statistic and returned segmentation are unchanged. A local 4,000-point, four-channel example took 1.67 s instead of 18.06 s after initial compilation; time and memory remain quadratic. The detector guide andscripts/diagnostics/eagglo_diagnostics.pyexplain and illustrate the distinct causes of over-segmentation: the inheritedecpstatistic, penalty scale, initial partition and serial dependence. A separate MoCap calibration example recommends per-channel z-normalisation,alpha=0.5, blocks of 200 and no penalty: mean BiCovering 0.718 on the nine original trials, against 0.272 with the defaults; leave-one-trial-out parameter selection gives 0.688. The constructor defaults are unchanged, and the profile limits boundary resolution to 200 observations.Fix native BOCD Gaussian evidence for scatter matrices that are diagonal to rounding precision, with channel variances at very different scales. Direct diagonal evaluation preserves their resolved small variances, including when
standardize=False.BOCDDetectornow defaults to a native multivariate Gaussian likelihood with full covariance and joint maximum a posteriori (MAP) decoding. The likelihood reduces exactly to Normal-Gamma in one dimension. Channels are standardised by default (standardize=Falsekeeps physical prior units);beta=10andhazard_lambda=1000were selected on a 15-series pilot with synthetic sanity checks.max_cpsconstrains the MAP partition to at most that many changes, andmin_distanceconstrains all segment lengths during inference. A regular grid of at most 2,000 interior candidates bounds the search (max_candidates=Noneuses every position), while every observation still contributes to segment likelihoods. Unconstrained inference uses linear working memory in the series length and candidate count; a count-constrained MAP also stores scores by candidate and change count. Native covariance evaluation uses stable block moments and Cholesky with an eigenvalue fallback for a very small prior ridge. The L2 and per-channel strategies remain available; the final ensemble also respects the minimum spacing.decoding="marginal"retains a probability-based alternative with a default threshold of 0.5 and no truncation (truncate=None). These parameters do not affect MAP decoding. Detection outputs and defaults change; earlier BOCD benchmark results need to be recomputed.Fix
BOCDDetectorinference: a constant hazard now defines a geometric segment-duration prior, with right censoring of the final segment. Boundary probabilities are marginal events rather than scores normalised to sum to one; the latter imposed an artificial limit of 20 candidates at the default threshold of 0.05. A forward-backward recursion with stable running moments replaces the cubic-time, quadratic-memory ordinal change-point calculation: the detector now uses quadratic worst-case time and linear inference memory, without new dependencies. The Normal-Gamma evidence also includes its missing factor2**(-n/2), which cancels between full-series segmentations.truncateuses natural logs (exp(truncate)), as the original comparison did; documentation incorrectly said10**truncate.max_cps=0skips inference. Detection outputs change; earlier BOCD benchmark scores need to be recomputed.BeastDetectorwithmultivariate_strategy="native"(the default for multivariate series) no longer returns the union of the candidates of its channels. Each channel gives up to the maximum oftcp_minmax(10 by default) and, on real series, most channels give that many, so the number of change points grew with the number of channels. Candidates are now ranked by their support, the probability (cpPr) of the same change summed over the channels, then by their own probability; withoutmax_cps, as many are returned as the median number of candidates of the channels that have any. Withmax_cps, the most supported are kept. Outputs change on most multivariate series.BeastDetector: amax_cpsabove the maximum oftcp_minmax(or ofscp_minmax, when the seasonal change points are returned) raises that maximum tomax_cps. Rbeast never returns more change points per component and channel, somax_cpscould not be reached on a univariate series, with"l2", or on any channel. With both changes, on the first 2,000 points of 435 real series from 47 datasets (z-normalised channels, default parameters),"native"withoutmax_cpsrises from F1 0.140 to 0.186 and bidirectional covering 0.326 to 0.511 (15 times the true number of change points in the median multivariate series, now 3), and withmax_cpsset to the true number from 0.384 to 0.403 and 0.681 to 0.698;"l2"withmax_cpsreturned fewer change points than asked on 29 % of the series, now 5 %.BeastDetectorwithmultivariate_strategy="native"(the default) runsbeast123on one channel at a time. Given the whole array, Rbeast 0.1.25 fits its columns independently, in threads pinned to CPUs 0, 1, … whatever CPUs the process may use. In a process that may not use these CPUs (a job of a cluster scheduler that allots it other CPUs, a container limited to some CPUs), the threads were not created: Rbeast returned unset outputs, hence no change point or wrong ones on every multivariate series, and corrupted the memory, which killed the process later (segmentation fault). Where the threads were created, the change points can differ from before: Rbeast fits a column of a 2D array and a single series with different routines (beastv2_COREV4_mthrd.candbeastv2_COREV4.c), whose outputs differ at the same seed;"native"now uses the routine of univariate series and of"ensembling"everywhere. The channels are now fitted one after the other, not in parallel, and a multivariate series of two points gets no change point without a call to Rbeast.Metrics on partially annotated references:
F1Score,Covering,BidirectionalCoveringand the six state detection metrics take a keyword-onlyscored_intervals, the half-open intervals of the points to score, and the newtsseg.metrics.scored_islandsderives them from a label sequence (for example the runs that are not-1). The series keeps its length: ARI, AMI and NMI score the scored points; WARI and WNMI measure their distance weights inside each interval, its edges included, before leaving out the other points; SMS fits one mapping on the scored points, stops error segments at the edges of the intervals and divides its losses by the number of scored points (masked SMS); F1 judges only the change points inside an interval and never matches across a gap; Covering and BiC clip segments to the intervals. Without the argument, or with one interval covering the series, the scores are unchanged. The boundary distances of WARI and WNMI are now computed without a loop over the points (same values), which makes them usable on series of a million points.New
LaplacianDetector(state detection, unsupervised or guided): the Laplacian structural decomposition of McFee & Ellis (ISMIR 2014) applied to windows of a series. Frames are linked to their mutual nearest neighbours (recurrence) and to their neighbours in time (path), and k-means on the smallest eigenvectors of the normalised Laplacian gives the states. Unlike the librosa example and msaf, the filtered recurrence matrix is symmetrised, so that the matrix decomposed is a graph Laplacian. Withoutn_states, the number of states is the geometric mean of the number of Louvain communities of the recurrence graph and of the best silhouette. The recurrence, the diagonal median filter and Louvain are ported from librosa (ISC) and NetworkX (BSD-3), which are not dependencies. With the true number of states, mean SMS 0.717 on the 592 series of TSB-SEG, against 0.692 for CLaP.WeightedAdjustedRandIndexuses the weighted pair counts as real numbers, as its definition does, instead of truncating them to integers (a step inherited from the scikit-learn ARI, whose counts are integers). The truncation shifted scores on short series (0.2005instead of0.2012on 20 points, up to about5e-4on 50 points) and is invisible at three decimals beyond about 200 points. Labelings that agree up to a renaming of the states score exactly1.0at any length, a case now read from the contingency table: on series of a few hundred thousand points, the truncated counts could give1 ± 2e-16. WARI scores of short series computed with 0.3.2 or earlier may differ slightly from this version.GaussianF1Scorepairs predicted and true change points by an optimal assignment, which maximises the total reward (scipy.optimize.linear_sum_assignment), instead of taking the largest rewards first. The greedy pairing could fall short of the best total when change points are less than a few widths apart: withsigma = 4, true[100, 104]and predicted[103, 107]earned1.19instead of1.51. Scores can only increase, since a greedy total never exceeds the optimal one, and they differ noticeably only where several change points lie within a few widths of each other. Gaussian F1 scores computed with 0.3.2 or earlier may be slightly lower than with this version.New
CachalotDetector: Lasso-path candidates refined by reduced dynamic programming and selected by relative residual improvement (Harchaoui and Lévy-Leduc, 2007). Multivariate input is handled channel by channel, with the returned change points formed by their union. The structured path costsO(n K)per channel without dense matrices; reduced DP costsO(K^3). Endpoint decisions are invariant to signal units, constant decimal-valued signals produce no candidates, andnumust be finite. Documentation records the limits of the channel union and the unresolved gap with the paper’s Monte Carlo precision.Documentation: new design (PyData Sphinx theme, light and dark modes, copy buttons on code blocks) and a new home page; installation instructions move to their own page. The
docsextra now installspydata-sphinx-themeandsphinx-copybuttoninstead ofsphinx-rtd-theme.Documentation: new interactive taxonomy of the detectors, placed by search procedure and homogeneity criterion as in TSB-SEG, with search, filters (task, guided or unsupervised, multivariate, optional extra, deep learning), a sortable list and a link to each detector page; each detector page links back to its place in the grid. The capabilities shown are read from the estimator tags, and the build fails when a public detector is missing from the taxonomy.
Documentation: the evaluation page illustrates each metric with a figure on a small example, whose scores are computed by the metrics at build time. Metric pages and signatures show the class name alone (
F1Score, nottsseg.metrics.F1Score).Documentation: ClaSP (change point detection) and CLaP (state detection) get a page each, under their task, and the sidebar of the detector pages groups the detectors by task. Change point detection is shown in blue, in the taxonomy too. The home page shows the overview figure of the README and keeps three highlights. Em dashes are replaced by en dashes.
Documentation: new examples section, eight worked examples on public data (Jekyll and Hyde, storm surge at The Battery, a chloroplast genome, expressions in climate research titles, human activities in the bundled motion-capture data, the British generation mix, returning speakers and sleep stages). Each one uses a single detector (PELT, CLaP, TICC or HDP-HSMM), checks the result against a reference never used for fitting, and provides a figure, data and code. The examples run offline from
examples/galleryin a source checkout and are not installed with the package.Documentation and README: a new figure for the interactive demo (
assets/demo.svg) replaces the screenshotassets/demo.png: the sample dataset of the demo, its ground truth, the change points of BottomUp and the states of Time2State, each scored against the truth.Fix
axis=1given to a detector’s constructor:Foo(axis=1).fit(X)on a series of shape(n_channels, n_timepoints)now segments it asFoo().fit(X.T)does. The base class handed such a detector its series in that layout, which almost every detector reads as(n_timepoints, n_channels): BOCD, BottomUp, ChangeFinder, ChangeForest, ClaSP, CLaP, Dynp, GaussianHMM, ICID, PELT, Prophet, SeededBinSeg, SNLDS and SST returned wrong change points or labels without an error, while FLUSS, RuLSIF, TGLAD, TICC, TS-CP2 and Window raised one; a 1D series became a single time point withnchannels. The defaultaxis=0andfit(X, axis=1)are unchanged._fitand_predictnow always receive(n_timepoints, n_channels): a detector that subclassesBaseSegmentermust not transpose its input itself, and AMOC, BinSeg, E2USD, ESPRESSO, HDP-HSMM, Hidalgo, Time2State and TIRE no longer do.The test of
BeastDetectoron a 6,000-point series no longer expects a failure on CPUs that support AVX-512: in continuous integration, Rbeast returned NaN for every output on that series in 10 of 177 test jobs, all on such CPUs, and the rerun with its SSE routines found the change point every time. The BEAST page says so.Fix the affiliation of John Paparrizos (The Ohio State University and Aristotle University of Thessaloniki) in the README,
CITATION.cffand the home page.Helpers that nothing in the package calls are removed, without deprecation (none is part of
tsseg.algorithms):parameters_to_cps,cp_to_timestamps,tpr_fprandminmaxscaleoftsseg.algorithms.tire.utils, with commented-out plotting code;roll_array,normalize_time_series,create_sliding_window,expand_label_sequence,collapse_label_sequenceandextract_cpsoftsseg.algorithms.clap.utils; andE2USD.online_threshold_clusteroftsseg.algorithms.e2usd.e2usd. Three of them did not work:roll_arrayreturned uninitialised memory,normalize_time_seriesraisedNameErrorandonline_threshold_clusterraisedAttributeError. Usetsseg.algorithms.utils.extract_cpsinstead of the removedextract_cpsof CLaP; it gives the same change points. The detectors are unchanged.TSCP2Detectorstores the similarity threshold it learns in the new fitted attributethreshold_instead of writing it into thesimilarity_thresholdparameter. Withsimilarity_threshold=None(the default) and non_cps, a secondfiton another series, a clone of a fitted detector and a refit byrefit_on_predictafter two fits reused the threshold learned on the first series, so they could return other change points than a new detector. A single fit followed bypredictis unchanged.
0.3.2 (2026-11-05)#
Upgrading from 0.3.1: ClaspDetector, ClapDetector and
TGLADDetector now segment a series passed to predict that differs from
the one given to fit, with a warning, instead of returning the output of the
fitted series; results on the fitted series are unchanged. Python 3.13 and 3.14
are supported, and tsseg[tscp2] accepts TensorFlow 2.19 and later. New:
SSTDetector.
New
SSTDetector: singular spectrum transformation (Idé and Inoue, SDM 2005; Idé and Tsuda, SDM 2007), with the fast randomised SVD of Weber and Lenz (IEEE Access, 2025). The score compares the leading future direction of a Hankel matrix with the dominant subspace of the past one, which captures changes of dynamics (frequency, autocorrelation) as well as of level;method="exact"uses a full SVD. Guided only (n_cpshighest peaks); multivariate series share one subspace. Default window (200), rank (3) and peak spacing calibrated in guided mode on the change-point datasets of TSB-SEG. Written from the papers.ClaspDetector.predict(X),ClapDetector.predict(X)andTGLADDetector.predict(X)segment or labelXwhen it is not the series given tofit. They returned the output of the fitted series whateverX: its change points or labels on another series of the same length, and on a shorter series change points beyond its end (ClaspDetector,TGLADDetector) or as many labels as the fitted series has time points (ClapDetector). A new series is segmented or labelled with a new fit, with a warning, and the fitted attributes are left unchanged, as inEAggloDetector,HidalgoDetectorandTiccDetector;fit_predictandpredicton the fitted series are unchanged.Python 3.13 and 3.14 are supported, and tested by the CI.
tsseg[tscp2]no longer caps TensorFlow below 2.19, which has no wheel for Python 3.13 or later, sopip install "tsseg[all]"works on Python 3.13 (Google Colab, for instance);TSCP2Detectorruns with TensorFlow 2.21 and Keras 3. It excludes keras-tcn 3.5.7, which requirestensorflow-macoson every platform. On Python 3.14,tsseg[all]leaves outtsseg[tscp2]andtsseg[snlds]: TensorFlow has no stable release for it yet, nor tf-keras any release. On Python 3.13 and later, Rbeast 0.1.25 printsException ignored in PyObject_HasAttrString()messages at each call ofBeastDetector; its change points are unaffected.
0.3.1 (2026-11-02)#
Upgrading from 0.3.0: several fixes change the output of TSCP2Detector,
Time2StateDetector and E2USDDetector (last points of the series),
ChangeFinderDetector, ClaspDetector and ClapDetector given a
number of change points, FLUSSDetector with n_segments,
TireDetector with stride > 1, BeastDetector, and
GreedyGaussianDetector on multivariate series: results computed with 0.3.0
can differ. New defaults: TGLADDetector trains for 2000 epochs, and
TiccDetector chooses its number of states when n_states is not given.
AutoPlaitDetector no longer needs a C binary (it uses numba,
tsseg[accelerators]); HidalgoDetector takes keyword arguments only;
get_fitted_params of six detectors returns their fitted attributes;
tsseg.TGLADDetector is deprecated in favour of
tsseg.algorithms.TGLADDetector. New: SeededBinSegDetector and the
tsseg[fluss] extra.
AmocDetector,BeastDetector,BinSegDetector,EspressoDetector,FLUSSDetectorandHdpHsmmDetectorno longer redefineget_fitted_params: they now use the method of the base class, like every other detector. Their versions did not acceptdeep(get_fitted_params(deep=False)raised aTypeError), did not raiseNotFittedErrorbeforefit, and returned something else than the fitted attributes: hyperparameters (BinSegDetector,EspressoDetector,BeastDetector), the change points of the lastpredictunder achange_pointskey (AmocDetector,EspressoDetector),{"profile": ...}or anAttributeErrorbeforepredict(FLUSSDetector), and an empty dict (HdpHsmmDetector, which now listslog_likelihood_). The hyperparameters stay available throughget_paramsand the change points as the output ofpredict. The generic detector tests now checkget_fitted_paramsbefore and afterfit.BeastDetectorwithmultivariate_strategy="native", the default for multivariate series, now passes its prior tobeast123:tcp_minmax,torder_minmaxandtseg_minlengthand, whenseasonis not"none",scp_minmax,sorder_minmaxandsseg_minlength. They were ignored, and Rbeast used its own defaults:tcp_minmax=(0, 0)still gave a change point on a two-channel step series, where"l2","ensembling"and univariate series gave none. Withseason="none"(the default) and the default trend prior, the output is unchanged (Rbeast’s defaults are the same). With a seasonal component, the seasonal defaults of the detector now apply instead of Rbeast’s (at most 5 seasonal change points, harmonic orders from 1 toperiod / 2 - 1), which can change the output.BeastDetectorwithmultivariate_strategy="native"(the default for multivariate series) returns once a change found by two channels one or two points apart, andmax_cpskeeps the most probable change points. Rbeast keeps the change points of one channel a minimum distance apart (tseg_minlength; by default 3 points, or half the period with a seasonal component): two candidates of different channels closer than this distance are now taken as the same change, and the more probable one is returned. Two channels changing at t=500 and t=501 gave[500, 501]and now give one change point.max_cpskept the first candidates by position: on two channels with a weak mean shift at t=150 and a strong one at t=400,max_cps=1returned[152]. Candidates are now ranked by their probability in Rbeast’s ranked list (cpPr; the largest one for a time step found on several channels), andmax_cps=1returns[400].tolerance, which applied to"ensembling"only, now also drops a native candidate, of any channel, withintolerancetime steps of a more probable one. The default output changes: on 96 random step series of two or three channels, the output changed for 49 series (459 change points returned for 243 true ones, now 383), and the F1 score (margin of 15 points) went from 0.707 to 0.778; withmax_cpsset to the true number of change points, from 0.670 to 0.953; withtolerance=5, 0.816 and 0.964. Univariate series and the"l2"and"ensembling"strategies are unchanged.HausdorffDistance.computeacceptsn_timepoints, andHausdorffDistance(convert_labels_to_segments=True)converts label sequences to change points, like the other change-point metrics. Passingn_timepointsraised aTypeError, andconvert_labels_to_segmentswas stored but ignored: the distance was then computed between the label values themselves (1 instead of 400 for true change points 300 and 700 and a predicted one at 300). With either argument, only the change points inside the series are compared, without the boundaries0andn_timepoints, as inruptures.metrics.hausdorff. Without them, the two lists are compared as they are given, as before.PeltDetector().fit(X).get_fitted_params()no longer raises. Read beforepredict,change_points_raised aRuntimeError, whichget_fitted_paramsdoes not skip, andhasattr(detector, "change_points_")raised it too. The error is now also anAttributeError: untilpredict,get_fitted_paramsleaveschange_points_out andhasattrreturnsFalse. Code that catches theRuntimeErroris unaffected.The
tsseg.algorithms.tsfmsub-package is no longer shipped. It only re-exported the detectors of an optional package that is not on PyPI, so it could not be used after installing tsseg: importing it emitted anImportWarningand exported nothing. It was not documented, not tested and not listed intsseg.algorithms.__all__. A new test checks that every library the package imports is installed by a dependency or an extra.TSCP2Detectorreturns one change point per peak of its change score. A change point lowers the similarity of every window pair centred less than one window from it, and the detector returned either the centres of then_cpsmost dissimilar pairs, with no minimum spacing, or every centre below the similarity threshold: often several neighbouring centres for one change point. On a series of 1,000 points with change points at 300 and 700, after the default 100 epochs,n_cps=2gave[333, 348]and found only one of the two for 4 seeds out of 5; the automatic threshold gave 18 to 44 change points. The centres are now taken by decreasing change score, skipping any centre less than one window (window_size, or the shorter window thatfittrains on for a short series) from a change point already kept. Withn_cps, closer centres still complete the set when the series is too short forn_cpsspaced ones. The outputs of both modes change; the encoder and its training do not.Time2StateDetectorandE2USDDetectorrefuse infit, with aValueError, the parameters their encoder cannot run: an oddwindow_size(accepted byfit, it madepredictfail after the training),kernel_size=1for Time2State and akernel_sizeabovemin(window_size, 64)for E2USD (both failed infitwith aRuntimeErrorfrom PyTorch).Time2StateDetectorandE2USDDetectorlabel a constant series as one state. When the variance of the series was exactly zero, as fornp.zeros(n), the z-normalisation divided by zero andpredictraisedValueError: Input X contains NaN; a constant series whose variance is a rounding error, as fornp.full(n, 0.1), already got one state. A series of zero variance is now only centred. The other series are normalised as before.TGLADDetectornow trains uGLAD for 2000 epochs per batch by default, as the authors’ code does, instead of 100. After 100 epochs, the soft threshold that GLAD learns could set every partial correlation to zero, and the detector then found no change point, as on a two-channel series with two clear mean shifts and on the first three MoCap trials with the defaultwindow_size; after 2000 epochs it finds 21, 37 and 34 change points on these trials, for 6, 9 and 8 true ones. Training takes about 20 times longer; passepochs=100for the previous behaviour. The documentation now also says that the windows around one transition can each give a change point, and that on a univariate series the summary of a window, the precision of its single channel (a fallback that is not in the authors’ code), does not follow the variance of the signal, as the docstring said: uGLAD min-max scales each window first.TGLADDetectorprints nothing withverbose=False, its default. The vendored uGLAD solver printed three lines on stdout for each batch of windows (“Running uGLAD in multi-task mode”, “Processing the input table for basic compatibility check”, “Total runtime: …”) whateververbosesaid; withverbose=Truethey are still printed, with the loss every tenth of the epochs.epochsbelow 10, which the parameter schema accepts, raisedZeroDivisionErroratfit: the solver printed the loss everyint(epochs / 10)epochs, which is 0 below 10 epochs; it now prints it every epoch there.Importing
TGLADDetectorno longer issuesSyntaxWarning: invalid escape sequence '\T'on Python 3.12 (aDeprecationWarningbefore 3.12, an error in a future version). The warning came from a docstring of the vendored uGLAD solver and was shown whenever Python compiled that module at import, as on the first import from an editable install (pip precompiles the modules of a regular install and hides the warning); that docstring is now a raw string. A new test compiles every module of the package and fails on any compile-time warning.clone(random_state=k)seeds the clone. The seed was ignored:cloneonly called aset_random_statemethod that no detector defines, so the clone kept therandom_stateof the original. As in aeon, therandom_stateparameter of the clone is now set to an integer drawn fromcheck_random_state(k), the same for the samek;kmay also be anumpy.random.RandomState.clone()without a seed, and detectors without arandom_stateparameter, are unchanged.clone()copies the parameters, as scikit-learn’sclone(used by aeon) does. The clone received the parameter objects themselves, so a mutable parameter (a list such asICIDDetector(psi_list=...), a dict, an array, aRandomState) was shared: changing it in place, or drawing from the generator, also changed the original. Estimators passed as parameters, also inside a dict, list or tuple, are now cloned unfitted, andclone(random_state=k)also seeds theirrandom_state, in aeon’s order. A constructor that converts a parameter is still accepted, unlike scikit-learn’sclone.import tssegno longer puts a fakenumpy.core.umath_testsmodule, with only aninner1dfunction, insys.modules. It was left from a dependency that tsseg no longer has, and any other package of the program that importednumpy.core.umath_testsgot the fake module.import tssegno longer imports the detectors:tsseg.algorithmsis imported on first access, soimport tssegtakes about a fifth of the time it took, andtsseg.algorithms.PeltDetectorstill works after it.tsseg.np,tsseg.sys,tsseg.typesandtsseg.umath_tests, left by the imports of the package, are gone.tsseg.TGLADDetectoris deprecated (FutureWarning) and no longer intsseg.__all__, sofrom tsseg import *givesload_mocaponly. It is the same class astsseg.algorithms.TGLADDetector, where all the detectors are; import it from there.Time2StateDetectorandE2USDDetectorchange their output at the end of the series. Each window votes for its state on the points it covers, and the last(n_timepoints - window_size) % steppoints, which no window covers, got state 0 whatever the state around them, as in the code both detectors wrap: 16 of 630 points withwindow_size=64andstep=50. These points now take the state of the last window. The other points keep their state.Licences:
Time2StateDetectorandE2USDDetectorship code from projects that their licence files did not name. The causal CNN encoder and theDatasetclass oftime2state.pycome from the code of Franceschi, Dieuleveut and Jaggi (2019), under the Apache License 2.0, and partly from locuslab/TCN, under the MIT License;e2usd.pyholds the sameDatasetclass and themoving_avgandseries_decompblocks of Autoformer, under the MIT License. TheLICENSEfile oftsseg/algorithms/time2statenow holds these licences, theNOTICEof Franceschi et al. and the changes made to their code, and a newLICENSEfile intsseg/algorithms/e2usddoes the same for the two parts of E2USD (the rest of E2USD still has no published licence). The code is unchanged.Licences:
GreedyGaussianDetectoris adapted from aeon (aeon.segmentation._ggs), whose code is adapted from cvxgrp/GGS, buttsseg/algorithms/ggs/LICENSEheld only the BSD 2-Clause licence of cvxgrp/GGS, and the README of the directory and of tsseg named only cvxgrp/GGS. TheLICENSEfile now holds aeon’s BSD 3-Clause licence too, and the READMEs, the detector page and the module docstring name both sources. The code is unchanged.Docs: the Hidalgo page, README and docstring say what the detector does not separate. It tells states apart by their intrinsic dimension only, from distance ratios that location and scale leave unchanged, without the time order: states that differ in mean or variance but have the same dimension are not separated. Spatially separated regions of the same dimension are distinct in the model, but the Gibbs chain is slow to split them; the paper runs \(10^5\) iterations from 10 random starts, the detector 1000 from one by default. The detector is unchanged.
Docs: the Time2State page, README and docstring say that
window_sizesets the time resolution. Each window gets one state, and the encoder does not always embed a window that straddles a change point next to the segment that covers more of it, so the window should be well below the length of the shortest segment (the authors’ experiments use 128 to 512 points). On a 1000-point series of segments of 300 to 400 points, only 5 of the 15 windows of the default 256 points lie inside a single segment, and the adjusted Rand index is 0.22 to 0.40 with the true number of states; labelling each window with the segment that covers most of it would give 0.96, andwindow_size=32, step=32gives 0.90 to 0.95. The docstring also says that the encoder is never trained on the lastwindow_size - 3points, as in the reference implementation. The detector is unchanged.The documentation of
TiccDetectornow describes what the detector computes: the window of time pointtholds the pointsttot + window_size - 1, the lastwindow_size - 1observations enter no window,thresholdhas no effect andbetais twice the \(\beta\) of the paper. Every public member oftsseg.algorithms.ticc.ticchas a NumPy docstring. The detector is unchanged.TiccDetectorwithn_statesgiven raises aValueErrorthat names the cause when a state cannot get the two windows it needs to estimate its covariance: when the series has fewer than2 * n_stateswindows (n_timepoints - window_size + 1), or when the initial Gaussian mixture gives a state fewer than two windows, as it can to a few outlying windows.fitraised a bareKeyErrorsuch asKeyError: (2, 1), or theValueErrorof scikit-learn’s Gaussian mixture when the series had fewer windows than states. Withn_states=None, such a number of states still gets an infinite BIC; labels are unchanged.The documentation of
Time2StateDetectornow describes what the detector computes and where it fails:batch_sizehas no effect,window_sizemust be even,kernel_sizemust be at least 2,random_statedoes not seed the clustering ofpredict, and a constant series makespredictraise. Every public member oftsseg.algorithms.time2state.time2statehas a docstring; wrong ones are corrected (thefinalflag ofCausalConvolutionBlockadds the last activation,reduced_sizeofCausalCNNEncoderis a number of channels, the encoder outputs two-dimensional tensors). The README of the detector attributed the method to the wrong authors and venue; it now cites Wang, Wu, Zhou and Cai, Proc. ACM Manag. Data 1(1), 2023.The documentation of
E2USDDetectornow describes what the detector computes and where it fails:batch_sizeanddepthhave no effect,window_sizemust be even,kernel_sizecan be at mostmin(window_size, 64), the convolutions of the encoder keep their random initial weights,random_statedoes not seed the clustering ofpredict, a constant series makespredictraise, andyis ignored (the docstring offitsaid it set the number of states). Every public member oftsseg.algorithms.e2usd.e2usdhas a docstring. The README of the detector credited “Chen, Zhichen and others”; it and the documentation page now cite Lai, Li, Zhang, Zhao, Qian and Jensen, WWW 2024, pp. 3010-3021.Docs: the E2USD page, README and docstring say that
window_sizesets the time resolution. Each window gets one state, and the encoder can embed a window that straddles a change point next to either of the two segments, so the window should be well below the length of the shortest segment (the authors’ experiments use 128 to 512 points). On a 1000-point series of segments of 300 to 400 points, only 5 of the 15 windows of the default 256 points lie inside a single segment, and the adjusted Rand index is 0.28 to 0.52 with the true number of states; 0.83 to 0.95 withwindow_size=32, step=32. The detector is unchanged.The documentation of
BeastDetectornow says that a fixedmcmc_seedreproduces the output on one machine only: Rbeast picks its numerical routines by CPU instruction set, and their rounding differences change the MCMC samples. It also says that, on some machines, Rbeast returned NaN for every output on a 6,000-point series, so that the detector returned no change point. The test of that series, which failed on such machines, now expects this failure on CPUs that support AVX-512.BeastDetectorreruns Rbeast once with its SSE routines (cputype="sse") when the median number of change points (ncp_median) of a run is NaN in every component and every channel, and raises aRuntimeWarning. On some machines, Rbeast returned NaN for every output on a 6,000-point series, and the detector returned no change point. Other runs are unchanged; a failed run costs a second, slower one (1.5 to 2 times as long on an AVX2 CPU). If the rerun returns NaN too, the detector still returns no change point.BeastDetectorreturns no change point for a univariate series of two points, as it already did for a single point. Rbeast refuses an input of fewer than three values, andpredictraisedSystemError: <built-in function Rbeast> returned a result with an exception set; the"l2"and"ensembling"strategies failed in the same way on a two-point multivariate series.GreedyGaussianDetectorno longer depends on the level of a multivariate series. Its split search started the running mean of the left part from the first sample divided by the number of channels, a line taken from the reference implementation of GGS, so every candidate split was scored with a wrong left covariance: on three segments of two channels,k_max=2found[150, 250], and only[250]once 10 was added to the series. Each split is now scored by the regularised log-likelihood of the paper, the onelog_likelihoodcomputes. Multivariate outputs change; univariate outputs, where the two starts agree, do not.GreedyGaussianDetector(lamb=0)is refused byfiton a multivariate series. Without regularisation, the covariance of a segment with no more points than channels is singular, and the split search scores segments of two points:predictraisedLinAlgError: Matrix is not positive definiteon every multivariate series tried (120 of 120 with two to four channels and the defaultk_max). The paper assumes \(\lambda > 0\). On a univariate series,lamb=0still runs; if repeated values make a segment’s variance zero, theLinAlgErrornow says to uselamb > 0.Every detector can be imported without its optional dependencies, so
from tsseg.algorithms import *andhasattr(tsseg.algorithms, name)work after a barepip install tsseg. Seven detectors (ClapDetector,ClaspDetector,EAggloDetector,E2USDDetector,Time2StateDetector,TireDetector,ProphetDetector) raisedModuleNotFoundError: No module named 'numba'(or'torch','prophet') on import, which made the star import fail. The dependencies listed in a detector’spython_dependenciestag are now checked once, when it is constructed, as in aeon; a missing one raisesModuleNotFoundErrorwith the extra to install, the same way for all fourteen detectors with optional dependencies, e.g.ClapDetector requires numba, aeon: pip install "tsseg[accelerators,aeon]". Before, some failed only atfit(AutoPlaitDetector,SNLDSDetector,BeastDetector,ChangeForestDetector) and some without naming the extra. Accessingtsseg.algorithms.TireDetector(or E2USD, Time2State) no longer imports torch, andimport tsseg.algorithmsno longer imports stumpy: they are imported when a detector that needs them is constructed or fitted. Outputs do not change.The wheel and the source distribution now include the license of the PaTSS code,
tsseg/algorithms/patss/LICENCE, which the package-data patterns (**/LICENSE) left out. MATLAB data files (*.mat) are no longer selected as package data; none is left in the package.New extra
tsseg[fluss], which installs stumpy forFLUSSDetector;tsseg[all]now includes it. stumpy was declared nowhere, sopip install "tsseg[all]"leftFLUSSDetectorunusable. The CI installs the extra, so the tests ofFLUSSDetector, which it skipped, now run there; the extras table of the documentation lists it.tsseg no longer depends on
future, which nothing imports, and thedevextra no longer installsblack: the code is formatted withruff format.tsseg/algorithms/base.py, whose base classes are adapted from aeon, now opens with aeon’s BSD 3-Clause license, which asks redistributed source code to keep it. The README said that this license covered the file, but neither the file nor its directory held a copy.ChangeFinderDetector(n_cps=k)returnskchange points. When fewer thankpeaks of the score passed the threshold, it returned only those ([306]forn_cps=2on a series with two changes): the step meant to relax the threshold went over the same thresholded peaks and added none. The local maxima below the threshold now complete the selection, by decreasing score,min_distanceapart; fewer thankchange points remain possible only when the score has fewer such maxima. Guided outputs change when the threshold kept fewer thankpeaks, including per channel withmultivariate_strategy="ensembling"; outputs withoutn_cpsdo not change.New
SeededBinSegDetector: seeded binary segmentation (Kovács, Bühlmann, Li and Munk, 2023), written from the paper. Best split of every interval of a deterministic, near-linear collection, then greedy or narrowest-over-threshold selection; number of change points fromn_cps, apenaltyon the gain, or the strengthened Schwarz information criterion.intervals="wild"gives wild binary segmentation (Fryzlewicz, 2014). Any ruptures cost;"l2"is the CUSUM of the papers. For a multivariate series,"l2"with the criterion orn_cpsfirst divides each channel by its noise level (median absolute deviation of its differences), so that the result does not depend on the scale of each channel.augment=Trueadds the optional augmentation of wild binary segmentation to the greedy selection. Withintervals="wild"and norandom_state, the detector is taggednon_deterministic.Add a
CITATION.cfffile, read by GitHub’s Cite this repository button, and the citation of the TSB-SEG benchmark (NeurIPS 2026) to the README.HidalgoDetectortakes its arguments by keyword only and has a last parameteraxis(default0):HidalgoDetector(axis=1)reads series of shape(n_channels, n_timepoints). A positional call such asHidalgoDetector("euclidean")now raises aTypeError;fit(X, axis=1)works as before.Installation from source no longer needs conda.
make installcreates a virtual environment in.venvwith thevenvmodule and installs tsseg in it, editable, with theallanddevextras (optionsEXTRAS,VENV,VENV_PYTHON, andTORCH_INDEX_URLto take torch from another index, such as its CPU build). The conda environmenttsseg-envis now created bymake install-conda(which installsEXTRAStoo, hencedevbesidesall) and removed bymake clean-conda;make cleanremoves.venvonly. The README, the documentation home page and the getting started and contributing guides give thevenv+pipsteps first, and say thattsseg[all]needs Python 3.10 to 3.12 (the TensorFlow versions pinned bytsseg[tscp2]have no wheel for 3.13 or later).EspressoDetector(random_state=...)seeds the matrix profile: the seed was stored but never passed on, so every call drew a fresh random order of the subsequences. That order decides which nearest neighbour is kept when distances tie, which happens on exactly repeated patterns; there, the change points changed from one run to the next whatever the seed. A fixed seed now gives the same change points at every run.Docs: the ESPRESSO page described the method wrongly. It said that the matrix profile is computed with
stumpy(tsseg computes it in NumPy and never importsstumpyfor ESPRESSO) and that the peaks of the density curve are the change points (its minima are candidates, among which a greedy information-gain search picksn_segments - 1), and called the code new while it translates the authors’ MATLAB code. It now describes the four steps, the bounds ofwindow_sizeand the published reference (Proc. ACM IMWUT).ClapDetectoraccepts the classifiers and merge scores that CLaP implements:classifierin {"rocket","mrhydra","weasel","quant","rdst","proximityforest","freshprince","inception"} andmerge_scorein {"cgain","f1_score","log_loss","ami","hamming_loss","roc_auc"}. Since 0.1.1 its parameter check refused all of them but"rocket"and"cgain", soclassifier="mrhydra"(the Fixed configuration of CLaP in TSB-SEG) raisedValueError; it allowed"knn","svm"and"score", which failed later, infit, and are now refused upfront.ClapDetector(change_points=...)(known change points) works: an array was refused by the parameter check and a list failed infit(AttributeError). Lists, tuples and arrays are accepted.ClaspDetectoracceptsscore="f1", which ClaSP implements and documents; the parameter check refused it.ClaspDetectorandClapDetectorin guided mode (n_change_points, or an integern_segments) return the number of change points they are given, fewer only when the segments are too short to split further. ClaSP validated each candidate in this mode too, as claspy does, so a count could give fewer change points, or none: on a series of mean shifts in noise,n_change_points=2gave no change point andClapDetectora single state. The validation now applies only when the number is learned (n_segments="learn", the default), andvalidationandthresholdofClaspDetectorhave no effect in guided mode. Guided results change; unsupervised results do not.ClapDetectorhas adistanceparameter, passed to ClaSP:"znormed_euclidean_distance"(default, unchanged),"euclidean_distance"or"cinvariant_euclidean_distance", as inClaspDetector. The z-normalised default compares the shapes of the windows and misses a change of level alone, such as a mean shift in noise.Docs:
ClapDetector(random_state=...)seeds the classifiers of CLaP only; ClaSP keeps the fixed seed of claspy (2357).Guided mode on a series without any change point:
TSCP2Detector(n_cps=0),BOCDDetector(max_cps=0),BeastDetector(max_cps=0)andGreedyGaussianDetector(k_max=0)return no change point; their parameter check refused0(ValueError).BOCDDetectoralso checkedmax_cpsonly after selecting a change point, somax_cps=0alone would still have returned one on univariate series and with the"l2"strategy.FLUSSDetectorwithn_segmentsset returns its change points sorted, as the change point detection output requires. On one channel or withmultivariate_strategy="l2"and three segments or more, they came in the order in whichstumpy.flussextracts them (lowest corrected arc curve first), for example[3278, 1600]on MoCap trial 0. The change points and their scores are unchanged, only their order.FLUSSDetectorwithn_segmentsset no longer returns0as a change point. Once the corrected arc curve left after the exclusion zones of the change points found is flat (1 everywhere),stumpy.flusstakes its minimum at index 0 for each change point still to find:[0, 681]on 1000 points of white noise (window_size=50, three segments),0repeated whenn_segmentsasks for more change points than the exclusion zones leave room for. These are dropped, so fewer thann_segments - 1change points can come out; on one channel or withmultivariate_strategy="l2", the others are unchanged. With"ensembling", the channels no longer vote for0, and the change points they agree on can change.n_segments=1returns an empty array instead of an empty list.FLUSSDetectorhas a new parameternormalize(defaultTrue, passed tostumpy.stump). The default keeps the z-normalized matrix profile of the FLUSS paper, to which a change in mean or scale alone is invisible;normalize=Falsecompares the raw subsequences, so shifts in level show ([293, 692]instead of[485, 739]for change points at 300 and 700 of white noise with three means). Withoutn_segments, it needs a lowerthresholdthan the default 0.5. Outputs with the default are unchanged.BinSegDetectorandBottomUpDetector:penaltydefaults toNone, which means 10 when neithern_cpsnorepsilonis given. With the former default of 10,n_cps=kalone always warned that the penalty was ignored, andepsilonalone raisedValueError(it neededpenalty=None). The change points are the same in every case that was accepted before;penalty=Nonealone now means a penalty of 10 instead of raisingValueError.Docs: the BinSeg page listed an
"ar"cost model, which the parameter check refuses, and omitted"cosine", which it accepts.Docs: the BottomUp and vendored ruptures pages state that
BottomUphas the speed-up of ruptures v1.1.9 (PR #309), which tsseg has shipped since its first release; they said v1.1.8 only. On 100,000 points, the Python backend segments in 2 s instead of 15 s for the v1.1.8 code, with the same change points.Docs: the docstrings of
ClaspDetector,EspressoDetector,FLUSSDetector,HMMDetector,InformationGainDetector,RandomDetector,TireDetectorandTSCP2Detectordocument every constructor parameter.EspressoDetectordocumentedsubsequence_lengthinstead ofwindow_size, andInformationGainDetectorachange_points_attribute that is never set. The FLUSS, HMM and IGTS examples use tsseg instead of aeon. Now documented:RandomDetectorignoresn_change_pointsandn_statesunlesssemi_supervised=True.TireDetectorwithstride > 1returns time point indices. It returned window indices (withstride=4, the three changes of a 600-point series at 150, 300 and 450 came out at 42, 76 and 113), andchange_scores_had one value per window instead of one per time point, sopeak_distance_fractionwas counted in windows. The scores are now placed midway between the two compared windows and interpolated to every time point;stride=1, the default, gives the same output as before.TireDetector(n_segments=1)returns no change point; it selected the peaks byprominence_threshold, as withoutn_segments.Docs: the contributing guide names the six modules of the generic detector test suite (it listed four), states the change-point output they check (strictly increasing indices in
[1, N - 1]) and the extras the CI installs;tests/README.mddescribes the current helpers oftests/algorithms/conftest.py.AutoPlaitDetectorno longer needs a C binary: the C code of Matsubara et al. (version of June 18, 2014) is translated to Python and compiled with numba (tsseg[accelerators]), random draws included. It returns the segmentation of the binary built with GCC on Linux (same segments, same total cost on the 9 MoCap trials ofload_mocap, the 7 demo series of the C code and 38 series of ActRecTut, HAS, PUMP, SKAB, TSSB, USC-HAD and UTSA) and runs 2 to 8 times faster. Series of more than 15 channels, which the binary read as a longer series (ValueErrorsince 0.3.0), are segmented; a constant channel is set to zero instead of yieldingNaNvalues.c/autoplait/, the runnertsseg.algorithms.autoplait.autoplait_cand theAUTOPLAIT_DIRvariable are removed.AutoPlaitDetectorgains then_regimes_andcost_attributes.TiccDetectorruns withoutn_states: withn_states=None, the new default (it was5), the number of states is chosen by the Bayesian information criterion among1, ..., max_states(new parameter, default8), as the TICC paper recommends. The criterion counts the free entries of each block Toeplitz precision matrix, the means and the switches, and divides the log-likelihood of the overlapping windows bywindow_size(see the docstring); the attributesn_states_andbic_report the choice. The detector is taggedcapability:unsupervised. Passn_states=5to keep the former behaviour.The TICC solver returns the same labels two to five times faster: it runs in the calling process when
num_proc=1(it always started a process pool), its ADMM Z-update and its assignment step are vectorised, and it no longer computes, at each iteration, a k-means clustering and confusion matrices that it did not use. It no longer reseeds NumPy’s global random generator nor changes the print options of NumPy and pandas.EAggloDetector.predict(X)segmentsXwhen it is not the series given tofit. It compared the pandas index only, so on another series of the same length it returned the change points of the fitted series; a shorter series was completed with the end of the fitted series before being segmented. A new series is segmented alone, with a warning as before, and the fitted attributes are left unchanged;fit_predictandpredicton the fitted series are unchanged. Withmember, a series of another length raises aValueErrorthat says so (a longer one failed in pandas, a shorter one was completed).HidalgoDetector.predict(X)labelsXwhen it is not the series given tofit. It returned the labels of the fitted series whateverX, so as many labels as the fitted series has time points. A new series is labelled with a new fit, with a warning, and the fitted attributes are left unchanged;fit_predictandpredicton the fitted series are unchanged. The docstring now says that time points whose most probable state has a posterior probability below 0.8 are labelled-1.The pages of IGTS, TS-CP2, PaTSS and SNLDS give their time complexity, so every detector page now does. The SNLDS page said that a training step costs \(O(B\,L\,K^{2})\); \(K^{2}\) is only the forward-backward recursion, and the discrete transition network costs \(O(K^{4})\) per time step.
E2USDDetector.predictandfit_predictwrite nothing to the standard output. Since 0.1.0 they printed the shape of the array of windows, for example(17, 1, 32), on every call.TSCP2Detectorleaveswindow_sizeunchanged on a short series. On a series of exactly2 * window_sizepoints,fithalvedwindow_sizein place and printed a warning to the standard output:get_paramsreturned the halved value, and a laterfitof the same instance on a longer series kept it.fitnow trains on the halved window with aUserWarning; its change points are unchanged.predicton a series shorter than two windows offitraises aValueErrorthat says so: it failed inside the encoder and left the detector unusable for every laterpredict.predicton a series of exactly two windows scores its single window pair instead of failing.PatssDetector(config=...)leaves the dictionary it is given unchanged:predictcompleted it in place with every missing default, soget_params()["config"]changed after the firstpredict, and the sections it added were the module-level default dictionaries themselves (editing them changed the defaults of every later run).PatssDetectorwithconfig={"segmentation": {"algorithm": "k_means"}}returns one state label per time point; it returned a single integer.The PaTSS page lists the keys that
configtakes, with their defaults: the keys it cited (pattern_length,min_frequency,max_overlap,n_segments) do not exist, so its custom configuration example had no effect. It describes the three steps as the code runs them and gives the reference of the paper (SDM 2024).PatssDetectorwrites nothing to the standard output; it printed the temporary directory of every window size it tried.BeastDetectorno longer fails withValueError: cannot convert float NaN to integerwhen Rbeast returns NaN for the median number of change points (ncp_median), as it did in CI on a 6,000-point series. It warns (RuntimeWarning) and keeps the change points abovecp_prob_thresholdwithout capping their number; if every Rbeast output is NaN, it returns no change point.The iCID, tGLAD and TIRE pages said “Origin: new code.” They now say where the code comes from: a translation of the authors’ MATLAB code (iCID, GPLv3), a wrapper around the uGLAD solver vendored from the authors’ repository under a non-commercial licence (tGLAD), and a PyTorch reimplementation of the authors’ TensorFlow code (TIRE). The
thresholdofTGLADDetectorapplies to the absolute second difference of the sum of partial correlations, not to a Frobenius distance as the page, the README and the docstring said. The iCID page and README give the right title and authors of the JAIR paper, and the tGLAD README cites the paper of its authors.Docs: the Prophet page, README and docstring said that a level shift shows as two opposite rate changes on consecutive candidates. Prophet fits it as a steep ramp, a run of rate changes of one sign before the shift and a run of the opposite sign after it, which can be wider than
tolerance: one shift can then give two change points and leave a smaller shift out of then_changepointsreturned. The detector is unchanged.SNLDSDetectorseeds its initial weights withrandom_state. Keras 3 draws the seed of an initializer created without one from Python’srandommodule, which the detector did not seed: two fits with the samerandom_statestarted from different weights, andfitconsumed the caller’srandomstream. On a series of three segments with clear mean shifts, two runs with the default parameters gave adjusted Rand indices of 0.52 and 0.92. Training still differs from run to run, even withtf.config.experimental.enable_op_determinism(): the documentation now says so, with what it does to the result on that series, where it said that only a few labels could differ between two calls.BeastDetectorwithmax_cpsandcomponent="season"or"both"keeps the most probable change points of the returned components. On a univariate series (and with the"l2"and"ensembling"strategies), it ranked every candidate, seasonal ones included, by the occurrence probability of the trend: on a periodic series whose amplitude changes three times, the last change being the largest,max_cps=1kept another candidate than this change for 6 of 8 seeds with"season"and for all 8 with"both". Each candidate is now ranked by the occurrence probability ofcomponentat its time step (the larger of the trend and seasonal ones with"both"), and the largest change is kept, within 2 points, for the 8 seeds. Outputs withcomponent="trend"(the default), withoutmax_cps, or with the"native"strategy are unchanged.Docs: the BEAST page and the docstring of
seasonsay that, with a seasonal model ("harmonic","dummy"or"svd"), Rbeast 0.1.25 can kill the Python process (abort on a double free, or segmentation fault) instead of raising an error, as a direct call to Rbeast does. Whether a call crashes depends on the length of the series, the period and the values: for instance"dummy"withperiod=2on 3 to 5 points, or withperiod=12on 200 points of white noise. The page shows how to run each call in a child process so that a crash does not stop the caller. The detector is unchanged.TiccDetector.predict(X)labelsXwhen it is not the series given tofit. It returned the labels of the fitted series whateverX: the labels of another series on a series of the same length, and as many labels as the fitted series has time points on a series of another length. A new series is labelled with a new fit, with a warning, and the fitted attributes are left unchanged, as inEAggloDetectorandHidalgoDetector;fit_predictandpredicton the fitted series are unchanged.
0.3.0 (2026-10-14)#
Upgrading from 0.2.0: VQTSSDetector, VSAXDetector and the HDP-HSMM
aliases are removed; GreedyGaussianDetector returns change points instead
of labels; the arguments of SNLDSDetector are keyword-only;
ProphetDetector, and ChangeFinderDetector without n_cps, select
change points differently by default; BeastDetector needs Rbeast from
PyPI (tsseg[beast]); the supervision and dependency tags of several
detectors change. KCPDDetector, HMMDetector, PatssDetector and the
n_cps parameter of AutoPlaitDetector are deprecated. Several fixes
change the output of AutoPlait, BEAST, IGTS, Window and the vendored ruptures
solvers (ties): results computed with 0.2.0 can differ.
New detector
ChangeForestDetector: classifier-based nonparametric change point detection with random forests (Londschien, Bühlmann and Kovács, JMLR 2023). It wraps the officialchangeforestpackage, installed with the new extrapip install tsseg[changeforest]. Withn_cpsit runs best-first binary segmentation on the package’s gains, a semi-supervised mode that is not part of the paper.New
RuLSIFDetector(Liu, Yamada, Collier and Sugiyama, Neural Networks 2013): change points are peaks of the symmetrised relative Pearson divergence between the subsequences before and after each point, estimated by RuLSIF with cross-validated kernel width and regularisation. NumPy port of the authors’ MATLAB code (MIT); guided (n_cps) or thresholded.TSCP2Detectortakes arandom_stateseed (Noneby default, as before): with an integer, every fit initialises the encoder, shuffles the training windows and draws the dropout masks identically, so two fits on the same series return the same change points. Without a seed, the weights and the shuffling changed at every fit, and nothing declared the detector non-deterministic. The seed goes throughtf.keras.utils.set_random_seed, which also reseeds the global Python, NumPy and TensorFlow generators.Dependencies:
tqdmandjoblibare no longer required. No module of tsseg imports them since the unfinished Python port of AutoPlait was removed (joblibremains installed with scikit-learn).fetch_datasetshows a download progress bar only whentqdmis installed.Tags: the undocumented
semi_supervisedtag ofAmocDetector,EspressoDetectorandRandomDetectoris removed:capability:semi_supervisedis the tag (thesemi_supervisedparameter ofRandomDetectoris unchanged). The deprecatedHMMDetector, neither unsupervised nor semi-supervised, declarescapability:semi_supervised: its number of states is the length ofemission_funcs. A contract test rejects unknown tags and checks that every detector declares both supervision tags, at least one of themTrue.Tags:
python_dependenciesisNoneor a list of the optional modules a detector imports.ProphetDetector,TGLADDetectorandTireDetectordeclared a string ("torch,networkx"), and eight detectors declared nothing; they now declare["numba", "aeon"](ClapDetector),["numba"](ClaspDetector,EAggloDetector),["torch"](E2USDDetector,Time2StateDetector),["stumpy"](FLUSSDetector),["npbad"](PatssDetector) and["Rbeast"](BeastDetector). A contract test checks the format and that the tag lists the modules the test suite skips a detector on.make testandmake docsrun the test and documentation jobs of the CI (pytest --tb=short -q;sphinx -W -E -b html docs docs/_build/html).PYTEST_ARGSselects tests,DOCS_BUILD_DIRchanges the output directory,PYTHONthe interpreter.Reproduction tests: tests that reproduce a published result on a dataset downloaded on demand (pinned by its SHA-256 digest) go to
tests/reproduction/and are markedreproduction. The marker is deselected by default (pytest -m reproductionruns them); the protocol is intests/reproduction/README.md.GreedyGaussianDetectorreturns the change point indices, as itsreturns_dense=Truetag and its documentation announce: it returned one segment label per time point (0, ..., 0, 1, ..., 1, ...) since 0.2.0, which code reading the output as change point indices misinterpreted.EAggloDetectorreturns anumpyinteger array instead of a Python list, and the deprecatedHMMDetectorreturns integer labels instead of floats.InformationGainDetectorstops its search when every candidate position (the multiples ofstep) is already a change point, and then returns fewer thank_maxchange points: whenk_maxexceeded the number of candidates (ceil(n / step) - 1), it returned-1and0among the change points, for instance[-1, 0, 5, 10, 15, 20, 25]fork_max=10, step=5on 30 points. The other change points are unchanged.Code that no module of the package imports is removed: an unfinished Python port of AutoPlait, older BOCD and TIRE scripts, the former IGTS implementation, a MATLAB-engine wrapper of ESPRESSO, PaTSS scripts that import a
baselinespackage foreign to tsseg, and the MATLAB reference sources of ESPRESSO and iCID. The wheel no longer ships these modules nor the four data files of the MATLAB sources (two.matfiles of the iCID demo, two.txtnotes of ESPRESSO). The deprecated aliasesHdpHsmmDetectorV1,HdpHsmmLegacyDetectorandLegacyHdpHsmmDetectoroftsseg.algorithms.hdp_hsmmare removed: useHdpHsmmDetector.AutoPlaitDetectorreturns the segmentation that the AutoPlait binary writes: each time point gets the number of its regime, so that segments of the same regime share a label, and change points are the first index of a segment. The wrapper read the change points one index early (the last index of the previous segment), took the labels ofsegment.labels(one row per regime, whose second column is the regime’s path in the split tree) and applied them to the segments in time order, padding with the last one: on regimes A-B-A it returned1 | 0 | 0with a single change point. It now raisesRuntimeErrorwhen the binary’s segments do not cover each time point exactly once.AutoPlaitDetectoris tagged unsupervised (capability:unsupervisedTrue,capability:semi_supervisedFalse), as the AutoPlait binary always ran: it chooses the number of segments itself and has no guided mode. It runs withoutn_cpsand withouty; it raisedValueErrorwhen both were missing.n_cpsis deprecated and ignored: passing it,0included, emits aFutureWarningatfitand no longer launches the binary once with a number of segments that it rejected. The output does not change.AutoPlaitDetectorhands the AutoPlait binary a series that it reads with the right length. The binary counts the time points of its input with a line buffer of 254 bytes, and the wrapper wrote 25 characters per value (%.18e): rows of 10 channels or more were counted twice or more, and the binary segmented a longer series padded with rows of zeros (62,442 time points instead of 31,392 on ActRecTut subject 1), whose last segment ended past the series. Values are now written as float32 with 9 significant digits, the precision at which the binary reads them, so that series of up to 15 channels always fit. A series whose rows still do not fit (the 76 channels of JIGSAWS) raisesValueErrorbefore the binary runs, and a binary that reports another length than the series’ raisesRuntimeError. Series of fewer than 10 channels were not affected.The AutoPlait runner (
AutoPlait._run_autoplaitintsseg.algorithms.autoplait.autoplait_c) runs the binary once, with the command line of the bundled binary (autoplait d list_file out_dir), and raisesRuntimeErrorif it fails. It no longer takesn_cps, nor tries a command line withn_cps + 1or with the length of the series: the only binary that takes a second argument, the modified version of the FLOSS project page, reads it as a minimum number of regimes, not of segments. The documentation now points to the original C code of Matsubara et al., whichc/autoplait/holds, instead of the FLOSS page.AutoPlaitDetectorreturns the same output.The output contract tests check what the documentation states: change points are a 1-D integer
numpyarray, strictly increasing, within[1, n - 1]; state labels are a 1-D integernumpyarray of lengthn. They accepted0, duplicates and float labels.Guided mode on a series without any change point:
ClaspDetector(n_change_points=0orn_segments=1),ClapDetector(n_change_points=0),EspressoDetector(n_segments=1),Time2StateDetector,E2USDDetectorandTiccDetector(n_states=1) accept the value and return no change point (a single state); their parameter validation rejected it.AmocDetectorcomputes the error of every split from cumulative sums, in linear time: it recomputed both means at every split (quadratic time). The detected change point is the same.fitandfit_predictreject aygiven as apandas.DataFramethat does not have exactly one column, as the error message states: a frame with two columns (or none) was accepted.ChangeFinderDetectorwithoutn_cps: the data-driven threshold ismean + threshold_factor * stdof the scores (threshold_factor, 2.0 by default as before), the minimum distance between change points can be a fraction of the length (min_distance_fraction), and theensemblingstrategy merges the detections of the channels that lie within the tolerance (by default the minimum distance) and can require a share of the channels to agree (consensus, 0 by default); it returned every distinct peak of every channel. Thel2strategy and the behaviour withn_cpsare unchanged by default.FLUSSDetectoracceptsn_segments=None(number of segments unknown): the regime extraction keeps the minima of the corrected arc curve belowthreshold(0.5), and theensemblingstrategy merges the detections of the channels withintolerance(consensus, the share of the channels that must agree, is 0 by default). A knownn_segmentsbehaves as before.New helper
tsseg.algorithms.utils.consensus_change_points: change points detected by enough channels, without a target count.Documentation matches the code: the tag list of the detectors page (
returns_denseisTruefor change point indices; guided mode is thecapability:semi_supervisedtag), the getting-started guide (examples that run without optional dependencies, guided mode through constructor parameters, real test commands), the datasets page (one bundled dataset, no test fixture to import), the extras table, change point examples that named their outputlabels, and the citation (Springer proceedings).Docstrings:
PeltDetector,BottomUpDetector,WindowDetector,DynpDetectorandKCPDDetectordocument their parameters;BinSegDetectorstates its actualpenaltydefault (10; passpenalty=Noneto stop onepsilon); theHidalgoDetectorexample runs with tsseg instead of aeon, and itsK_statesdefault is 1; theICIDDetectorpsi_listdefault isNone. Thecomputemethods of the state detection metrics and thevalidatemethods of the parameter constraints are documented. A test checks that each detector documents exactly its constructor parameters, with their actual defaults.EAggloDetector:penalty="mean_diff_penalty"no longer raises (the penalty was compiled with numba, which rejects the list of segment boundaries it receives). The documentation now describes the goodness-of-fit statistic, the V-statistics and the merge of the first and last clusters inherited fromecp, and the over-segmentation obtained from one cluster per time point.ClaspDetectorruns whenNUMBA_NUM_THREADSis below the number of cores (as set by users or by SLURM jobs):n_jobs=-1meantos.cpu_count()threads, more than numba accepts, which raisedValueError: The number of threads must be between 1 and ....n_jobs=-1now means all the threads numba may use, and a largern_jobsis capped at that number.TireDetector: the minimum distance between two change points ispeak_distance_fractiontimes the series length, as documented; the default is 0 (no constraint). The prominence threshold of the unsupervised mode is theprominence_thresholdparameter, 0.5 by default.Removed
VQTSSDetectorandVSAXDetector, two methods developed for tsseg without a publication. On a 54-series sample of TSB-SEG, VSAX scored below a random segmentation (bidirectional covering 0.351 against 0.377, ARI 0.163 against 0.208), and VQTSS returned one vector-quantisation code per time step rather than a segmentation (ARI 0.001), with more than 10 minutes per series beyond 2,500 points. Both labelled local patterns rather than regimes. Code that imports them must drop them; they remain in the history of the repository and in tsseg 0.2.0.ProphetDetectornow placesn_candidatesevenly spaced candidates, fits Prophet’s rate changesdeltaand returns then_changepointslargest|delta|relative to their median, or, whenn_changepointsisNone(the new default), those abovedelta_threshold(a relative form of TCPDBench’s rule), at leasttoleranceapart. New parametersn_candidates,changepoint_prior_scale(500 by default, calibrated on TSB-SEG),delta_threshold,seasonality(off by default) andmax_points(longer series are reduced to block means before the fit);n_changepointsnow accepts 0;multivariate_strategydefaults to"l2", and"ensembling"averages the per-channel scores instead of voting.The vendored ruptures solvers have a numba backend for the
l1,l2,rbfandcosinecosts, with the same segmentation as the Python path:backend="auto"(the default) picks it when numba is installed,"numba"and"python"force either path, inPeltDetector,DynpDetector,BinSegDetector,BottomUpDetector,WindowDetectorandKCPDDetector. The kernel costs no longer build the n x n Gram matrix (for PELT and DynP, a transcription of the C solvers of ruptures’KernelCPD); DynP no longer memoises O((n / jump)^2) sub-problems; BinSeg finds the best split of a segment in one sweep from each end.SNLDSDetectoris now shipped with the package. It was listed intsseg.algorithmswithout its module, sofrom tsseg.algorithms import *failed on the 0.2.0 wheel. The authors’ TensorFlow code (Google Research, Apache-2.0) is vendored intsseg/algorithms/snlds/vendor; install the dependencies withpip install tsseg[snlds]. Its constructor is now keyword-only, and its tags declare it semi-supervised (n_statesis the number of regimes) rather than unsupervised. The wheel now also ships theLICENSEfiles of the vendored code.CostRbf: the median heuristic no longer counts the distance of a sample to itself, whose rounding residues shifted gamma by about 1e-4, and no longer builds the Gram matrix.Ties: every vendored solver treats values closer than
1e-9of the costs involved (at least of the signal’s cost per sample,tie_unit) as equal, and decides between them by position as upstream decides between exactly equal values: earliest change point (PELT, DynP), last change point of a segment and first segment (BinSeg), leftmost merge (BottomUp), no peak on a plateau and latest tied peak first (Window); a value tied withpenorepsilonstops, and PELT keeps a start tied with its pruning bound (pruning less never loses the optimum).PatssDetectoris deprecated (FutureWarning) and will be removed in a future release: it needsnpbad, which is not on PyPI, and over-segments (17 times more change points than the ground truth on a 54-series sample of TSB-SEG). The authors maintain PaTSEmb, which needs Java.WindowDetectorsearches its peaks as ruptures does (argrelmax(mode="wrap")): the vendored peak search cut the neighbourhood of a score at the ends of the signal, and could add a change point next to the first or last window.The vendored ruptures costs convert the signal to float64 in
fit: float32 signals were costed in float32, andCostCosinefailed on integers.BeastDetectoruses theRbeastpackage from PyPI, version 0.1.25 or later (new extratsseg[beast]), instead of the copy of Rbeast 0.1.15 vendored inc/Rbeast, which never returned on univariate series longer than about 4,600 points. Change points were one sample late (Rbeast counts time from 1); they are now the index of the first sample of the new segment.mcmc_seeddefaults to 1: with 0, Rbeast draws a random seed and the output changed from one call to the next.Third-party licenses:
bocd/,ticc/,time2state/and the aeon-derivedeagglo/,hidalgo/,hmm/andigts/now ship a copy of their upstream license, in the source tree and the wheel. The code adapted inbocd/is under the MIT license, not Apache-2.0 as documented. The README listsBeastDetector’s dependency Rbeast, under the license of its R package (GPL >= 2), and no longer claims that every vendored directory contains a license file.pen_scale="bic"inPeltDetector,BinSegDetector,BottomUpDetectorandWindowDetector: the penalty is a coefficient onlog(n) * u, u the cost of one sample of the whole signal (d forl2on unit-variance channels, where it is the BIC penalty; the mean absolute deviation forl1; 1 for the kernel costs), so that one value applies across lengths, dimensions and costs.New
GaussianHMMDetector: a hidden Markov model with diagonal Gaussian emissions, fitted by Baum-Welch (EM) from k-means initialisations and decoded by Viterbi. The number of states is given (n_states) or chosen by BIC.HMMDetector, which only decoded with user-supplied parameters, is deprecated (FutureWarning).BinSegDetector,BottomUpDetectorandWindowDetectoracceptn_cps=0again (no change point), asDynpDetectorandKCPDDetectordo: the parameter schema requiredn_cps >= 1, which failed the semi-supervised runs on series without change points.SNLDSDetectorfollows the training schedules of the paper: the temperature of the discrete transitions and the weight of the cross-entropy regulariser start at 1,000 (temperature_init,xent_init) and decay as in the Reacher experiment, scaled ton_train_steps. Before, both stayed inactive (temperature 1, weight 1e-10). Training drawsbatch_sizewindows oftrain_windowpoints per step (new parameter, default 256;Nonefor the whole series), so a step no longer runs over the whole series, and the defaults arebatch_size=8andn_train_steps=2000. Prediction is compiled, about 100 times faster on MoCap. The detector declares a parameter schema and thenon_deterministictag, and no longer reseeds NumPy’s global generator. SNLDS is documented as experimental: on a sample of TSB-SEG it scores below a random segmentation.KCPDDetectoris deprecated (FutureWarning): it isPeltDetectororDynpDetectorwith a kernel cost (model="rbf","cosine", or"l2"for the linear kernel).PatssDetectorruns with scikit-learn 1.8, which removedLogisticRegression(multi_class=...)and raised aTypeError: the one-vs-rest elastic-net logistic regression of PaTSS is nowOneVsRestClassifier(LogisticRegression(...)), the same model (predicted probabilities equal to 1e-15 under scikit-learn 1.6).F1Scoregives 1.0 when neither the ground truth nor the prediction has a change point and the series length is read fromy_true:F1Score().compute([n], [])gave 0.0, because the empty prediction was rejected before the boundaries were set aside (compute([n], [n])andcompute([n], [], n_timepoints=n)already gave 1.0). Scores computed from labels (convert_labels_to_segments=True) are unchanged. The warning about a margin rounded to 0 samples is only emitted when change points are matched.F1Score,Covering,BidirectionalCoveringandGaussianF1Scoreaccept the series length incompute(y_true, y_pred, n_timepoints=n); the change points may then include or omit0andn, so the raw output of a detector can be scored directly. Withoutn_timepoints(and withoutconvert_labels_to_segments=True), the length is still read from the change points, scores are unchanged, and aUserWarningnow says so: ay_truethat does not end with the series length silently lost its last change point (F1Score(margin=5).compute([300, 700], [300])gives 1.0; withn_timepoints=1000, 0.667).Detector pages give the time complexity of 18 more detectors, as implemented with their default settings. Two values were wrong: PELT is \(O(C\,n)\) expected and \(O(C\,n^{2})\) at worst, with no factor in the number of change points (the page said \(O(C\,K\,n)\)), and ChangeFinder solves one \(k \times k\) system per sample, so \(O(d\,n + n\,k^{3})\) (the page said \(O(n\,k^{2})\)).
The tGLAD page gives the default of
epochs(100; it said 2000) and explains why the paper reports \(O(n)\) where the page states \(O(d^{3}\,n)\) per epoch. TheTGLADDetectordocstring links to the authors’ repository (Harshs27/tGLAD).
0.2.0 (2026-09-26)#
Replaced the NumPy
HdpHsmmDetectorwith a corrected sampler equivalent topyhsmm’sWeakLimitHDPHSMM(auxiliary self-transitions of Johnson & Willsky, right-censored last segment, chain started from the prior, numba forward messages) and calibrated defaults.numbais optional again, astsseg[accelerators]announces:ClapDetector,ClaspDetectorandEAggloDetectorare imported lazily (they need numba), andHdpHsmmDetectorfalls back to interpreted code without it.EAggloDetectorandGreedyGaussianDetectordeclarereturns_dense=True, consistent with their change point output.KCPDDetector:decimationparameter,pen_scale="bic"(penalty as a coefficient onlog(n) * d), andn_cps=0accepted.
0.1.1 (2026-04-20)#
Added
BeastDetectorandChangeFinderDetector.InformationGainDetector(IGTS) extended to univariate series, with the optimisation of the paper.Parameter schemas for all detectors; GF1 score exposed.
Fixes to GLAD, Hidalgo and VSAX; continuous integration (lint, tests, docs).
0.1.0 (2026-02-10)#
Initial public release.
Vendored a lightweight subset of
rupturesv1.1.8 – BinSeg, BottomUp, DynP, KCPD, PELT and Window detectors no longer need an external dependency.Added
BottomUpDetectorandDynpDetectorwrappers with aeon-compatible interfaces.Replaced the surrogate PyTorch
TSCP2Detectorwith a faithful TensorFlow + TCN implementation matching the original baseline.Replaced the
pyhsmm-backedHdpHsmmDetectorwith a native NumPy/SciPy sticky HDP implementation.pyhsmmandpybasicbayesare no longer installed by default.Improved
ClaspDetectoraxis handling.Added Sphinx documentation with GitHub Pages deployment.
Documented test suite layout and fixtures.