Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

This repository contains the time series segmentation benchmark (TSSB).

License

NotificationsYou must be signed in to change notification settings

ermshaua/time-series-segmentation-benchmark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The problem of time series segmentation (TSS) is to find a meaningful segmentation of a time series (TS) that captures a data-generating process with distinct states and transitions. We consider a segmentation meaningful, if the change points (CPs) between two consecutive segments correspond to state transitions in the associated process.

This repository contains the time series segmentation benchmark (TSSB). It currently contains 75 annotated TS with 1-9 segments. Each TS is constructed from one of theUEA & UCR time series classification datasets. We group TS by label and concatenate them to create segments with distinctive temporal patterns and statistical properties. We annotate the offsets at which we concatenated the segments as CPs. Addtionally, we apply resampling to control the dataset resolution and add approximate, hand-selected window sizes that are able to capture temporal patterns. We have ajupyter notebook that shows how to automatically perform the transformation.

Installation

You can install the TSSB with PyPi:python -m pip install git+https://github.com/ermshaua/time-series-segmentation-benchmark

Citation

If you use the TSSB in your scientific publication, we would appreciate the following citations:

@article{clasp2023,  title={ClaSP: parameter-free time series segmentation},  author={Arik Ermshaus and Patrick Sch{\"a}fer and Ulf Leser},  journal={Data Mining and Knowledge Discovery},  year={2023},}@inproceedings{clasp2021,  title={ClaSP - Time Series Segmentation},  author={Sch{\"a}fer, Patrick and Ermshaus, Arik and Leser, Ulf},  booktitle={CIKM},  year={2021}}

Results

We have evaluated 7 time series segmentation algorithms using the TSSB. The following table summarises the average segmentation Covering (higher is better) and the corresponding mean ranks. Evaluation details are in thepaper. The raw result sheet and an evaluation notebook are in thenotebooks folder.

Segmentation AlgorithmMean AccuracyMean RankWins & Ties
ClaSP85.47%1.554/75
BinSeg57.49%2.812/75
PELT58.1%2.912/75
FLOSS56.74%3.112/75
Window40.1%4.37/75
BOCD44.88%4.36/75
ESPRESSO44.36%4.64/75

The mean ranks are visualized in the followind critical difference (CD) diagram. Not significantly different algorithms are connected with a horizontal bar basedon a Nemenyi two tailed significance test with a = 0.05. The boxplot illustrates the summary statistics.

Basic Usage

Let's first import methods to load TS from the benchmark and to evaluate TSS algorithms. As an example, we also import our segmentation algorithm ClaSP fromclaspy.

>>>fromtssb.utilsimportload_time_series_segmentation_datasets>>>fromtssb.evaluationimportcovering>>>fromclaspy.segmentationimportBinaryClaSPSegmentation

We can now load the entire benchmark (75 TS) as a pandas dataframe using

>>>tssb=load_time_series_segmentation_datasets()

or a selection of TS by specifying thenames attribute using

>>>tssb=load_time_series_segmentation_datasets(names=["ArrowHead","InlineSkate","Plane"])

The dataframetssb contains (TS name, window size, CPs, TS) rows and can now be iterated to evaluate a TSS algorithm.

>>>for_, (ts_name,window_size,cps,ts)intssb.iterrows():>>>found_cps=BinaryClaSPSegmentation().fit_predict(ts)>>>score=covering({0:cps},found_cps,ts.shape[0])>>>print(f"Time Series:{ts_name}: True Change Points:{cps}, Found Change Points:{found_cps.tolist()}, Score:{score}")

In a similar fashion, you can evaluate your TSS algorithm and compare results. For more details, see the examplenotebooks.

Visualizations

See the following example TS to get an overview of the TSSB. You can find more images in thevisualizations folder.

image

image

image

In order to create a visualization of your predicted segmentation, you can use the following code.

>>>importmatplotlib.pyplotasplt>>>fromtssb.utilsimportvisualize_time_series>>>fig,ax=visualize_time_series(ts,ts_name,cps,found_cps)>>>plt.show()

image

Releases

No releases published

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp