├── .gitignore
├── LICENSE
├── README.md
├── benchmark
├── README.md
├── __init__.py
├── anomaly_detection_benchmark.py
├── metrics.py
├── motifs_wss.py
├── segmentation_benchmark.py
├── tssb_wss.py
└── ucr_anomaly_wss.py
├── datasets
├── README.md
└── motifs
│ ├── desc.csv
│ ├── ecg-heartbeat-av.csv
│ ├── ecg-heartbeat-av_gt.csv
│ ├── fNIRS_subLen_600.csv
│ ├── muscle_activation.csv
│ ├── muscle_activation_gt.csv
│ ├── npo141.csv
│ └── winding_col.csv
├── experiments
├── README.md
├── anomaly_detection
│ ├── discord
│ │ ├── discord_ACF.csv
│ │ ├── discord_Autoperiod.csv
│ │ ├── discord_FFT.csv
│ │ ├── discord_Human.csv
│ │ ├── discord_MWF.csv
│ │ ├── discord_RobustPeriod.csv
│ │ └── discord_SuSS.csv
│ ├── isolation_forest
│ │ ├── isolation_forest_ACF.csv
│ │ ├── isolation_forest_Autoperiod.csv
│ │ ├── isolation_forest_FFT.csv
│ │ ├── isolation_forest_Human.csv
│ │ ├── isolation_forest_MWF.csv
│ │ ├── isolation_forest_RobustPeriod.csv
│ │ └── isolation_forest_SuSS.csv
│ ├── svm
│ │ ├── svm_ACF.csv
│ │ ├── svm_Autoperiod.csv
│ │ ├── svm_FFT.csv
│ │ ├── svm_Human.csv
│ │ ├── svm_MWF.csv
│ │ ├── svm_RobustPeriod.csv
│ │ └── svm_SuSS.csv
│ └── window_sizes.csv
├── motifs
│ ├── images
│ │ ├── ECG-Heartbeat_grid.pdf
│ │ ├── EEG-Sleep-Data_grid.pdf
│ │ ├── Muscle-Activation_grid.pdf
│ │ └── fNIRS_grid.pdf
│ └── window_sizes.csv
├── ranks.csv
└── segmentation
│ ├── clasp
│ ├── clasp_ACF.csv
│ ├── clasp_Autoperiod.csv
│ ├── clasp_FFT.csv
│ ├── clasp_Human.csv
│ ├── clasp_MWF.csv
│ ├── clasp_RobustPeriod.csv
│ └── clasp_SuSS.csv
│ ├── floss
│ ├── floss_ACF.csv
│ ├── floss_Autoperiod.csv
│ ├── floss_FFT.csv
│ ├── floss_Human.csv
│ ├── floss_MWF.csv
│ ├── floss_RobustPeriod.csv
│ └── floss_SuSS.csv
│ ├── window
│ ├── window_ACF.csv
│ ├── window_Autoperiod.csv
│ ├── window_FFT.csv
│ ├── window_Human.csv
│ ├── window_MWF.csv
│ ├── window_RobustPeriod.csv
│ └── window_SuSS.csv
│ └── window_sizes.csv
├── notebooks
├── README.md
├── clasp.ipynb
├── discord.ipynb
├── floss.ipynb
├── isolation_forest.ipynb
├── motifs
│ ├── use_cases_fnirs.ipynb
│ ├── use_cases_motif_sets_ecg.ipynb
│ ├── use_cases_motif_sets_muscle_activation.ipynb
│ └── use_cases_motif_sets_physiodata_k_Komplex.ipynb
├── svm.ipynb
└── window.ipynb
├── requirements.txt
└── src
├── README.md
├── __init__.py
├── anomaly_detection
├── __init__.py
├── discord.py
├── isolation_forest.py
└── svm.py
├── data_loader.py
├── motifs
├── __init__.py
├── jars
│ ├── emma.jar
│ ├── latent_motifs.jar
│ └── set_finder.jar
├── motif.py
└── plotting.py
├── segmentation
├── __init__.py
├── clasp
│ ├── __init__.py
│ ├── clasp.py
│ ├── ensemble_clasp.py
│ ├── interval_knn.py
│ ├── knn.py
│ ├── penalty.py
│ ├── scoring.py
│ └── segmentation.py
├── floss.py
└── window.py
├── utils.py
└── window_size
├── __init__.py
├── autoperiod.py
├── mwf.py
├── period.py
├── robustperiod
├── __init__.py
├── fisher.py
├── huberacf.py
├── modwt.py
├── mperioreg.py
├── mperioreg_fallback.py
├── robustperiod.py
└── utils.py
└── suss.py
/.gitignore:
--------------------------------------------------------------------------------
1 | # Eclipse
2 | .classpath
3 | .project
4 | .settings/
5 |
6 | #PyCharm
7 | .idea/
8 | #VSCode
9 | .code/
10 |
11 | # Maven
12 | log/
13 | target/
14 |
15 | # PyDev
16 | .pydevproject
17 | __pycache__
18 | .pyc
19 | .cache/
20 | .ipynb_checkpoints/
21 |
22 | # Specific
23 | datasets/TSSB/*
24 | datasets/UCRAnomaly/*
25 |
26 | # Other
27 | .metadata/
28 | .recommenders/
29 | .DS_Store
30 | tmp/
31 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | BSD 3-Clause License
2 |
3 | Copyright (c) 2022, Arik Ermshaus
4 | All rights reserved.
5 |
6 | Redistribution and use in source and binary forms, with or without
7 | modification, are permitted provided that the following conditions are met:
8 |
9 | 1. Redistributions of source code must retain the above copyright notice, this
10 | list of conditions and the following disclaimer.
11 |
12 | 2. Redistributions in binary form must reproduce the above copyright notice,
13 | this list of conditions and the following disclaimer in the documentation
14 | and/or other materials provided with the distribution.
15 |
16 | 3. Neither the name of the copyright holder nor the names of its
17 | contributors may be used to endorse or promote products derived from
18 | this software without specific prior written permission.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Window Size Selection
2 | This is the supporting website for the paper "Window Size Selection In Unsupervised Time Series Analytics: A Review and Benchmark". It contains the used source codes, data sets, results and analysis notebooks. If you want to use window size selection techniques in your scientific publication or application, please use the updated and maintained claspy Python package.
3 |
4 | Time series (TS) are sequences of values ordered in time and have in common, that important insights from the data can be drawn by inspecting local substructures, or windows. As such, many state-of-the-art time series data mining (TSDM) methods characterize TS by inspecting local substructures. The window size for extracting such subsequences is a crucial hyper-parameter, and setting an inappropriate value results in poor TSDM results. We provide, for the first time, a systematic survey and experimental study of 6 TS window size selection (WSS) algorithms on three diverse TSDM tasks, namely anomaly detection, segmentation and motif discovery, using state-of-the art TSDM algorithms and benchmarks.
5 |
6 | This repository is structured as follows:
7 |
8 | - `benchmark` contains the source codes used for creating the window sizes (for all data sets) as well as the benchmark performances (for all tested algorithms).
9 | - `datasets` consists of the (links to the) time series data used in the study. It can be loaded with the data loader in `src/data_loader.py`.
10 | - `experiments` contains the computed window sizes (for the data sets) as well as the performance results (for the tested algorithms). It can be reproduced by running the scripts in the `benchmark` folder.
11 | - `notebooks` consists of analysis Jupyter notebooks, used to evaluate the experimental data in the `experiments` folder.
12 | - `src` contains the sources codes for window size selection and the time series analytics.
13 |
14 | ## Installation
15 |
16 | You can download this repository (clicking the download button in the upper right corner). As this repository is a supporting website and not an updated library, we do not recommend to install it, but rather extract and adapt code snippets of interest.
17 |
18 | ## Citation
19 |
20 | If you want reference our work in your scientific publication, we would appreciate the following citation:
21 |
22 | ```
23 | @inproceedings{wss2022,
24 | title={Window Size Selection In Unsupervised Time Series Analytics: A Review and Benchmark},
25 | author={Ermshaus, Arik and Sch{\"a}fer, Patrick and Leser, Ulf},
26 | booktitle={7th Workshop on Advanced Analytics and Learning on Temporal Data},
27 | year={2022}
28 | }
29 | ```
30 |
31 | ## Resources
32 |
33 | The review and benchmark was realized with the code and data sets from multiple authors and projects. We list here the resources we used (and adapted) for our study:
34 |
35 | - Anomaly Detection
36 | - One-Class SVM, Isolation Forest (https://scikit-learn.org/)
37 | - Discord Discovery (https://stumpy.readthedocs.io/)
38 | - Segmentation
39 | - ClaSP (https://sites.google.com/view/ts-parameter-free-clasp/)
40 | - FLOSS (https://stumpy.readthedocs.io/)
41 | - Window-based Segmentation (https://centre-borelli.github.io/ruptures-docs/)
42 | - Motif Discovery
43 | - EMMA (https://github.com/jMotif/SAX)
44 | - Set Finder (https://sites.google.com/site/timeseriesmotifsets/)
45 | - Window Size Detection
46 | - FFT, ACF (https://numpy.org/)
47 | - RobustPeriod (https://github.com/ariaghora/robust-period)
48 | - AutoPeriod (https://github.com/akofke/autoperiod)
49 | - Multi-Window-Finder (https://sites.google.com/view/multi-window-finder/)
50 | - SuSS (https://sites.google.com/view/ts-parameter-free-clasp/)
--------------------------------------------------------------------------------
/benchmark/README.md:
--------------------------------------------------------------------------------
1 | # Benchmark
2 | This folder contains the benchmark source codes for anomaly detection, segmentation and motif discovery. You can create the window sizes for the respective datasets executing the `*_wss.py` files and create the benchmark performances using the `*_benchmark.py` scripts.
--------------------------------------------------------------------------------
/benchmark/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ermshaua/window-size-selection/e247e2d05c0be1b59536420f5e979818d3ba2b79/benchmark/__init__.py
--------------------------------------------------------------------------------
/benchmark/anomaly_detection_benchmark.py:
--------------------------------------------------------------------------------
1 | import sys, os, shutil
2 |
3 | sys.path.insert(0, "../")
4 |
5 | import numpy as np
6 | np.random.seed(2357)
7 |
8 | import pandas as pd
9 | import daproli as dp
10 |
11 | from src.data_loader import load_ucr_anomaly_dataset
12 | from src.anomaly_detection.discord import discord
13 | from src.anomaly_detection.isolation_forest import isolation_forest
14 | from src.anomaly_detection.svm import svm
15 |
16 | from benchmark.metrics import anomaly_match
17 | from tqdm import tqdm
18 |
19 |
20 | def evaluate_candidate(candidate_name, eval_func, wsd, fac=1, columns=None, n_jobs=1, verbose=0, **seg_kwargs):
21 | df_ucr = load_ucr_anomaly_dataset(n_jobs=n_jobs, verbose=verbose)
22 | df_wsd = pd.read_csv("../experiments/anomaly_detection/window_sizes.csv")
23 |
24 | df_anomaly = pd.DataFrame()
25 | df_anomaly["name"] = df_ucr["name"]
26 | df_anomaly["window_size"] = np.asarray(df_wsd[wsd] * fac, dtype=np.int64)
27 | df_anomaly["test_start"] = df_ucr.test_start
28 | df_anomaly["anomaly_start"] = df_ucr.anomaly_start
29 | df_anomaly["anomaly_end"] = df_ucr.anomaly_end
30 | df_anomaly["time_series"] = df_ucr.time_series
31 |
32 | # length filter
33 | # df_anomaly = df_anomaly[df_anomaly.time_series.apply(len) < 100_000]
34 |
35 | df_eval = dp.map(
36 | lambda _, args: eval_func(*args, **seg_kwargs),
37 | tqdm(list(df_anomaly.iterrows()), disable=verbose<1),
38 | ret_type=list,
39 | verbose=0,
40 | n_jobs=n_jobs,
41 | )
42 |
43 | if columns is None:
44 | columns = ["name", "true_start", "true_end", "prediction", "match"]
45 |
46 | df_eval = pd.DataFrame.from_records(
47 | df_eval,
48 | index="name",
49 | columns=columns,
50 | )
51 |
52 | print(f"{candidate_name}: mean_acc={np.round(np.sum(df_eval.match) / df_eval.shape[0], 3)}")
53 | return df_eval
54 |
55 |
56 | def evaluate_discord_candidate(name, window_size, test_start, anomaly_start, anomaly_end, ts):
57 | if window_size <= 0:
58 | return name, anomaly_start, anomaly_end, -1, False
59 |
60 | prediction = discord(ts, window_size=window_size, test_start=test_start)
61 | match = anomaly_match(prediction, anomaly_start, anomaly_end)
62 | return name, anomaly_start, anomaly_end, prediction, match
63 |
64 |
65 | def evaluate_discord(exp_path, n_jobs, verbose):
66 | exp_name = "discord"
67 |
68 | if os.path.exists(exp_path + exp_name):
69 | shutil.rmtree(exp_path + exp_name)
70 |
71 | os.mkdir(exp_path + exp_name)
72 |
73 | df_wsd = pd.read_csv("../experiments/segmentation/window_sizes.csv")
74 |
75 | for algo in df_wsd.columns[2:]:
76 | candidate_name = f"{exp_name}_{algo}"
77 | print(f"Evaluating parameter candidate: {candidate_name}")
78 |
79 | df = evaluate_candidate(
80 | candidate_name,
81 | eval_func=evaluate_discord_candidate,
82 | n_jobs=n_jobs,
83 | verbose=verbose,
84 | wsd=algo,
85 | )
86 |
87 | df.to_csv(f"{exp_path}{exp_name}/{candidate_name}.csv")
88 |
89 |
90 | def evaluate_if_candidate(name, window_size, test_start, anomaly_start, anomaly_end, ts):
91 | if window_size <= 0:
92 | return name, anomaly_start, anomaly_end, -1, False
93 |
94 | prediction = isolation_forest(ts, window_size=window_size, test_start=test_start)
95 | match = anomaly_match(prediction, anomaly_start, anomaly_end)
96 | return name, anomaly_start, anomaly_end, prediction, match
97 |
98 |
99 | def evaluate_if(exp_path, n_jobs, verbose):
100 | exp_name = "isolation_forest"
101 |
102 | if os.path.exists(exp_path + exp_name):
103 | shutil.rmtree(exp_path + exp_name)
104 |
105 | os.mkdir(exp_path + exp_name)
106 |
107 | df_wsd = pd.read_csv("../experiments/segmentation/window_sizes.csv")
108 |
109 | for algo in df_wsd.columns[2:]:
110 | candidate_name = f"{exp_name}_{algo}"
111 | print(f"Evaluating parameter candidate: {candidate_name}")
112 |
113 | df = evaluate_candidate(
114 | candidate_name,
115 | eval_func=evaluate_if_candidate,
116 | n_jobs=n_jobs,
117 | verbose=verbose,
118 | wsd=algo,
119 | )
120 |
121 | df.to_csv(f"{exp_path}{exp_name}/{candidate_name}.csv")
122 |
123 |
124 | def evaluate_svm_candidate(name, window_size, test_start, anomaly_start, anomaly_end, ts):
125 | if window_size <= 0:
126 | return name, anomaly_start, anomaly_end, -1, False
127 |
128 | prediction = svm(ts, window_size=window_size, test_start=test_start)
129 | match = anomaly_match(prediction, anomaly_start, anomaly_end)
130 | return name, anomaly_start, anomaly_end, prediction, match
131 |
132 |
133 | def evaluate_svm(exp_path, n_jobs, verbose):
134 | exp_name = "svm"
135 |
136 | if os.path.exists(exp_path + exp_name):
137 | shutil.rmtree(exp_path + exp_name)
138 |
139 | os.mkdir(exp_path + exp_name)
140 |
141 | df_wsd = pd.read_csv("../experiments/segmentation/window_sizes.csv")
142 |
143 | for algo in df_wsd.columns[2:]:
144 | candidate_name = f"{exp_name}_{algo}"
145 | print(f"Evaluating parameter candidate: {candidate_name}")
146 |
147 | df = evaluate_candidate(
148 | candidate_name,
149 | eval_func=evaluate_svm_candidate,
150 | n_jobs=n_jobs,
151 | verbose=verbose,
152 | wsd=algo,
153 | )
154 |
155 | df.to_csv(f"{exp_path}{exp_name}/{candidate_name}.csv")
156 |
157 |
158 | if __name__ == '__main__':
159 | exp_path = "../experiments/anomaly_detection/"
160 | n_jobs, verbose = -1, 0
161 |
162 | if not os.path.exists(exp_path):
163 | os.mkdir(exp_path)
164 |
165 | evaluate_discord(exp_path, n_jobs, verbose)
166 | evaluate_if(exp_path, n_jobs, verbose)
167 | evaluate_svm(exp_path, n_jobs, verbose)
--------------------------------------------------------------------------------
/benchmark/metrics.py:
--------------------------------------------------------------------------------
1 |
2 |
3 | def true_positives(T, X, margin=5):
4 | # make a copy so we don't affect the caller
5 | X = set(list(X))
6 | TP = set()
7 | for tau in T:
8 | close = [(abs(tau - x), x) for x in X if abs(tau - x) <= margin]
9 | close.sort()
10 | if not close:
11 | continue
12 | dist, xstar = close[0]
13 | TP.add(tau)
14 | X.remove(xstar)
15 | return TP
16 |
17 |
18 | def f_measure(annotations, predictions, margin=5, alpha=0.5, return_PR=False):
19 | # ensure 0 is in all the sets
20 | Tks = {k + 1: set(annotations[uid]) for k, uid in enumerate(annotations)}
21 | for Tk in Tks.values():
22 | Tk.add(0)
23 |
24 | X = set(predictions)
25 | X.add(0)
26 |
27 | Tstar = set()
28 | for Tk in Tks.values():
29 | for tau in Tk:
30 | Tstar.add(tau)
31 |
32 | K = len(Tks)
33 |
34 | P = len(true_positives(Tstar, X, margin=margin)) / len(X)
35 |
36 | TPk = {k: true_positives(Tks[k], X, margin=margin) for k in Tks}
37 | R = 1 / K * sum(len(TPk[k]) / len(Tks[k]) for k in Tks)
38 |
39 | F = P * R / (alpha * R + (1 - alpha) * P)
40 | if return_PR:
41 | return F, P, R
42 | return F
43 |
44 |
45 | def overlap(A, B):
46 | """ Return the overlap (i.e. Jaccard index) of two sets
47 |
48 | >>> overlap({1, 2, 3}, set())
49 | 0.0
50 | >>> overlap({1, 2, 3}, {2, 5})
51 | 0.25
52 | >>> overlap(set(), {1, 2, 3})
53 | 0.0
54 | >>> overlap({1, 2, 3}, {1, 2, 3})
55 | 1.0
56 | """
57 | return len(A.intersection(B)) / len(A.union(B))
58 |
59 |
60 | def partition_from_cps(locations, n_obs):
61 | """ Return a list of sets that give a partition of the set [0, T-1], as
62 | defined by the change point locations.
63 |
64 | >>> partition_from_cps([], 5)
65 | [{0, 1, 2, 3, 4}]
66 | >>> partition_from_cps([3, 5], 8)
67 | [{0, 1, 2}, {3, 4}, {5, 6, 7}]
68 | >>> partition_from_cps([1,2,7], 8)
69 | [{0}, {1}, {2, 3, 4, 5, 6}, {7}]
70 | >>> partition_from_cps([0, 4], 6)
71 | [{0, 1, 2, 3}, {4, 5}]
72 | """
73 | T = n_obs
74 | partition = []
75 | current = set()
76 |
77 | all_cps = iter(sorted(set(locations)))
78 | cp = next(all_cps, None)
79 | for i in range(T):
80 | if i == cp:
81 | if current:
82 | partition.append(current)
83 | current = set()
84 | cp = next(all_cps, None)
85 | current.add(i)
86 | partition.append(current)
87 | return partition
88 |
89 |
90 | def cover_single(Sprime, S):
91 | """Compute the covering of a segmentation S by a segmentation Sprime.
92 |
93 | This follows equation (8) in Arbaleaz, 2010.
94 |
95 | >>> cover_single([{1, 2, 3}, {4, 5}, {6}], [{1, 2, 3}, {4, 5, 6}])
96 | 0.8333333333333334
97 | >>> cover_single([{1, 2, 3, 4}, {5, 6}], [{1, 2, 3, 4, 5, 6}])
98 | 0.6666666666666666
99 | >>> cover_single([{1, 2}, {3, 4}, {5, 6}], [{1, 2, 3}, {4, 5, 6}])
100 | 0.6666666666666666
101 | >>> cover_single([{1, 2, 3, 4, 5, 6}], [{1}, {2}, {3}, {4, 5, 6}])
102 | 0.3333333333333333
103 | """
104 | T = sum(map(len, Sprime))
105 | assert T == sum(map(len, S))
106 | C = 0
107 | for R in S:
108 | C += len(R) * max(overlap(R, Rprime) for Rprime in Sprime)
109 | C /= T
110 | return C
111 |
112 |
113 | def covering(annotations, predictions, n_obs):
114 | """Compute the average segmentation covering against the human annotations.
115 |
116 | annotations : dict from user_id to iterable of CP locations
117 | predictions : iterable of predicted Cp locations
118 | n_obs : number of observations in the series
119 |
120 | >>> covering({1: [10, 20], 2: [10], 3: [0, 5]}, [10, 20], 45)
121 | 0.7962962962962963
122 | >>> covering({1: [], 2: [10], 3: [40]}, [10], 45)
123 | 0.7954144620811286
124 | >>> covering({1: [], 2: [10], 3: [40]}, [], 45)
125 | 0.8189300411522634
126 |
127 | """
128 | Ak = {
129 | k + 1: partition_from_cps(annotations[uid], n_obs)
130 | for k, uid in enumerate(annotations)
131 | }
132 | pX = partition_from_cps(predictions, n_obs)
133 |
134 | Cs = [cover_single(pX, Ak[k]) for k in Ak]
135 | return sum(Cs) / len(Cs)
136 |
137 |
138 | def anomaly_match(prediction, true_start, true_end):
139 | return prediction in range(true_start - 100, true_end + 100)
140 |
--------------------------------------------------------------------------------
/benchmark/motifs_wss.py:
--------------------------------------------------------------------------------
1 | import sys, os, shutil
2 |
3 | import pandas as pd
4 |
5 | sys.path.insert(0, "../")
6 |
7 | import numpy as np
8 | np.random.seed(2357)
9 |
10 | import daproli as dp
11 |
12 |
13 | from src.data_loader import load_motifs_datasets
14 | from src.window_size.period import dominant_fourier_freq, highest_autocorrelation
15 | from src.window_size.suss import suss
16 | from src.window_size.mwf import mwf
17 | from src.window_size.autoperiod import autoperiod
18 | from src.window_size.robustperiod import robust_period
19 |
20 |
21 | def evaluate_window_size(exp_path, n_jobs, verbose):
22 | exp_name = "motifs"
23 |
24 | if os.path.exists(exp_path + exp_name):
25 | shutil.rmtree(exp_path + exp_name)
26 |
27 | os.mkdir(exp_path + exp_name)
28 |
29 | algorithms = [
30 | ("Ground Truth", "GroundTruth"),
31 | ("FFT", dominant_fourier_freq),
32 | ("ACF", highest_autocorrelation),
33 | ("SuSS", suss),
34 | ("MWF", mwf),
35 | ("Autoperiod", autoperiod),
36 | ("RobustPeriod", robust_period)
37 | ]
38 |
39 | df_motifs = load_motifs_datasets()
40 |
41 | df_wsd = pd.DataFrame()
42 | df_wsd["dataset"] = df_motifs["name"]
43 |
44 | for candidate_name, algorithm in algorithms:
45 | print(f"Evaluating window size candidate candidate: {candidate_name}")
46 |
47 | if candidate_name == "Ground Truth":
48 | window_sizes = df_motifs.window_size.astype(int)
49 | else:
50 | window_sizes = dp.map(algorithm, df_motifs.time_series, expand_args=False, ret_type=np.array, n_jobs=n_jobs, verbose=verbose)
51 |
52 | df_wsd[candidate_name] = window_sizes
53 |
54 | df_wsd.to_csv(f"{exp_path}{exp_name}/window_sizes.csv")
55 |
56 |
57 | if __name__ == '__main__':
58 | exp_path = "../experiments/"
59 | n_jobs, verbose = -1, 0
60 |
61 | if not os.path.exists(exp_path):
62 | os.mkdir(exp_path)
63 |
64 | evaluate_window_size(exp_path, n_jobs, verbose)
--------------------------------------------------------------------------------
/benchmark/segmentation_benchmark.py:
--------------------------------------------------------------------------------
1 | import sys, os, shutil
2 |
3 | import ruptures.exceptions
4 |
5 | sys.path.insert(0, "../")
6 |
7 | import numpy as np
8 | np.random.seed(2357)
9 |
10 | import pandas as pd
11 | import daproli as dp
12 | import ruptures as rpt
13 |
14 | from src.data_loader import load_tssb_dataset
15 | from src.segmentation.floss import floss
16 | from src.segmentation.window import window
17 | from src.segmentation.clasp.segmentation import segmentation
18 |
19 | from benchmark.metrics import f_measure, covering
20 | from tqdm import tqdm
21 |
22 |
23 | def evaluate_candidate(candidate_name, eval_func, wsd, fac=1, columns=None, n_jobs=1, verbose=0, **seg_kwargs):
24 | df_tssb = load_tssb_dataset()
25 | df_wsd = pd.read_csv("../experiments/segmentation/window_sizes.csv")
26 |
27 | df_tssb.window_size = np.asarray(df_wsd[wsd] * fac, dtype=np.int64)
28 |
29 | df_eval = dp.map(
30 | lambda _, args: eval_func(*args, **seg_kwargs),
31 | tqdm(list(df_tssb.iterrows()), disable=verbose<1),
32 | ret_type=list,
33 | verbose=0,
34 | n_jobs=n_jobs,
35 | )
36 |
37 | if columns is None:
38 | columns = ["name", "true_cps", "found_cps", "f1_score", "covering_score"]
39 |
40 | df_eval = pd.DataFrame.from_records(
41 | df_eval,
42 | index="name",
43 | columns=columns,
44 | )
45 |
46 | print(f"{candidate_name}: mean_f1_score={np.round(df_eval.f1_score.mean(), 3)}, mean_covering_score={np.round(df_eval.covering_score.mean(), 3)}")
47 | return df_eval
48 |
49 |
50 | def evaluate_floss_candidate(name, window_size, cps, ts, **seg_kwargs):
51 | if window_size <= 0:
52 | return name, cps.tolist(), [], 0., 0., np.zeros(ts.shape[0])
53 |
54 | cac, found_cps = floss(ts, window_size=window_size, return_cac=True, n_cps=len(cps))
55 |
56 | f1_score = f_measure({0: cps}, found_cps, margin=int(ts.shape[0] * .01))
57 | covering_score = covering({0: cps}, found_cps, ts.shape[0])
58 |
59 | # print(f"{name}: Found CPs: {found_cps} F1-Score: {np.round(f1_score, 3)}, Covering-Score: {np.round(covering_score, 3)}")
60 | return name, cps.tolist(), found_cps.tolist(), np.round(f1_score, 3), np.round(covering_score, 3), cac
61 |
62 |
63 | def evaluate_floss(exp_path, n_jobs, verbose):
64 | exp_name = "floss"
65 |
66 | if os.path.exists(exp_path + exp_name):
67 | shutil.rmtree(exp_path + exp_name)
68 |
69 | os.mkdir(exp_path + exp_name)
70 |
71 | df_wsd = pd.read_csv("../experiments/segmentation/window_sizes.csv")
72 |
73 | for algo in df_wsd.columns[2:]:
74 | candidate_name = f"{exp_name}_{algo}"
75 | print(f"Evaluating parameter candidate: {candidate_name}")
76 |
77 | df = evaluate_candidate(
78 | candidate_name,
79 | eval_func=evaluate_floss_candidate,
80 | n_jobs=n_jobs,
81 | verbose=verbose,
82 | wsd=algo,
83 | columns=["name", "true_cps", "found_cps", "f1_score", "covering_score", "cac"]
84 | )
85 |
86 | df.to_csv(f"{exp_path}{exp_name}/{candidate_name}.csv")
87 |
88 |
89 | def evaluate_window_candidate(name, window_size, cps, ts, **seg_kwargs):
90 | if window_size <= 0:
91 | return name, cps.tolist(), [], 0., 0.
92 |
93 | try:
94 | found_cps = window(ts, window_size, n_cps=len(cps))
95 | f1_score = f_measure({0: cps}, found_cps, margin=int(ts.shape[0] * .01))
96 | covering_score = covering({0: cps}, found_cps, ts.shape[0])
97 | except rpt.exceptions.NotEnoughPoints:
98 | found_cps = np.zeros(0, dtype=np.int64)
99 | f1_score = 0.
100 | covering_score = 0.
101 |
102 | # print(f"{name}: Found CPs: {found_cps} F1-Score: {np.round(f1_score, 3)}, Covering-Score: {np.round(covering_score, 3)}")
103 | return name, cps.tolist(), found_cps.tolist(), np.round(f1_score, 3), np.round(covering_score, 3)
104 |
105 |
106 | def evaluate_window(exp_path, n_jobs, verbose):
107 | exp_name = "window"
108 |
109 | if os.path.exists(exp_path + exp_name):
110 | shutil.rmtree(exp_path + exp_name)
111 |
112 | os.mkdir(exp_path + exp_name)
113 |
114 | df_wsd = pd.read_csv("../experiments/segmentation/window_sizes.csv")
115 |
116 | for algo in df_wsd.columns[2:]:
117 | candidate_name = f"{exp_name}_{algo}"
118 | print(f"Evaluating parameter candidate: {candidate_name}")
119 |
120 | df = evaluate_candidate(
121 | candidate_name,
122 | eval_func=evaluate_window_candidate,
123 | n_jobs=n_jobs,
124 | verbose=verbose,
125 | wsd=algo,
126 | )
127 |
128 | df.to_csv(f"{exp_path}{exp_name}/{candidate_name}.csv")
129 |
130 |
131 | def evaluate_clasp_candidate(name, window_size, cps, ts):
132 | if window_size <= 0:
133 | return name, cps.tolist(), [], 0., 0., np.zeros(ts.shape[0])
134 |
135 | profile, window_size, found_cps, found_scores = segmentation(ts, window_size=window_size, n_change_points=len(cps))
136 |
137 | f1_score = f_measure({0: cps}, found_cps, margin=int(ts.shape[0] * .01))
138 | covering_score = covering({0: cps}, found_cps, ts.shape[0])
139 |
140 | # print(f"{name}: Window Size: {window_size}, True Change Points: {cps}, Found Change Points: {found_cps}, Scores: {np.round(found_scores, 3)}, F1-Score: {np.round(f1_score, 3)}, Covering-Score: {np.round(covering_score, 3)}")
141 | return name, cps.tolist(), found_cps.tolist(), np.round(f1_score, 3), np.round(covering_score, 3), profile.tolist()
142 |
143 |
144 | def evaluate_clasp(exp_path, n_jobs, verbose):
145 | exp_name = "clasp"
146 |
147 | if os.path.exists(exp_path + exp_name):
148 | shutil.rmtree(exp_path + exp_name)
149 |
150 | os.mkdir(exp_path + exp_name)
151 |
152 | df_wsd = pd.read_csv("../experiments/segmentation/window_sizes.csv")
153 |
154 | for algo in df_wsd.columns[2:]:
155 | candidate_name = f"{exp_name}_{algo}"
156 | print(f"Evaluating parameter candidate: {candidate_name}")
157 |
158 | df = evaluate_candidate(
159 | candidate_name,
160 | eval_func=evaluate_clasp_candidate,
161 | n_jobs=n_jobs,
162 | verbose=verbose,
163 | wsd=algo,
164 | columns=["name", "true_cps", "found_cps", "f1_score", "covering_score", "clasp"]
165 | )
166 |
167 | df.to_csv(f"{exp_path}{exp_name}/{candidate_name}.csv")
168 |
169 |
170 | if __name__ == '__main__':
171 | exp_path = "../experiments/segmentation/"
172 | n_jobs, verbose = -1, 0
173 |
174 | if not os.path.exists(exp_path):
175 | os.mkdir(exp_path)
176 |
177 | # evaluate_floss(exp_path, n_jobs, verbose)
178 | # evaluate_window(exp_path, n_jobs, verbose)
179 | evaluate_clasp(exp_path, n_jobs, verbose)
--------------------------------------------------------------------------------
/benchmark/tssb_wss.py:
--------------------------------------------------------------------------------
1 | import sys, os, shutil
2 |
3 | import pandas as pd
4 |
5 | sys.path.insert(0, "../")
6 |
7 | import numpy as np
8 | np.random.seed(2357)
9 |
10 | import daproli as dp
11 |
12 |
13 | from src.data_loader import load_tssb_dataset
14 | from src.window_size.period import dominant_fourier_freq, highest_autocorrelation
15 | from src.window_size.suss import suss
16 | from src.window_size.mwf import mwf
17 | from src.window_size.autoperiod import autoperiod
18 | from src.window_size.robustperiod import robust_period
19 |
20 |
21 | def evaluate_window_size(exp_path, n_jobs, verbose):
22 | exp_name = "segmentation"
23 |
24 | if os.path.exists(exp_path + exp_name):
25 | shutil.rmtree(exp_path + exp_name)
26 |
27 | os.mkdir(exp_path + exp_name)
28 |
29 | algorithms = [
30 | ("Human", "human"),
31 | ("FFT", dominant_fourier_freq),
32 | ("ACF", highest_autocorrelation),
33 | ("SuSS", suss),
34 | ("MWF", mwf),
35 | ("Autoperiod", autoperiod),
36 | ("RobustPeriod", robust_period)
37 | ]
38 |
39 | df_tssb = load_tssb_dataset()
40 |
41 | df_wsd = pd.DataFrame()
42 | df_wsd["dataset"] = df_tssb["name"]
43 |
44 | for candidate_name, algorithm in algorithms:
45 | print(f"Evaluating window size candidate candidate: {candidate_name}")
46 |
47 | if candidate_name == "Human":
48 | window_sizes = df_tssb.window_size.to_numpy()
49 | else:
50 | window_sizes = dp.map(algorithm, df_tssb.time_series, expand_args=False, ret_type=np.array, n_jobs=n_jobs, verbose=verbose)
51 |
52 | df_wsd[candidate_name] = window_sizes
53 |
54 | df_wsd.to_csv(f"{exp_path}{exp_name}/window_sizes.csv")
55 |
56 |
57 | if __name__ == '__main__':
58 | exp_path = "../experiments/"
59 | n_jobs, verbose = -1, 0
60 |
61 | if not os.path.exists(exp_path):
62 | os.mkdir(exp_path)
63 |
64 | evaluate_window_size(exp_path, n_jobs, verbose)
--------------------------------------------------------------------------------
/benchmark/ucr_anomaly_wss.py:
--------------------------------------------------------------------------------
1 | import sys, os, shutil
2 |
3 | import pandas as pd
4 |
5 | sys.path.insert(0, "../")
6 |
7 | import numpy as np
8 | np.random.seed(2357)
9 |
10 | import daproli as dp
11 |
12 |
13 | from src.data_loader import load_ucr_anomaly_dataset
14 | from src.window_size.period import dominant_fourier_freq, highest_autocorrelation
15 | from src.window_size.suss import suss
16 | from src.window_size.mwf import mwf
17 | from src.window_size.autoperiod import autoperiod
18 | from src.window_size.robustperiod import robust_period
19 |
20 |
21 | def evaluate_window_size(exp_path, n_jobs, verbose):
22 | exp_name = "anomaly_detection"
23 |
24 | if os.path.exists(exp_path + exp_name):
25 | shutil.rmtree(exp_path + exp_name)
26 |
27 | os.mkdir(exp_path + exp_name)
28 |
29 | algorithms = [
30 | ("Human", "human"),
31 | ("FFT", dominant_fourier_freq),
32 | ("ACF", highest_autocorrelation),
33 | ("SuSS", suss),
34 | ("MWF", mwf),
35 | ("Autoperiod", autoperiod),
36 | ("RobustPeriod", robust_period)
37 | ]
38 |
39 | df_ucr = load_ucr_anomaly_dataset(verbose=1, n_jobs=-1)
40 |
41 | df_wsd = pd.DataFrame()
42 | df_wsd["dataset"] = df_ucr["name"]
43 |
44 | ts = dp.map(lambda test_start, ts: ts[:test_start], zip(df_ucr.test_start, df_ucr.time_series), ret_type=list)
45 |
46 | for candidate_name, algorithm in algorithms:
47 | print(f"Evaluating window size candidate candidate: {candidate_name}")
48 |
49 | if candidate_name == "Human":
50 | window_sizes = df_ucr.anomaly_end.to_numpy() - df_ucr.anomaly_start.to_numpy()
51 | else:
52 | window_sizes = dp.map(algorithm, ts, expand_args=False, ret_type=np.array, n_jobs=n_jobs, verbose=verbose)
53 |
54 | df_wsd[candidate_name] = window_sizes
55 |
56 | df_wsd.to_csv(f"{exp_path}{exp_name}/window_sizes.csv")
57 |
58 |
59 | if __name__ == '__main__':
60 | exp_path = "../experiments/"
61 | n_jobs, verbose = -1, 0
62 |
63 | if not os.path.exists(exp_path):
64 | os.mkdir(exp_path)
65 |
66 | evaluate_window_size(exp_path, n_jobs, verbose)
--------------------------------------------------------------------------------
/datasets/README.md:
--------------------------------------------------------------------------------
1 | # Datasets
2 | In this folder, the used anomaly detection, segmentation and motif discovery datasets are stored.
3 |
4 | - `motifs` contains the data for the discussed motif discovery use cases in the paper (as well as additional ones)
5 | - `TSSB` the Time Series Segmentation Benchmark dataset can be download here: https://sites.google.com/view/ts-parameter-free-clasp/
6 | - `UCRAnomaly` The Hexagon UCR Time Series Anomaly Dataset can be downloaded here: https://www.cs.ucr.edu/~eamonn/time_series_data_2018/
--------------------------------------------------------------------------------
/datasets/motifs/desc.csv:
--------------------------------------------------------------------------------
1 | winding_col,60
2 | ecg-heartbeat-av,125
3 | fNIRS_subLen_600,160
4 | muscle_activation,600
5 | npo141,25
--------------------------------------------------------------------------------
/datasets/motifs/ecg-heartbeat-av_gt.csv:
--------------------------------------------------------------------------------
1 | ,calibration,heartbeats
2 | 0,"[[0, 1000]]","[[1200, 4000]]"
3 |
--------------------------------------------------------------------------------
/datasets/motifs/muscle_activation_gt.csv:
--------------------------------------------------------------------------------
1 | id,recovery,activation
2 | 0,"[[4790, 5090], [5481, 5781], [6338, 6638], [7207, 7507], [8131, 8431], [8948, 9248], [9831, 10131], [10680, 10980], [11601, 11901], [12446, 12746], [13400, 13700], [14212, 14512]]","[[257, 557], [5216, 5516], [5890, 6190], [6755, 7055], [7628, 7928], [8509, 8809], [9374, 9674], [10256, 10556], [11093, 11393], [12001, 12301], [12870, 13170], [13760, 14060], [14595, 14895]]"
3 |
--------------------------------------------------------------------------------
/experiments/README.md:
--------------------------------------------------------------------------------
1 | # Experiments
2 | This folder contains the anomaly detection, segmentation and motif discovery benchmark results. They can be explored and analysed with the Jupyter notebooks in the `../notebooks` folder.
--------------------------------------------------------------------------------
/experiments/anomaly_detection/discord/discord_ACF.csv:
--------------------------------------------------------------------------------
1 | name,true_start,true_end,prediction,match
2 | DISTORTED1sddb40,52000,52620,52355,True
3 | DISTORTED2sddb40,56600,56900,56597,True
4 | DISTORTED3sddb40,46600,46900,67102,False
5 | DISTORTEDBIDMC1,5400,5600,5501,True
6 | DISTORTEDCIMIS44AirTemperature1,5391,5392,7195,False
7 | DISTORTEDCIMIS44AirTemperature2,5703,5727,7194,False
8 | DISTORTEDCIMIS44AirTemperature3,6520,6544,6508,True
9 | DISTORTEDCIMIS44AirTemperature4,5549,5597,7194,False
10 | DISTORTEDCIMIS44AirTemperature5,4852,4900,4850,True
11 | DISTORTEDCIMIS44AirTemperature6,6006,6054,6031,True
12 | DISTORTEDECG1,11800,12100,25856,False
13 | DISTORTEDECG2,16000,16100,25859,False
14 | DISTORTEDECG3,16000,16100,16021,True
15 | DISTORTEDECG3,17000,17100,16909,True
16 | DISTORTEDECG4,16800,17100,16874,True
17 | DISTORTEDECG4,16900,17100,17024,True
18 | DISTORTEDECG4,17000,17100,17024,True
19 | DISTORTEDECG4,17000,17100,17015,True
20 | DISTORTEDGP711MarkerLFM5z1,6168,6212,6141,True
21 | DISTORTEDGP711MarkerLFM5z2,7175,7388,7224,True
22 | DISTORTEDGP711MarkerLFM5z3,5948,5993,5919,True
23 | DISTORTEDGP711MarkerLFM5z4,6527,6645,6385,False
24 | DISTORTEDGP711MarkerLFM5z5,8612,8716,8648,True
25 | DISTORTEDInternalBleeding10,4526,4556,4413,False
26 | DISTORTEDInternalBleeding14,5607,5634,5517,True
27 | DISTORTEDInternalBleeding15,5684,5854,5807,True
28 | DISTORTEDInternalBleeding16,4187,4199,6626,False
29 | DISTORTEDInternalBleeding17,3198,3309,3134,True
30 | DISTORTEDInternalBleeding18,4485,4587,5276,False
31 | DISTORTEDInternalBleeding19,4187,4197,4167,True
32 | DISTORTEDInternalBleeding20,5759,5919,5803,True
33 | DISTORTEDInternalBleeding4,4675,5033,4682,True
34 | DISTORTEDInternalBleeding5,6200,6370,6160,True
35 | DISTORTEDInternalBleeding6,3474,3629,3661,True
36 | DISTORTEDInternalBleeding8,5865,5974,5733,False
37 | DISTORTEDInternalBleeding9,6599,6681,5280,False
38 | DISTORTEDLab2Cmac011215EPG1,17210,17260,17213,True
39 | DISTORTEDLab2Cmac011215EPG2,27862,27932,27897,True
40 | DISTORTEDLab2Cmac011215EPG3,16390,16420,16383,True
41 | DISTORTEDLab2Cmac011215EPG4,17390,17520,17458,True
42 | DISTORTEDLab2Cmac011215EPG5,17390,17520,17394,True
43 | DISTORTEDLab2Cmac011215EPG6,12190,12420,12389,True
44 | DISTORTEDMesoplodonDensirostris,19280,19440,14936,False
45 | DISTORTEDPowerDemand1,18485,18821,18438,True
46 | DISTORTEDPowerDemand2,23357,23717,14145,False
47 | DISTORTEDPowerDemand3,23405,23477,22819,False
48 | DISTORTEDPowerDemand4,24005,24077,24001,True
49 | DISTORTEDTkeepFifthMARS,5988,6085,5989,True
50 | DISTORTEDTkeepFirstMARS,5365,5380,4425,False
51 | DISTORTEDTkeepForthMARS,5988,6085,5228,False
52 | DISTORTEDTkeepSecondMARS,9330,9340,9323,True
53 | DISTORTEDTkeepThirdMARS,4711,4809,4721,True
54 | DISTORTEDWalkingAceleration1,2764,2995,5736,False
55 | DISTORTEDWalkingAceleration5,5920,5979,5931,True
56 | DISTORTEDapneaecg2,20950,21100,10778,False
57 | DISTORTEDapneaecg3,11111,11211,26906,False
58 | DISTORTEDapneaecg4,16000,16100,11809,False
59 | DISTORTEDapneaecg,12240,12308,10783,False
60 | DISTORTEDgait1,38500,38800,54306,False
61 | DISTORTEDgait2,46500,46800,35620,False
62 | DISTORTEDgait3,59900,60500,35665,False
63 | DISTORTEDgaitHunt1,33070,33180,43591,False
64 | DISTORTEDgaitHunt2,31200,31850,43782,False
65 | DISTORTEDgaitHunt3,38400,39200,43591,False
66 | DISTORTEDinsectEPG1,7000,7030,7001,True
67 | DISTORTEDinsectEPG2,8000,8025,8009,True
68 | DISTORTEDinsectEPG3,7000,7050,8813,False
69 | DISTORTEDinsectEPG4,6508,6558,6533,True
70 | DISTORTEDinsectEPG5,8500,8501,8512,True
71 | DISTORTEDltstdbs30791AI,52600,52800,52515,True
72 | DISTORTEDltstdbs30791AS,52600,52800,52633,True
73 | DISTORTEDltstdbs30791ES,52600,52800,52703,True
74 | DISTORTEDpark3m,72150,72495,76949,False
75 | DISTORTEDqtdbSel1005V,12400,12800,12613,True
76 | DISTORTEDqtdbSel100MLII,13400,13800,13589,True
77 | DISTORTEDresperation10,130700,131880,130721,True
78 | DISTORTEDresperation11,110800,110801,131384,False
79 | DISTORTEDresperation1,110260,110412,109958,False
80 | DISTORTEDresperation2,168250,168250,140105,False
81 | DISTORTEDresperation2,168250,168251,139951,False
82 | DISTORTEDresperation3,158250,158251,116064,False
83 | DISTORTEDresperation4,128430,128431,128382,True
84 | DISTORTEDresperation9,143411,143511,117998,False
85 | DISTORTEDs20101mML2,35774,35874,35734,True
86 | DISTORTEDs20101m,35774,35874,35756,True
87 | DISTORTEDsddb49,67950,68200,67907,True
88 | DISTORTEDsel840mECG1,51370,51740,51564,True
89 | DISTORTEDsel840mECG2,49370,49740,49567,True
90 | DISTORTEDtiltAPB1,114283,114350,114152,False
91 | DISTORTEDtiltAPB2,124159,124985,124845,True
92 | DISTORTEDtiltAPB3,114000,114370,113874,False
93 | DISTORTEDtiltAPB4,67995,67996,67365,False
94 | NOISE1sddb40,52000,52620,52353,True
95 | NOISEBIDMC1,5400,5600,5501,True
96 | NOISECIMIS44AirTemperature4,5549,5597,7194,False
97 | NOISEECG4,16900,17100,17024,True
98 | NOISEGP711MarkerLFM5z3,5948,5993,5905,True
99 | NOISEInternalBleeding16,4187,4199,4182,True
100 | NOISEInternalBleeding6,3474,3629,3473,True
101 | NOISELab2Cmac011215EPG1,17210,17260,17213,True
102 | NOISELab2Cmac011215EPG4,17390,17520,17457,True
103 | NOISEMesoplodonDensirostris,19280,19440,12819,False
104 | NOISETkeepThirdMARS,4711,4809,4720,True
105 | NOISEapneaecg4,16000,16100,10646,False
106 | NOISEgait3,59900,60500,54179,False
107 | NOISEgaitHunt2,31200,31850,43780,False
108 | NOISEinsectEPG3,7000,7050,8813,False
109 | NOISEresperation2,168250,168250,131185,False
110 | 1sddb40,52000,52620,52354,True
111 | 2sddb40,56600,56900,56635,True
112 | 3sddb40,46600,46900,67158,False
113 | BIDMC1,5400,5600,5502,True
114 | CIMIS44AirTemperature1,5391,5392,7193,False
115 | CIMIS44AirTemperature2,5703,5727,7193,False
116 | CIMIS44AirTemperature3,6520,6544,6507,True
117 | CIMIS44AirTemperature4,5549,5597,7193,False
118 | CIMIS44AirTemperature5,4852,4900,4852,True
119 | CIMIS44AirTemperature6,6006,6054,6031,True
120 | ECG1,11800,12100,11936,True
121 | ECG2,16000,16100,25858,False
122 | ECG3,16000,16100,16021,True
123 | ECG3,17000,17100,16910,True
124 | ECG4,16800,17100,16515,False
125 | ECG4,16900,17100,17024,True
126 | ECG4,17000,17100,17025,True
127 | ECG4,17000,17100,17015,True
128 | GP711MarkerLFM5z1,6168,6212,6137,True
129 | GP711MarkerLFM5z2,7175,7388,7223,True
130 | GP711MarkerLFM5z3,5948,5993,5903,True
131 | GP711MarkerLFM5z4,6527,6645,6385,False
132 | GP711MarkerLFM5z5,8612,8716,8650,True
133 | InternalBleeding10,4526,4556,4435,True
134 | InternalBleeding14,5607,5634,5505,False
135 | InternalBleeding15,5684,5854,5806,True
136 | InternalBleeding16,4187,4199,4181,True
137 | InternalBleeding17,3198,3309,3127,True
138 | InternalBleeding18,4485,4587,4404,True
139 | InternalBleeding19,4187,4197,4177,True
140 | InternalBleeding20,5759,5919,5796,True
141 | InternalBleeding4,4675,5033,4681,True
142 | InternalBleeding5,6200,6370,6160,True
143 | InternalBleeding6,3474,3629,3470,True
144 | InternalBleeding8,5865,5974,5764,False
145 | InternalBleeding9,6599,6681,5719,False
146 | Lab2Cmac011215EPG1,17210,17260,17213,True
147 | Lab2Cmac011215EPG2,27862,27932,27896,True
148 | Lab2Cmac011215EPG3,16390,16420,16383,True
149 | Lab2Cmac011215EPG4,17390,17520,17457,True
150 | Lab2Cmac011215EPG5,17390,17520,17394,True
151 | Lab2Cmac011215EPG6,12190,12420,12172,True
152 | MesoplodonDensirostris,19280,19440,14956,False
153 | PowerDemand1,18485,18821,18436,True
154 | PowerDemand2,23357,23717,14086,False
155 | PowerDemand3,23405,23477,26286,False
156 | PowerDemand4,24005,24077,23973,True
157 | TkeepFifthMARS,5988,6085,5989,True
158 | TkeepFirstMARS,5365,5380,5328,True
159 | TkeepForthMARS,5988,6085,5232,False
160 | TkeepSecondMARS,9330,9340,9313,True
161 | TkeepThirdMARS,4711,4809,4721,True
162 | WalkingAceleration1,2764,2995,5712,False
163 | WalkingAceleration5,5920,5979,5931,True
164 | apneaecg2,20950,21100,10786,False
165 | apneaecg3,11111,11211,10679,False
166 | apneaecg4,16000,16100,10643,False
167 | apneaecg,12240,12308,10786,False
168 | gait1,38500,38800,54308,False
169 | gait2,46500,46800,54308,False
170 | gait3,59900,60500,54308,False
171 | gaitHunt1,33070,33180,43781,False
172 | gaitHunt2,31200,31850,43781,False
173 | gaitHunt3,38400,39200,43722,False
174 | insectEPG1,7000,7030,7000,True
175 | insectEPG2,8000,8025,8009,True
176 | insectEPG3,7000,7050,8813,False
177 | insectEPG4,6508,6558,6533,True
178 | insectEPG5,8500,8501,8508,True
179 | ltstdbs30791AI,52600,52800,52509,True
180 | ltstdbs30791AS,52600,52800,52477,False
181 | ltstdbs30791ES,52600,52800,52704,True
182 | park3m,72150,72495,76951,False
183 | qtdbSel1005V,12400,12800,12613,True
184 | qtdbSel100MLII,13400,13800,13595,True
185 | resperation10,130700,131880,130705,True
186 | resperation11,110800,110801,131188,False
187 | resperation1,110260,110412,109987,False
188 | resperation2,168250,168250,131188,False
189 | resperation2,168250,168251,131188,False
190 | resperation3,158250,158251,131188,False
191 | resperation4,128430,128431,128372,True
192 | resperation9,143411,143511,131188,False
193 | s20101mML2,35774,35874,35735,True
194 | s20101m,35774,35874,35756,True
195 | sddb49,67950,68200,67912,True
196 | sel840mECG1,51370,51740,51557,True
197 | sel840mECG2,49370,49740,49568,True
198 | tiltAPB1,114283,114350,114100,False
199 | tiltAPB2,124159,124985,124885,True
200 | tiltAPB3,114000,114370,114037,True
201 | tiltAPB4,67995,67996,67342,False
202 | CHARISfive,17001,17016,17001,True
203 | CHARISfive,10998,11028,10996,True
204 | CHARISfive,10995,11028,10978,True
205 | CHARISfive,15000,15070,14974,True
206 | CHARISfive,28995,29085,35627,False
207 | CHARISten,29080,29140,25437,False
208 | CHARISten,26929,26989,26952,True
209 | CHARISten,27929,27989,27946,True
210 | Fantasia,26970,27270,26991,True
211 | Italianpowerdemand,74900,74996,56341,False
212 | Italianpowerdemand,39240,39336,56200,False
213 | Italianpowerdemand,29480,29504,14086,False
214 | STAFFIIIDatabase,126920,127370,127008,True
215 | STAFFIIIDatabase,125720,126370,74926,False
216 | STAFFIIIDatabase,106720,107370,188079,False
217 | STAFFIIIDatabase,160720,161370,161195,True
218 | STAFFIIIDatabase,150720,151370,74927,False
219 | STAFFIIIDatabase,210720,211370,210485,False
220 | STAFFIIIDatabase,64632,64852,187921,False
221 | STAFFIIIDatabase,250720,251370,186144,False
222 | STAFFIIIDatabase,163632,164852,186438,False
223 | mit14046longtermecg,91200,91700,91637,True
224 | mit14046longtermecg,131200,131700,133152,False
225 | mit14046longtermecg,191200,191700,92908,False
226 | mit14046longtermecg,143000,143300,143130,True
227 | mit14046longtermecg,123000,123300,123078,True
228 | mit14134longtermecg,29000,29100,29107,True
229 | mit14134longtermecg,47830,47850,13775,False
230 | mit14134longtermecg,57960,57970,22107,False
231 | mit14134longtermecg,19510,19610,52038,False
232 | mit14134longtermecg,47530,47790,47562,True
233 | mit14134longtermecg,57530,57790,57538,True
234 | mit14157longtermecg,24500,24501,88207,False
235 | mit14157longtermecg,24600,24601,80411,False
236 | mit14157longtermecg,75450,75451,96831,False
237 | mit14157longtermecg,46350,46390,62870,False
238 | mit14157longtermecg,89560,90370,32700,False
239 | mit14157longtermecg,72600,72780,72523,True
240 | taichidbS0715Master,593450,593514,824863,False
241 | taichidbS0715Master,884100,884200,-1,False
242 | taichidbS0715Master,837400,839100,565089,False
243 | tilt12744mtable,104630,104890,186862,False
244 | tilt12744mtable,203355,203400,169179,False
245 | tilt12754table,104630,104890,178499,False
246 | tilt12754table,270800,271070,177117,False
247 | tilt12755mtable,270800,271070,195692,False
248 | tilt12755mtable,121900,121980,195693,False
249 | weallwalk,4702,4707,6261,False
250 | weallwalk,8285,8315,8367,True
251 | weallwalk,7290,7296,6565,False
252 |
--------------------------------------------------------------------------------
/experiments/anomaly_detection/discord/discord_Autoperiod.csv:
--------------------------------------------------------------------------------
1 | name,true_start,true_end,prediction,match
2 | DISTORTED1sddb40,52000,52620,52355,True
3 | DISTORTED2sddb40,56600,56900,56597,True
4 | DISTORTED3sddb40,46600,46900,67102,False
5 | DISTORTEDBIDMC1,5400,5600,5501,True
6 | DISTORTEDCIMIS44AirTemperature1,5391,5392,7195,False
7 | DISTORTEDCIMIS44AirTemperature2,5703,5727,7194,False
8 | DISTORTEDCIMIS44AirTemperature3,6520,6544,6508,True
9 | DISTORTEDCIMIS44AirTemperature4,5549,5597,7194,False
10 | DISTORTEDCIMIS44AirTemperature5,4852,4900,4850,True
11 | DISTORTEDCIMIS44AirTemperature6,6006,6054,6031,True
12 | DISTORTEDECG1,11800,12100,25856,False
13 | DISTORTEDECG2,16000,16100,25859,False
14 | DISTORTEDECG3,16000,16100,16021,True
15 | DISTORTEDECG3,17000,17100,16909,True
16 | DISTORTEDECG4,16800,17100,16874,True
17 | DISTORTEDECG4,16900,17100,17024,True
18 | DISTORTEDECG4,17000,17100,11203,False
19 | DISTORTEDECG4,17000,17100,17015,True
20 | DISTORTEDGP711MarkerLFM5z1,6168,6212,6141,True
21 | DISTORTEDGP711MarkerLFM5z2,7175,7388,7224,True
22 | DISTORTEDGP711MarkerLFM5z3,5948,5993,5919,True
23 | DISTORTEDGP711MarkerLFM5z4,6527,6645,6385,False
24 | DISTORTEDGP711MarkerLFM5z5,8612,8716,8648,True
25 | DISTORTEDInternalBleeding10,4526,4556,4418,False
26 | DISTORTEDInternalBleeding14,5607,5634,5521,True
27 | DISTORTEDInternalBleeding15,5684,5854,5809,True
28 | DISTORTEDInternalBleeding16,4187,4199,6632,False
29 | DISTORTEDInternalBleeding17,3198,3309,3144,True
30 | DISTORTEDInternalBleeding18,4485,4587,5278,False
31 | DISTORTEDInternalBleeding19,4187,4197,4168,True
32 | DISTORTEDInternalBleeding20,5759,5919,5807,True
33 | DISTORTEDInternalBleeding4,4675,5033,4686,True
34 | DISTORTEDInternalBleeding5,6200,6370,6162,True
35 | DISTORTEDInternalBleeding6,3474,3629,3664,True
36 | DISTORTEDInternalBleeding8,5865,5974,5733,False
37 | DISTORTEDInternalBleeding9,6599,6681,4661,False
38 | DISTORTEDLab2Cmac011215EPG1,17210,17260,17213,True
39 | DISTORTEDLab2Cmac011215EPG2,27862,27932,27897,True
40 | DISTORTEDLab2Cmac011215EPG3,16390,16420,16383,True
41 | DISTORTEDLab2Cmac011215EPG4,17390,17520,17581,True
42 | DISTORTEDLab2Cmac011215EPG5,17390,17520,17394,True
43 | DISTORTEDLab2Cmac011215EPG6,12190,12420,12389,True
44 | DISTORTEDMesoplodonDensirostris,19280,19440,-1,False
45 | DISTORTEDPowerDemand1,18485,18821,18670,True
46 | DISTORTEDPowerDemand2,23357,23717,23361,True
47 | DISTORTEDPowerDemand3,23405,23477,22997,False
48 | DISTORTEDPowerDemand4,24005,24077,24060,True
49 | DISTORTEDTkeepFifthMARS,5988,6085,5989,True
50 | DISTORTEDTkeepFirstMARS,5365,5380,4425,False
51 | DISTORTEDTkeepForthMARS,5988,6085,5228,False
52 | DISTORTEDTkeepSecondMARS,9330,9340,9323,True
53 | DISTORTEDTkeepThirdMARS,4711,4809,4721,True
54 | DISTORTEDWalkingAceleration1,2764,2995,5741,False
55 | DISTORTEDWalkingAceleration5,5920,5979,5915,True
56 | DISTORTEDapneaecg2,20950,21100,20901,True
57 | DISTORTEDapneaecg3,11111,11211,11171,True
58 | DISTORTEDapneaecg4,16000,16100,29537,False
59 | DISTORTEDapneaecg,12240,12308,12193,True
60 | DISTORTEDgait1,38500,38800,54306,False
61 | DISTORTEDgait2,46500,46800,35620,False
62 | DISTORTEDgait3,59900,60500,35665,False
63 | DISTORTEDgaitHunt1,33070,33180,43591,False
64 | DISTORTEDgaitHunt2,31200,31850,43783,False
65 | DISTORTEDgaitHunt3,38400,39200,43589,False
66 | DISTORTEDinsectEPG1,7000,7030,7001,True
67 | DISTORTEDinsectEPG2,8000,8025,8009,True
68 | DISTORTEDinsectEPG3,7000,7050,8813,False
69 | DISTORTEDinsectEPG4,6508,6558,6533,True
70 | DISTORTEDinsectEPG5,8500,8501,8512,True
71 | DISTORTEDltstdbs30791AI,52600,52800,53436,False
72 | DISTORTEDltstdbs30791AS,52600,52800,36010,False
73 | DISTORTEDltstdbs30791ES,52600,52800,52704,True
74 | DISTORTEDpark3m,72150,72495,76949,False
75 | DISTORTEDqtdbSel1005V,12400,12800,12613,True
76 | DISTORTEDqtdbSel100MLII,13400,13800,13589,True
77 | DISTORTEDresperation10,130700,131880,130721,True
78 | DISTORTEDresperation11,110800,110801,131384,False
79 | DISTORTEDresperation1,110260,110412,109958,False
80 | DISTORTEDresperation2,168250,168250,140105,False
81 | DISTORTEDresperation2,168250,168251,139951,False
82 | DISTORTEDresperation3,158250,158251,116064,False
83 | DISTORTEDresperation4,128430,128431,128382,True
84 | DISTORTEDresperation9,143411,143511,117998,False
85 | DISTORTEDs20101mML2,35774,35874,35734,True
86 | DISTORTEDs20101m,35774,35874,35756,True
87 | DISTORTEDsddb49,67950,68200,20631,False
88 | DISTORTEDsel840mECG1,51370,51740,51564,True
89 | DISTORTEDsel840mECG2,49370,49740,49567,True
90 | DISTORTEDtiltAPB1,114283,114350,114152,False
91 | DISTORTEDtiltAPB2,124159,124985,124846,True
92 | DISTORTEDtiltAPB3,114000,114370,114040,True
93 | DISTORTEDtiltAPB4,67995,67996,67365,False
94 | NOISE1sddb40,52000,52620,52353,True
95 | NOISEBIDMC1,5400,5600,5501,True
96 | NOISECIMIS44AirTemperature4,5549,5597,7194,False
97 | NOISEECG4,16900,17100,17024,True
98 | NOISEGP711MarkerLFM5z3,5948,5993,5905,True
99 | NOISEInternalBleeding16,4187,4199,4171,True
100 | NOISEInternalBleeding6,3474,3629,3474,True
101 | NOISELab2Cmac011215EPG1,17210,17260,17213,True
102 | NOISELab2Cmac011215EPG4,17390,17520,17457,True
103 | NOISEMesoplodonDensirostris,19280,19440,-1,False
104 | NOISETkeepThirdMARS,4711,4809,4720,True
105 | NOISEapneaecg4,16000,16100,27855,False
106 | NOISEgait3,59900,60500,54179,False
107 | NOISEgaitHunt2,31200,31850,43780,False
108 | NOISEinsectEPG3,7000,7050,8813,False
109 | NOISEresperation2,168250,168250,131185,False
110 | 1sddb40,52000,52620,52354,True
111 | 2sddb40,56600,56900,56635,True
112 | 3sddb40,46600,46900,67158,False
113 | BIDMC1,5400,5600,5502,True
114 | CIMIS44AirTemperature1,5391,5392,7193,False
115 | CIMIS44AirTemperature2,5703,5727,7193,False
116 | CIMIS44AirTemperature3,6520,6544,6507,True
117 | CIMIS44AirTemperature4,5549,5597,7193,False
118 | CIMIS44AirTemperature5,4852,4900,4852,True
119 | CIMIS44AirTemperature6,6006,6054,6031,True
120 | ECG1,11800,12100,11936,True
121 | ECG2,16000,16100,25858,False
122 | ECG3,16000,16100,16021,True
123 | ECG3,17000,17100,16910,True
124 | ECG4,16800,17100,16516,False
125 | ECG4,16900,17100,17024,True
126 | ECG4,17000,17100,17025,True
127 | ECG4,17000,17100,17015,True
128 | GP711MarkerLFM5z1,6168,6212,6137,True
129 | GP711MarkerLFM5z2,7175,7388,7223,True
130 | GP711MarkerLFM5z3,5948,5993,5903,True
131 | GP711MarkerLFM5z4,6527,6645,6385,False
132 | GP711MarkerLFM5z5,8612,8716,8650,True
133 | InternalBleeding10,4526,4556,4435,True
134 | InternalBleeding14,5607,5634,5509,True
135 | InternalBleeding15,5684,5854,5808,True
136 | InternalBleeding16,4187,4199,4174,True
137 | InternalBleeding17,3198,3309,3133,True
138 | InternalBleeding18,4485,4587,4410,True
139 | InternalBleeding19,4187,4197,4178,True
140 | InternalBleeding20,5759,5919,5800,True
141 | InternalBleeding4,4675,5033,4686,True
142 | InternalBleeding5,6200,6370,6162,True
143 | InternalBleeding6,3474,3629,3471,True
144 | InternalBleeding8,5865,5974,5765,True
145 | InternalBleeding9,6599,6681,6286,False
146 | Lab2Cmac011215EPG1,17210,17260,17213,True
147 | Lab2Cmac011215EPG2,27862,27932,27896,True
148 | Lab2Cmac011215EPG3,16390,16420,16383,True
149 | Lab2Cmac011215EPG4,17390,17520,17457,True
150 | Lab2Cmac011215EPG5,17390,17520,17394,True
151 | Lab2Cmac011215EPG6,12190,12420,12172,True
152 | MesoplodonDensirostris,19280,19440,-1,False
153 | PowerDemand1,18485,18821,13780,False
154 | PowerDemand2,23357,23717,23361,True
155 | PowerDemand3,23405,23477,23385,True
156 | PowerDemand4,24005,24077,24060,True
157 | TkeepFifthMARS,5988,6085,5989,True
158 | TkeepFirstMARS,5365,5380,5328,True
159 | TkeepForthMARS,5988,6085,5232,False
160 | TkeepSecondMARS,9330,9340,9313,True
161 | TkeepThirdMARS,4711,4809,4721,True
162 | WalkingAceleration1,2764,2995,4024,False
163 | WalkingAceleration5,5920,5979,5916,True
164 | apneaecg2,20950,21100,20925,True
165 | apneaecg3,11111,11211,11167,True
166 | apneaecg4,16000,16100,6595,False
167 | apneaecg,12240,12308,12193,True
168 | gait1,38500,38800,54308,False
169 | gait2,46500,46800,54308,False
170 | gait3,59900,60500,54308,False
171 | gaitHunt1,33070,33180,43691,False
172 | gaitHunt2,31200,31850,43691,False
173 | gaitHunt3,38400,39200,43724,False
174 | insectEPG1,7000,7030,7000,True
175 | insectEPG2,8000,8025,8009,True
176 | insectEPG3,7000,7050,8813,False
177 | insectEPG4,6508,6558,6533,True
178 | insectEPG5,8500,8501,8508,True
179 | ltstdbs30791AI,52600,52800,52791,True
180 | ltstdbs30791AS,52600,52800,52566,True
181 | ltstdbs30791ES,52600,52800,52705,True
182 | park3m,72150,72495,76951,False
183 | qtdbSel1005V,12400,12800,12613,True
184 | qtdbSel100MLII,13400,13800,13595,True
185 | resperation10,130700,131880,130705,True
186 | resperation11,110800,110801,131188,False
187 | resperation1,110260,110412,109987,False
188 | resperation2,168250,168250,131188,False
189 | resperation2,168250,168251,131188,False
190 | resperation3,158250,158251,131188,False
191 | resperation4,128430,128431,128372,True
192 | resperation9,143411,143511,131188,False
193 | s20101mML2,35774,35874,35735,True
194 | s20101m,35774,35874,35756,True
195 | sddb49,67950,68200,20627,False
196 | sel840mECG1,51370,51740,24365,False
197 | sel840mECG2,49370,49740,49568,True
198 | tiltAPB1,114283,114350,114100,False
199 | tiltAPB2,124159,124985,124886,True
200 | tiltAPB3,114000,114370,114037,True
201 | tiltAPB4,67995,67996,67343,False
202 | CHARISfive,17001,17016,17001,True
203 | CHARISfive,10998,11028,14574,False
204 | CHARISfive,10995,11028,10978,True
205 | CHARISfive,15000,15070,14975,True
206 | CHARISfive,28995,29085,35627,False
207 | CHARISten,29080,29140,25437,False
208 | CHARISten,26929,26989,26952,True
209 | CHARISten,27929,27989,27946,True
210 | Fantasia,26970,27270,26991,True
211 | Italianpowerdemand,74900,74996,55117,False
212 | Italianpowerdemand,39240,39336,54976,False
213 | Italianpowerdemand,29480,29504,13780,False
214 | STAFFIIIDatabase,126920,127370,205236,False
215 | STAFFIIIDatabase,125720,126370,74926,False
216 | STAFFIIIDatabase,106720,107370,188079,False
217 | STAFFIIIDatabase,160720,161370,161195,True
218 | STAFFIIIDatabase,150720,151370,74927,False
219 | STAFFIIIDatabase,210720,211370,210485,False
220 | STAFFIIIDatabase,64632,64852,187921,False
221 | STAFFIIIDatabase,250720,251370,119505,False
222 | STAFFIIIDatabase,163632,164852,186438,False
223 | mit14046longtermecg,91200,91700,91637,True
224 | mit14046longtermecg,131200,131700,133152,False
225 | mit14046longtermecg,191200,191700,92908,False
226 | mit14046longtermecg,143000,143300,143130,True
227 | mit14046longtermecg,123000,123300,145104,False
228 | mit14134longtermecg,29000,29100,29258,False
229 | mit14134longtermecg,47830,47850,36361,False
230 | mit14134longtermecg,57960,57970,22107,False
231 | mit14134longtermecg,19510,19610,39019,False
232 | mit14134longtermecg,47530,47790,19926,False
233 | mit14134longtermecg,57530,57790,19926,False
234 | mit14157longtermecg,24500,24501,88207,False
235 | mit14157longtermecg,24600,24601,80411,False
236 | mit14157longtermecg,75450,75451,96831,False
237 | mit14157longtermecg,46350,46390,62870,False
238 | mit14157longtermecg,89560,90370,32700,False
239 | mit14157longtermecg,72600,72780,72523,True
240 | taichidbS0715Master,593450,593514,554785,False
241 | taichidbS0715Master,884100,884200,557126,False
242 | taichidbS0715Master,837400,839100,564565,False
243 | tilt12744mtable,104630,104890,-1,False
244 | tilt12744mtable,203355,203400,169197,False
245 | tilt12754table,104630,104890,178499,False
246 | tilt12754table,270800,271070,177117,False
247 | tilt12755mtable,270800,271070,-1,False
248 | tilt12755mtable,121900,121980,195693,False
249 | weallwalk,4702,4707,2156,False
250 | weallwalk,8285,8315,6160,False
251 | weallwalk,7290,7296,6533,False
252 |
--------------------------------------------------------------------------------
/experiments/anomaly_detection/discord/discord_FFT.csv:
--------------------------------------------------------------------------------
1 | name,true_start,true_end,prediction,match
2 | DISTORTED1sddb40,52000,52620,52354,True
3 | DISTORTED2sddb40,56600,56900,56597,True
4 | DISTORTED3sddb40,46600,46900,56169,False
5 | DISTORTEDBIDMC1,5400,5600,5501,True
6 | DISTORTEDCIMIS44AirTemperature1,5391,5392,7195,False
7 | DISTORTEDCIMIS44AirTemperature2,5703,5727,7194,False
8 | DISTORTEDCIMIS44AirTemperature3,6520,6544,6508,True
9 | DISTORTEDCIMIS44AirTemperature4,5549,5597,7194,False
10 | DISTORTEDCIMIS44AirTemperature5,4852,4900,4850,True
11 | DISTORTEDCIMIS44AirTemperature6,6006,6054,6032,True
12 | DISTORTEDECG1,11800,12100,25856,False
13 | DISTORTEDECG2,16000,16100,25859,False
14 | DISTORTEDECG3,16000,16100,23253,False
15 | DISTORTEDECG3,17000,17100,15435,False
16 | DISTORTEDECG4,16800,17100,16530,False
17 | DISTORTEDECG4,16900,17100,6860,False
18 | DISTORTEDECG4,17000,17100,5366,False
19 | DISTORTEDECG4,17000,17100,23426,False
20 | DISTORTEDGP711MarkerLFM5z1,6168,6212,6141,True
21 | DISTORTEDGP711MarkerLFM5z2,7175,7388,7224,True
22 | DISTORTEDGP711MarkerLFM5z3,5948,5993,5919,True
23 | DISTORTEDGP711MarkerLFM5z4,6527,6645,6381,False
24 | DISTORTEDGP711MarkerLFM5z5,8612,8716,8648,True
25 | DISTORTEDInternalBleeding10,4526,4556,4416,False
26 | DISTORTEDInternalBleeding14,5607,5634,5516,True
27 | DISTORTEDInternalBleeding15,5684,5854,5809,True
28 | DISTORTEDInternalBleeding16,4187,4199,6634,False
29 | DISTORTEDInternalBleeding17,3198,3309,3144,True
30 | DISTORTEDInternalBleeding18,4485,4587,5279,False
31 | DISTORTEDInternalBleeding19,4187,4197,4167,True
32 | DISTORTEDInternalBleeding20,5759,5919,5806,True
33 | DISTORTEDInternalBleeding4,4675,5033,4688,True
34 | DISTORTEDInternalBleeding5,6200,6370,6160,True
35 | DISTORTEDInternalBleeding6,3474,3629,3662,True
36 | DISTORTEDInternalBleeding8,5865,5974,5733,False
37 | DISTORTEDInternalBleeding9,6599,6681,5280,False
38 | DISTORTEDLab2Cmac011215EPG1,17210,17260,11701,False
39 | DISTORTEDLab2Cmac011215EPG2,27862,27932,28297,False
40 | DISTORTEDLab2Cmac011215EPG3,16390,16420,16383,True
41 | DISTORTEDLab2Cmac011215EPG4,17390,17520,17581,True
42 | DISTORTEDLab2Cmac011215EPG5,17390,17520,28173,False
43 | DISTORTEDLab2Cmac011215EPG6,12190,12420,28206,False
44 | DISTORTEDMesoplodonDensirostris,19280,19440,19212,True
45 | DISTORTEDPowerDemand1,18485,18821,18671,True
46 | DISTORTEDPowerDemand2,23357,23717,23361,True
47 | DISTORTEDPowerDemand3,23405,23477,22998,False
48 | DISTORTEDPowerDemand4,24005,24077,23997,True
49 | DISTORTEDTkeepFifthMARS,5988,6085,5989,True
50 | DISTORTEDTkeepFirstMARS,5365,5380,4426,False
51 | DISTORTEDTkeepForthMARS,5988,6085,5220,False
52 | DISTORTEDTkeepSecondMARS,9330,9340,9323,True
53 | DISTORTEDTkeepThirdMARS,4711,4809,4721,True
54 | DISTORTEDWalkingAceleration1,2764,2995,5741,False
55 | DISTORTEDWalkingAceleration5,5920,5979,5915,True
56 | DISTORTEDapneaecg2,20950,21100,38222,False
57 | DISTORTEDapneaecg3,11111,11211,11158,True
58 | DISTORTEDapneaecg4,16000,16100,19159,False
59 | DISTORTEDapneaecg,12240,12308,12209,True
60 | DISTORTEDgait1,38500,38800,54306,False
61 | DISTORTEDgait2,46500,46800,35620,False
62 | DISTORTEDgait3,59900,60500,35665,False
63 | DISTORTEDgaitHunt1,33070,33180,43591,False
64 | DISTORTEDgaitHunt2,31200,31850,43677,False
65 | DISTORTEDgaitHunt3,38400,39200,43596,False
66 | DISTORTEDinsectEPG1,7000,7030,7001,True
67 | DISTORTEDinsectEPG2,8000,8025,8009,True
68 | DISTORTEDinsectEPG3,7000,7050,8813,False
69 | DISTORTEDinsectEPG4,6508,6558,6533,True
70 | DISTORTEDinsectEPG5,8500,8501,8512,True
71 | DISTORTEDltstdbs30791AI,52600,52800,53436,False
72 | DISTORTEDltstdbs30791AS,52600,52800,36011,False
73 | DISTORTEDltstdbs30791ES,52600,52800,52706,True
74 | DISTORTEDpark3m,72150,72495,76949,False
75 | DISTORTEDqtdbSel1005V,12400,12800,12607,True
76 | DISTORTEDqtdbSel100MLII,13400,13800,13589,True
77 | DISTORTEDresperation10,130700,131880,130721,True
78 | DISTORTEDresperation11,110800,110801,131383,False
79 | DISTORTEDresperation1,110260,110412,109958,False
80 | DISTORTEDresperation2,168250,168250,139953,False
81 | DISTORTEDresperation2,168250,168251,139952,False
82 | DISTORTEDresperation3,158250,158251,116066,False
83 | DISTORTEDresperation4,128430,128431,128383,True
84 | DISTORTEDresperation9,143411,143511,117999,False
85 | DISTORTEDs20101mML2,35774,35874,35734,True
86 | DISTORTEDs20101m,35774,35874,35756,True
87 | DISTORTEDsddb49,67950,68200,63247,False
88 | DISTORTEDsel840mECG1,51370,51740,24345,False
89 | DISTORTEDsel840mECG2,49370,49740,49567,True
90 | DISTORTEDtiltAPB1,114283,114350,114158,False
91 | DISTORTEDtiltAPB2,124159,124985,124843,True
92 | DISTORTEDtiltAPB3,114000,114370,114039,True
93 | DISTORTEDtiltAPB4,67995,67996,67365,False
94 | NOISE1sddb40,52000,52620,52353,True
95 | NOISEBIDMC1,5400,5600,5501,True
96 | NOISECIMIS44AirTemperature4,5549,5597,7195,False
97 | NOISEECG4,16900,17100,20111,False
98 | NOISEGP711MarkerLFM5z3,5948,5993,5905,True
99 | NOISEInternalBleeding16,4187,4199,4174,True
100 | NOISEInternalBleeding6,3474,3629,3474,True
101 | NOISELab2Cmac011215EPG1,17210,17260,17213,True
102 | NOISELab2Cmac011215EPG4,17390,17520,17457,True
103 | NOISEMesoplodonDensirostris,19280,19440,19301,True
104 | NOISETkeepThirdMARS,4711,4809,4721,True
105 | NOISEapneaecg4,16000,16100,6605,False
106 | NOISEgait3,59900,60500,54179,False
107 | NOISEgaitHunt2,31200,31850,43686,False
108 | NOISEinsectEPG3,7000,7050,8813,False
109 | NOISEresperation2,168250,168250,131187,False
110 | 1sddb40,52000,52620,52354,True
111 | 2sddb40,56600,56900,56633,True
112 | 3sddb40,46600,46900,56168,False
113 | BIDMC1,5400,5600,5502,True
114 | CIMIS44AirTemperature1,5391,5392,7194,False
115 | CIMIS44AirTemperature2,5703,5727,7194,False
116 | CIMIS44AirTemperature3,6520,6544,6508,True
117 | CIMIS44AirTemperature4,5549,5597,7194,False
118 | CIMIS44AirTemperature5,4852,4900,4853,True
119 | CIMIS44AirTemperature6,6006,6054,6032,True
120 | ECG1,11800,12100,11933,True
121 | ECG2,16000,16100,25860,False
122 | ECG3,16000,16100,23428,False
123 | ECG3,17000,17100,23428,False
124 | ECG4,16800,17100,16524,False
125 | ECG4,16900,17100,16936,True
126 | ECG4,17000,17100,16957,True
127 | ECG4,17000,17100,23428,False
128 | GP711MarkerLFM5z1,6168,6212,6137,True
129 | GP711MarkerLFM5z2,7175,7388,7223,True
130 | GP711MarkerLFM5z3,5948,5993,5903,True
131 | GP711MarkerLFM5z4,6527,6645,6382,False
132 | GP711MarkerLFM5z5,8612,8716,8650,True
133 | InternalBleeding10,4526,4556,4436,True
134 | InternalBleeding14,5607,5634,5503,False
135 | InternalBleeding15,5684,5854,5808,True
136 | InternalBleeding16,4187,4199,4174,True
137 | InternalBleeding17,3198,3309,3132,True
138 | InternalBleeding18,4485,4587,4480,True
139 | InternalBleeding19,4187,4197,4176,True
140 | InternalBleeding20,5759,5919,5799,True
141 | InternalBleeding4,4675,5033,4687,True
142 | InternalBleeding5,6200,6370,6160,True
143 | InternalBleeding6,3474,3629,3471,True
144 | InternalBleeding8,5865,5974,5765,True
145 | InternalBleeding9,6599,6681,5719,False
146 | Lab2Cmac011215EPG1,17210,17260,11701,False
147 | Lab2Cmac011215EPG2,27862,27932,11701,False
148 | Lab2Cmac011215EPG3,16390,16420,16388,True
149 | Lab2Cmac011215EPG4,17390,17520,17457,True
150 | Lab2Cmac011215EPG5,17390,17520,11645,False
151 | Lab2Cmac011215EPG6,12190,12420,11610,False
152 | MesoplodonDensirostris,19280,19440,19301,True
153 | PowerDemand1,18485,18821,13781,False
154 | PowerDemand2,23357,23717,23361,True
155 | PowerDemand3,23405,23477,23394,True
156 | PowerDemand4,24005,24077,23990,True
157 | TkeepFifthMARS,5988,6085,5990,True
158 | TkeepFirstMARS,5365,5380,5328,True
159 | TkeepForthMARS,5988,6085,5232,False
160 | TkeepSecondMARS,9330,9340,9314,True
161 | TkeepThirdMARS,4711,4809,4721,True
162 | WalkingAceleration1,2764,2995,4024,False
163 | WalkingAceleration5,5920,5979,5916,True
164 | apneaecg2,20950,21100,20930,True
165 | apneaecg3,11111,11211,11161,True
166 | apneaecg4,16000,16100,27825,False
167 | apneaecg,12240,12308,12210,True
168 | gait1,38500,38800,54308,False
169 | gait2,46500,46800,54308,False
170 | gait3,59900,60500,54308,False
171 | gaitHunt1,33070,33180,43691,False
172 | gaitHunt2,31200,31850,43691,False
173 | gaitHunt3,38400,39200,43727,False
174 | insectEPG1,7000,7030,7000,True
175 | insectEPG2,8000,8025,8009,True
176 | insectEPG3,7000,7050,8813,False
177 | insectEPG4,6508,6558,6533,True
178 | insectEPG5,8500,8501,8508,True
179 | ltstdbs30791AI,52600,52800,52788,True
180 | ltstdbs30791AS,52600,52800,52564,True
181 | ltstdbs30791ES,52600,52800,52707,True
182 | park3m,72150,72495,76950,False
183 | qtdbSel1005V,12400,12800,12607,True
184 | qtdbSel100MLII,13400,13800,13595,True
185 | resperation10,130700,131880,130705,True
186 | resperation11,110800,110801,131187,False
187 | resperation1,110260,110412,109987,False
188 | resperation2,168250,168250,131191,False
189 | resperation2,168250,168251,131191,False
190 | resperation3,158250,158251,131191,False
191 | resperation4,128430,128431,128373,True
192 | resperation9,143411,143511,131189,False
193 | s20101mML2,35774,35874,18991,False
194 | s20101m,35774,35874,35756,True
195 | sddb49,67950,68200,67956,True
196 | sel840mECG1,51370,51740,24345,False
197 | sel840mECG2,49370,49740,49568,True
198 | tiltAPB1,114283,114350,114102,False
199 | tiltAPB2,124159,124985,124882,True
200 | tiltAPB3,114000,114370,114037,True
201 | tiltAPB4,67995,67996,67342,False
202 | CHARISfive,17001,17016,17001,True
203 | CHARISfive,10998,11028,10996,True
204 | CHARISfive,10995,11028,10978,True
205 | CHARISfive,15000,15070,14975,True
206 | CHARISfive,28995,29085,13388,False
207 | CHARISten,29080,29140,25437,False
208 | CHARISten,26929,26989,26952,True
209 | CHARISten,27929,27989,27946,True
210 | Fantasia,26970,27270,26922,True
211 | Italianpowerdemand,74900,74996,55117,False
212 | Italianpowerdemand,39240,39336,54976,False
213 | Italianpowerdemand,29480,29504,13780,False
214 | STAFFIIIDatabase,126920,127370,205237,False
215 | STAFFIIIDatabase,125720,126370,94200,False
216 | STAFFIIIDatabase,106720,107370,106354,False
217 | STAFFIIIDatabase,160720,161370,160751,True
218 | STAFFIIIDatabase,150720,151370,94199,False
219 | STAFFIIIDatabase,210720,211370,205177,False
220 | STAFFIIIDatabase,64632,64852,187918,False
221 | STAFFIIIDatabase,250720,251370,119505,False
222 | STAFFIIIDatabase,163632,164852,186435,False
223 | mit14046longtermecg,91200,91700,91637,True
224 | mit14046longtermecg,131200,131700,133152,False
225 | mit14046longtermecg,191200,191700,92908,False
226 | mit14046longtermecg,143000,143300,165103,False
227 | mit14046longtermecg,123000,123300,184584,False
228 | mit14134longtermecg,29000,29100,24737,False
229 | mit14134longtermecg,47830,47850,36091,False
230 | mit14134longtermecg,57960,57970,56129,False
231 | mit14134longtermecg,19510,19610,39019,False
232 | mit14134longtermecg,47530,47790,47583,True
233 | mit14134longtermecg,57530,57790,57631,True
234 | mit14157longtermecg,24500,24501,24779,False
235 | mit14157longtermecg,24600,24601,80411,False
236 | mit14157longtermecg,75450,75451,76748,False
237 | mit14157longtermecg,46350,46390,62870,False
238 | mit14157longtermecg,89560,90370,32700,False
239 | mit14157longtermecg,72600,72780,72524,True
240 | taichidbS0715Master,593450,593514,562671,False
241 | taichidbS0715Master,884100,884200,565120,False
242 | taichidbS0715Master,837400,839100,565132,False
243 | tilt12744mtable,104630,104890,186848,False
244 | tilt12744mtable,203355,203400,169162,False
245 | tilt12754table,104630,104890,178499,False
246 | tilt12754table,270800,271070,177117,False
247 | tilt12755mtable,270800,271070,195693,False
248 | tilt12755mtable,121900,121980,195693,False
249 | weallwalk,4702,4707,6261,False
250 | weallwalk,8285,8315,4923,False
251 | weallwalk,7290,7296,6293,False
252 |
--------------------------------------------------------------------------------
/experiments/anomaly_detection/discord/discord_Human.csv:
--------------------------------------------------------------------------------
1 | name,true_start,true_end,prediction,match
2 | DISTORTED1sddb40,52000,52620,51949,True
3 | DISTORTED2sddb40,56600,56900,56597,True
4 | DISTORTED3sddb40,46600,46900,55921,False
5 | DISTORTEDBIDMC1,5400,5600,5381,True
6 | DISTORTEDCIMIS44AirTemperature1,5391,5392,5715,False
7 | DISTORTEDCIMIS44AirTemperature2,5703,5727,7194,False
8 | DISTORTEDCIMIS44AirTemperature3,6520,6544,6508,True
9 | DISTORTEDCIMIS44AirTemperature4,5549,5597,5324,False
10 | DISTORTEDCIMIS44AirTemperature5,4852,4900,4870,True
11 | DISTORTEDCIMIS44AirTemperature6,6006,6054,6013,True
12 | DISTORTEDECG1,11800,12100,11684,False
13 | DISTORTEDECG2,16000,16100,25849,False
14 | DISTORTEDECG3,16000,16100,16000,True
15 | DISTORTEDECG3,17000,17100,16971,True
16 | DISTORTEDECG4,16800,17100,117949,False
17 | DISTORTEDECG4,16900,17100,16860,True
18 | DISTORTEDECG4,17000,17100,16948,True
19 | DISTORTEDECG4,17000,17100,16920,True
20 | DISTORTEDGP711MarkerLFM5z1,6168,6212,9722,False
21 | DISTORTEDGP711MarkerLFM5z2,7175,7388,7068,False
22 | DISTORTEDGP711MarkerLFM5z3,5948,5993,10634,False
23 | DISTORTEDGP711MarkerLFM5z4,6527,6645,8385,False
24 | DISTORTEDGP711MarkerLFM5z5,8612,8716,7077,False
25 | DISTORTEDInternalBleeding10,4526,4556,4521,True
26 | DISTORTEDInternalBleeding14,5607,5634,5592,True
27 | DISTORTEDInternalBleeding15,5684,5854,5809,True
28 | DISTORTEDInternalBleeding16,4187,4199,4189,True
29 | DISTORTEDInternalBleeding17,3198,3309,3107,True
30 | DISTORTEDInternalBleeding18,4485,4587,3291,False
31 | DISTORTEDInternalBleeding19,4187,4197,4973,False
32 | DISTORTEDInternalBleeding20,5759,5919,5821,True
33 | DISTORTEDInternalBleeding4,4675,5033,4498,False
34 | DISTORTEDInternalBleeding5,6200,6370,6162,True
35 | DISTORTEDInternalBleeding6,3474,3629,3659,True
36 | DISTORTEDInternalBleeding8,5865,5974,5878,True
37 | DISTORTEDInternalBleeding9,6599,6681,5230,False
38 | DISTORTEDLab2Cmac011215EPG1,17210,17260,29875,False
39 | DISTORTEDLab2Cmac011215EPG2,27862,27932,29823,False
40 | DISTORTEDLab2Cmac011215EPG3,16390,16420,16387,True
41 | DISTORTEDLab2Cmac011215EPG4,17390,17520,17576,True
42 | DISTORTEDLab2Cmac011215EPG5,17390,17520,29640,False
43 | DISTORTEDLab2Cmac011215EPG6,12190,12420,7647,False
44 | DISTORTEDMesoplodonDensirostris,19280,19440,19257,True
45 | DISTORTEDPowerDemand1,18485,18821,18434,True
46 | DISTORTEDPowerDemand2,23357,23717,14013,False
47 | DISTORTEDPowerDemand3,23405,23477,22969,False
48 | DISTORTEDPowerDemand4,24005,24077,24006,True
49 | DISTORTEDTkeepFifthMARS,5988,6085,5989,True
50 | DISTORTEDTkeepFirstMARS,5365,5380,7132,False
51 | DISTORTEDTkeepForthMARS,5988,6085,5220,False
52 | DISTORTEDTkeepSecondMARS,9330,9340,10233,False
53 | DISTORTEDTkeepThirdMARS,4711,4809,4721,True
54 | DISTORTEDWalkingAceleration1,2764,2995,3941,False
55 | DISTORTEDWalkingAceleration5,5920,5979,5915,True
56 | DISTORTEDapneaecg2,20950,21100,20899,True
57 | DISTORTEDapneaecg3,11111,11211,11126,True
58 | DISTORTEDapneaecg4,16000,16100,16007,True
59 | DISTORTEDapneaecg,12240,12308,12231,True
60 | DISTORTEDgait1,38500,38800,54308,False
61 | DISTORTEDgait2,46500,46800,35633,False
62 | DISTORTEDgait3,59900,60500,35360,False
63 | DISTORTEDgaitHunt1,33070,33180,61176,False
64 | DISTORTEDgaitHunt2,31200,31850,22490,False
65 | DISTORTEDgaitHunt3,38400,39200,43714,False
66 | DISTORTEDinsectEPG1,7000,7030,8809,False
67 | DISTORTEDinsectEPG2,8000,8025,8010,True
68 | DISTORTEDinsectEPG3,7000,7050,8816,False
69 | DISTORTEDinsectEPG4,6508,6558,6509,True
70 | DISTORTEDinsectEPG5,8500,8501,7551,False
71 | DISTORTEDltstdbs30791AI,52600,52800,52572,True
72 | DISTORTEDltstdbs30791AS,52600,52800,52492,False
73 | DISTORTEDltstdbs30791ES,52600,52800,52716,True
74 | DISTORTEDpark3m,72150,72495,76948,False
75 | DISTORTEDqtdbSel1005V,12400,12800,4017,False
76 | DISTORTEDqtdbSel100MLII,13400,13800,5047,False
77 | DISTORTEDresperation10,130700,131880,130285,False
78 | DISTORTEDresperation11,110800,110801,192057,False
79 | DISTORTEDresperation1,110260,110412,163153,False
80 | DISTORTEDresperation2,168250,168250,-1,False
81 | DISTORTEDresperation2,168250,168251,184187,False
82 | DISTORTEDresperation3,158250,158251,141456,False
83 | DISTORTEDresperation4,128430,128431,92194,False
84 | DISTORTEDresperation9,143411,143511,96872,False
85 | DISTORTEDs20101mML2,35774,35874,35742,True
86 | DISTORTEDs20101m,35774,35874,35757,True
87 | DISTORTEDsddb49,67950,68200,21717,False
88 | DISTORTEDsel840mECG1,51370,51740,51367,True
89 | DISTORTEDsel840mECG2,49370,49740,49413,True
90 | DISTORTEDtiltAPB1,114283,114350,110699,False
91 | DISTORTEDtiltAPB2,124159,124985,124120,True
92 | DISTORTEDtiltAPB3,114000,114370,113917,True
93 | DISTORTEDtiltAPB4,67995,67996,49460,False
94 | NOISE1sddb40,52000,52620,51946,True
95 | NOISEBIDMC1,5400,5600,5361,True
96 | NOISECIMIS44AirTemperature4,5549,5597,5325,False
97 | NOISEECG4,16900,17100,16862,True
98 | NOISEGP711MarkerLFM5z3,5948,5993,9520,False
99 | NOISEInternalBleeding16,4187,4199,5139,False
100 | NOISEInternalBleeding6,3474,3629,3471,True
101 | NOISELab2Cmac011215EPG1,17210,17260,29875,False
102 | NOISELab2Cmac011215EPG4,17390,17520,17576,True
103 | NOISEMesoplodonDensirostris,19280,19440,14543,False
104 | NOISETkeepThirdMARS,4711,4809,4720,True
105 | NOISEapneaecg4,16000,16100,37038,False
106 | NOISEgait3,59900,60500,35330,False
107 | NOISEgaitHunt2,31200,31850,22496,False
108 | NOISEinsectEPG3,7000,7050,8823,False
109 | NOISEresperation2,168250,168250,-1,False
110 | 1sddb40,52000,52620,51946,True
111 | 2sddb40,56600,56900,56602,True
112 | 3sddb40,46600,46900,66579,False
113 | BIDMC1,5400,5600,5363,True
114 | CIMIS44AirTemperature1,5391,5392,7468,False
115 | CIMIS44AirTemperature2,5703,5727,7193,False
116 | CIMIS44AirTemperature3,6520,6544,6507,True
117 | CIMIS44AirTemperature4,5549,5597,7178,False
118 | CIMIS44AirTemperature5,4852,4900,4840,True
119 | CIMIS44AirTemperature6,6006,6054,6012,True
120 | ECG1,11800,12100,11684,False
121 | ECG2,16000,16100,25849,False
122 | ECG3,16000,16100,16032,True
123 | ECG3,17000,17100,16986,True
124 | ECG4,16800,17100,16565,False
125 | ECG4,16900,17100,16952,True
126 | ECG4,17000,17100,16951,True
127 | ECG4,17000,17100,17070,True
128 | GP711MarkerLFM5z1,6168,6212,11455,False
129 | GP711MarkerLFM5z2,7175,7388,7227,True
130 | GP711MarkerLFM5z3,5948,5993,11455,False
131 | GP711MarkerLFM5z4,6527,6645,6546,True
132 | GP711MarkerLFM5z5,8612,8716,11454,False
133 | InternalBleeding10,4526,4556,4521,True
134 | InternalBleeding14,5607,5634,5582,True
135 | InternalBleeding15,5684,5854,5808,True
136 | InternalBleeding16,4187,4199,4191,True
137 | InternalBleeding17,3198,3309,3284,True
138 | InternalBleeding18,4485,4587,4567,True
139 | InternalBleeding19,4187,4197,5700,False
140 | InternalBleeding20,5759,5919,5817,True
141 | InternalBleeding4,4675,5033,4485,False
142 | InternalBleeding5,6200,6370,6162,True
143 | InternalBleeding6,3474,3629,3467,True
144 | InternalBleeding8,5865,5974,5819,True
145 | InternalBleeding9,6599,6681,6598,True
146 | Lab2Cmac011215EPG1,17210,17260,29875,False
147 | Lab2Cmac011215EPG2,27862,27932,29823,False
148 | Lab2Cmac011215EPG3,16390,16420,16387,True
149 | Lab2Cmac011215EPG4,17390,17520,17575,True
150 | Lab2Cmac011215EPG5,17390,17520,17394,True
151 | Lab2Cmac011215EPG6,12190,12420,7651,False
152 | MesoplodonDensirostris,19280,19440,19306,True
153 | PowerDemand1,18485,18821,18436,True
154 | PowerDemand2,23357,23717,17313,False
155 | PowerDemand3,23405,23477,23399,True
156 | PowerDemand4,24005,24077,24006,True
157 | TkeepFifthMARS,5988,6085,5990,True
158 | TkeepFirstMARS,5365,5380,4758,False
159 | TkeepForthMARS,5988,6085,5232,False
160 | TkeepSecondMARS,9330,9340,5932,False
161 | TkeepThirdMARS,4711,4809,4721,True
162 | WalkingAceleration1,2764,2995,3940,False
163 | WalkingAceleration5,5920,5979,5916,True
164 | apneaecg2,20950,21100,20899,True
165 | apneaecg3,11111,11211,11125,True
166 | apneaecg4,16000,16100,16063,True
167 | apneaecg,12240,12308,12231,True
168 | gait1,38500,38800,54192,False
169 | gait2,46500,46800,54192,False
170 | gait3,59900,60500,35354,False
171 | gaitHunt1,33070,33180,33100,True
172 | gaitHunt2,31200,31850,22495,False
173 | gaitHunt3,38400,39200,43715,False
174 | insectEPG1,7000,7030,6993,True
175 | insectEPG2,8000,8025,8009,True
176 | insectEPG3,7000,7050,8822,False
177 | insectEPG4,6508,6558,6508,True
178 | insectEPG5,8500,8501,9318,False
179 | ltstdbs30791AI,52600,52800,52591,True
180 | ltstdbs30791AS,52600,52800,52503,True
181 | ltstdbs30791ES,52600,52800,52724,True
182 | park3m,72150,72495,76951,False
183 | qtdbSel1005V,12400,12800,12405,True
184 | qtdbSel100MLII,13400,13800,5033,False
185 | resperation10,130700,131880,130276,False
186 | resperation11,110800,110801,67609,False
187 | resperation1,110260,110412,110261,True
188 | resperation2,168250,168250,-1,False
189 | resperation2,168250,168251,32404,False
190 | resperation3,158250,158251,49770,False
191 | resperation4,128430,128431,73715,False
192 | resperation9,143411,143511,68307,False
193 | s20101mML2,35774,35874,35742,True
194 | s20101m,35774,35874,35756,True
195 | sddb49,67950,68200,67909,True
196 | sel840mECG1,51370,51740,51372,True
197 | sel840mECG2,49370,49740,49382,True
198 | tiltAPB1,114283,114350,114239,True
199 | tiltAPB2,124159,124985,124396,True
200 | tiltAPB3,114000,114370,113912,True
201 | tiltAPB4,67995,67996,103677,False
202 | CHARISfive,17001,17016,17003,True
203 | CHARISfive,10998,11028,10996,True
204 | CHARISfive,10995,11028,10978,True
205 | CHARISfive,15000,15070,14939,True
206 | CHARISfive,28995,29085,28948,True
207 | CHARISten,29080,29140,25930,False
208 | CHARISten,26929,26989,26949,True
209 | CHARISten,27929,27989,27957,True
210 | Fantasia,26970,27270,69667,False
211 | Italianpowerdemand,74900,74996,55117,False
212 | Italianpowerdemand,39240,39336,54976,False
213 | Italianpowerdemand,29480,29504,13780,False
214 | STAFFIIIDatabase,126920,127370,127258,True
215 | STAFFIIIDatabase,125720,126370,40565,False
216 | STAFFIIIDatabase,106720,107370,106862,True
217 | STAFFIIIDatabase,160720,161370,160598,False
218 | STAFFIIIDatabase,150720,151370,40559,False
219 | STAFFIIIDatabase,210720,211370,210899,True
220 | STAFFIIIDatabase,64632,64852,244877,False
221 | STAFFIIIDatabase,250720,251370,250593,False
222 | STAFFIIIDatabase,163632,164852,272376,False
223 | mit14046longtermecg,91200,91700,92188,False
224 | mit14046longtermecg,131200,131700,130998,False
225 | mit14046longtermecg,191200,191700,191091,False
226 | mit14046longtermecg,143000,143300,102720,False
227 | mit14046longtermecg,123000,123300,187798,False
228 | mit14134longtermecg,29000,29100,29260,False
229 | mit14134longtermecg,47830,47850,13663,False
230 | mit14134longtermecg,57960,57970,45131,False
231 | mit14134longtermecg,19510,19610,39561,False
232 | mit14134longtermecg,47530,47790,47541,True
233 | mit14134longtermecg,57530,57790,57538,True
234 | mit14157longtermecg,24500,24501,55256,False
235 | mit14157longtermecg,24600,24601,82787,False
236 | mit14157longtermecg,75450,75451,22780,False
237 | mit14157longtermecg,46350,46390,46349,True
238 | mit14157longtermecg,89560,90370,89961,True
239 | mit14157longtermecg,72600,72780,72563,True
240 | taichidbS0715Master,593450,593514,517505,False
241 | taichidbS0715Master,884100,884200,330399,False
242 | taichidbS0715Master,837400,839100,564258,False
243 | tilt12744mtable,104630,104890,186904,False
244 | tilt12744mtable,203355,203400,139536,False
245 | tilt12754table,104630,104890,191539,False
246 | tilt12754table,270800,271070,270721,True
247 | tilt12755mtable,270800,271070,210264,False
248 | tilt12755mtable,121900,121980,55422,False
249 | weallwalk,4702,4707,4702,True
250 | weallwalk,8285,8315,8363,True
251 | weallwalk,7290,7296,10381,False
252 |
--------------------------------------------------------------------------------
/experiments/anomaly_detection/discord/discord_MWF.csv:
--------------------------------------------------------------------------------
1 | name,true_start,true_end,prediction,match
2 | DISTORTED1sddb40,52000,52620,52354,True
3 | DISTORTED2sddb40,56600,56900,56597,True
4 | DISTORTED3sddb40,46600,46900,56169,False
5 | DISTORTEDBIDMC1,5400,5600,5501,True
6 | DISTORTEDCIMIS44AirTemperature1,5391,5392,7194,False
7 | DISTORTEDCIMIS44AirTemperature2,5703,5727,5674,True
8 | DISTORTEDCIMIS44AirTemperature3,6520,6544,6399,False
9 | DISTORTEDCIMIS44AirTemperature4,5549,5597,7434,False
10 | DISTORTEDCIMIS44AirTemperature5,4852,4900,4850,True
11 | DISTORTEDCIMIS44AirTemperature6,6006,6054,6030,True
12 | DISTORTEDECG1,11800,12100,11921,True
13 | DISTORTEDECG2,16000,16100,21425,False
14 | DISTORTEDECG3,16000,16100,16021,True
15 | DISTORTEDECG3,17000,17100,16909,True
16 | DISTORTEDECG4,16800,17100,16863,True
17 | DISTORTEDECG4,16900,17100,17024,True
18 | DISTORTEDECG4,17000,17100,17024,True
19 | DISTORTEDECG4,17000,17100,17015,True
20 | DISTORTEDGP711MarkerLFM5z1,6168,6212,6141,True
21 | DISTORTEDGP711MarkerLFM5z2,7175,7388,7223,True
22 | DISTORTEDGP711MarkerLFM5z3,5948,5993,5918,True
23 | DISTORTEDGP711MarkerLFM5z4,6527,6645,6385,False
24 | DISTORTEDGP711MarkerLFM5z5,8612,8716,8647,True
25 | DISTORTEDInternalBleeding10,4526,4556,4412,False
26 | DISTORTEDInternalBleeding14,5607,5634,5516,True
27 | DISTORTEDInternalBleeding15,5684,5854,5807,True
28 | DISTORTEDInternalBleeding16,4187,4199,6627,False
29 | DISTORTEDInternalBleeding17,3198,3309,3134,True
30 | DISTORTEDInternalBleeding18,4485,4587,5276,False
31 | DISTORTEDInternalBleeding19,4187,4197,4167,True
32 | DISTORTEDInternalBleeding20,5759,5919,5803,True
33 | DISTORTEDInternalBleeding4,4675,5033,1099,False
34 | DISTORTEDInternalBleeding5,6200,6370,6158,True
35 | DISTORTEDInternalBleeding6,3474,3629,3563,True
36 | DISTORTEDInternalBleeding8,5865,5974,5734,False
37 | DISTORTEDInternalBleeding9,6599,6681,5281,False
38 | DISTORTEDLab2Cmac011215EPG1,17210,17260,17212,True
39 | DISTORTEDLab2Cmac011215EPG2,27862,27932,27896,True
40 | DISTORTEDLab2Cmac011215EPG3,16390,16420,16382,True
41 | DISTORTEDLab2Cmac011215EPG4,17390,17520,17458,True
42 | DISTORTEDLab2Cmac011215EPG5,17390,17520,29676,False
43 | DISTORTEDLab2Cmac011215EPG6,12190,12420,12389,True
44 | DISTORTEDMesoplodonDensirostris,19280,19440,19211,True
45 | DISTORTEDPowerDemand1,18485,18821,18728,True
46 | DISTORTEDPowerDemand2,23357,23717,14202,False
47 | DISTORTEDPowerDemand3,23405,23477,22970,False
48 | DISTORTEDPowerDemand4,24005,24077,23972,True
49 | DISTORTEDTkeepFifthMARS,5988,6085,5989,True
50 | DISTORTEDTkeepFirstMARS,5365,5380,4425,False
51 | DISTORTEDTkeepForthMARS,5988,6085,5228,False
52 | DISTORTEDTkeepSecondMARS,9330,9340,9323,True
53 | DISTORTEDTkeepThirdMARS,4711,4809,4721,True
54 | DISTORTEDWalkingAceleration1,2764,2995,5740,False
55 | DISTORTEDWalkingAceleration5,5920,5979,5915,True
56 | DISTORTEDapneaecg2,20950,21100,-1,False
57 | DISTORTEDapneaecg3,11111,11211,31163,False
58 | DISTORTEDapneaecg4,16000,16100,-1,False
59 | DISTORTEDapneaecg,12240,12308,-1,False
60 | DISTORTEDgait1,38500,38800,54306,False
61 | DISTORTEDgait2,46500,46800,35620,False
62 | DISTORTEDgait3,59900,60500,35664,False
63 | DISTORTEDgaitHunt1,33070,33180,43591,False
64 | DISTORTEDgaitHunt2,31200,31850,43782,False
65 | DISTORTEDgaitHunt3,38400,39200,43592,False
66 | DISTORTEDinsectEPG1,7000,7030,7001,True
67 | DISTORTEDinsectEPG2,8000,8025,8009,True
68 | DISTORTEDinsectEPG3,7000,7050,8813,False
69 | DISTORTEDinsectEPG4,6508,6558,6533,True
70 | DISTORTEDinsectEPG5,8500,8501,8512,True
71 | DISTORTEDltstdbs30791AI,52600,52800,52508,True
72 | DISTORTEDltstdbs30791AS,52600,52800,52629,True
73 | DISTORTEDltstdbs30791ES,52600,52800,52702,True
74 | DISTORTEDpark3m,72150,72495,69284,False
75 | DISTORTEDqtdbSel1005V,12400,12800,12603,True
76 | DISTORTEDqtdbSel100MLII,13400,13800,13580,True
77 | DISTORTEDresperation10,130700,131880,130718,True
78 | DISTORTEDresperation11,110800,110801,131382,False
79 | DISTORTEDresperation1,110260,110412,109957,False
80 | DISTORTEDresperation2,168250,168250,140105,False
81 | DISTORTEDresperation2,168250,168251,139949,False
82 | DISTORTEDresperation3,158250,158251,116062,False
83 | DISTORTEDresperation4,128430,128431,128380,True
84 | DISTORTEDresperation9,143411,143511,117994,False
85 | DISTORTEDs20101mML2,35774,35874,35733,True
86 | DISTORTEDs20101m,35774,35874,35756,True
87 | DISTORTEDsddb49,67950,68200,67907,True
88 | DISTORTEDsel840mECG1,51370,51740,51560,True
89 | DISTORTEDsel840mECG2,49370,49740,49559,True
90 | DISTORTEDtiltAPB1,114283,114350,114148,False
91 | DISTORTEDtiltAPB2,124159,124985,124846,True
92 | DISTORTEDtiltAPB3,114000,114370,114040,True
93 | DISTORTEDtiltAPB4,67995,67996,67365,False
94 | NOISE1sddb40,52000,52620,52353,True
95 | NOISEBIDMC1,5400,5600,5501,True
96 | NOISECIMIS44AirTemperature4,5549,5597,7461,False
97 | NOISEECG4,16900,17100,17024,True
98 | NOISEGP711MarkerLFM5z3,5948,5993,5905,True
99 | NOISEInternalBleeding16,4187,4199,4171,True
100 | NOISEInternalBleeding6,3474,3629,3556,True
101 | NOISELab2Cmac011215EPG1,17210,17260,17213,True
102 | NOISELab2Cmac011215EPG4,17390,17520,17457,True
103 | NOISEMesoplodonDensirostris,19280,19440,19228,True
104 | NOISETkeepThirdMARS,4711,4809,4720,True
105 | NOISEapneaecg4,16000,16100,-1,False
106 | NOISEgait3,59900,60500,54180,False
107 | NOISEgaitHunt2,31200,31850,43779,False
108 | NOISEinsectEPG3,7000,7050,8813,False
109 | NOISEresperation2,168250,168250,139921,False
110 | 1sddb40,52000,52620,52354,True
111 | 2sddb40,56600,56900,56634,True
112 | 3sddb40,46600,46900,56169,False
113 | BIDMC1,5400,5600,5502,True
114 | CIMIS44AirTemperature1,5391,5392,7466,False
115 | CIMIS44AirTemperature2,5703,5727,5694,True
116 | CIMIS44AirTemperature3,6520,6544,6425,True
117 | CIMIS44AirTemperature4,5549,5597,7466,False
118 | CIMIS44AirTemperature5,4852,4900,4844,True
119 | CIMIS44AirTemperature6,6006,6054,5888,False
120 | ECG1,11800,12100,11933,True
121 | ECG2,16000,16100,25856,False
122 | ECG3,16000,16100,16021,True
123 | ECG3,17000,17100,16910,True
124 | ECG4,16800,17100,16873,True
125 | ECG4,16900,17100,17024,True
126 | ECG4,17000,17100,17025,True
127 | ECG4,17000,17100,17015,True
128 | GP711MarkerLFM5z1,6168,6212,6137,True
129 | GP711MarkerLFM5z2,7175,7388,7223,True
130 | GP711MarkerLFM5z3,5948,5993,5903,True
131 | GP711MarkerLFM5z4,6527,6645,6384,False
132 | GP711MarkerLFM5z5,8612,8716,8650,True
133 | InternalBleeding10,4526,4556,4434,True
134 | InternalBleeding14,5607,5634,5506,False
135 | InternalBleeding15,5684,5854,5807,True
136 | InternalBleeding16,4187,4199,4174,True
137 | InternalBleeding17,3198,3309,3127,True
138 | InternalBleeding18,4485,4587,4404,True
139 | InternalBleeding19,4187,4197,4176,True
140 | InternalBleeding20,5759,5919,5796,True
141 | InternalBleeding4,4675,5033,6531,False
142 | InternalBleeding5,6200,6370,6159,True
143 | InternalBleeding6,3474,3629,3556,True
144 | InternalBleeding8,5865,5974,5764,False
145 | InternalBleeding9,6599,6681,5720,False
146 | Lab2Cmac011215EPG1,17210,17260,17213,True
147 | Lab2Cmac011215EPG2,27862,27932,27896,True
148 | Lab2Cmac011215EPG3,16390,16420,16383,True
149 | Lab2Cmac011215EPG4,17390,17520,17457,True
150 | Lab2Cmac011215EPG5,17390,17520,17428,True
151 | Lab2Cmac011215EPG6,12190,12420,12173,True
152 | MesoplodonDensirostris,19280,19440,19305,True
153 | PowerDemand1,18485,18821,18437,True
154 | PowerDemand2,23357,23717,22971,False
155 | PowerDemand3,23405,23477,22971,False
156 | PowerDemand4,24005,24077,24006,True
157 | TkeepFifthMARS,5988,6085,5989,True
158 | TkeepFirstMARS,5365,5380,5328,True
159 | TkeepForthMARS,5988,6085,5232,False
160 | TkeepSecondMARS,9330,9340,9313,True
161 | TkeepThirdMARS,4711,4809,4721,True
162 | WalkingAceleration1,2764,2995,4023,False
163 | WalkingAceleration5,5920,5979,5916,True
164 | apneaecg2,20950,21100,-1,False
165 | apneaecg3,11111,11211,-1,False
166 | apneaecg4,16000,16100,-1,False
167 | apneaecg,12240,12308,-1,False
168 | gait1,38500,38800,54308,False
169 | gait2,46500,46800,54308,False
170 | gait3,59900,60500,54308,False
171 | gaitHunt1,33070,33180,43781,False
172 | gaitHunt2,31200,31850,43781,False
173 | gaitHunt3,38400,39200,43781,False
174 | insectEPG1,7000,7030,7000,True
175 | insectEPG2,8000,8025,8009,True
176 | insectEPG3,7000,7050,8813,False
177 | insectEPG4,6508,6558,6533,True
178 | insectEPG5,8500,8501,8508,True
179 | ltstdbs30791AI,52600,52800,52509,True
180 | ltstdbs30791AS,52600,52800,52474,False
181 | ltstdbs30791ES,52600,52800,52705,True
182 | park3m,72150,72495,72239,True
183 | qtdbSel1005V,12400,12800,-1,False
184 | qtdbSel100MLII,13400,13800,13612,True
185 | resperation10,130700,131880,130702,True
186 | resperation11,110800,110801,131186,False
187 | resperation1,110260,110412,109987,False
188 | resperation2,168250,168250,131181,False
189 | resperation2,168250,168251,131181,False
190 | resperation3,158250,158251,131184,False
191 | resperation4,128430,128431,128370,True
192 | resperation9,143411,143511,131184,False
193 | s20101mML2,35774,35874,35734,True
194 | s20101m,35774,35874,35756,True
195 | sddb49,67950,68200,67907,True
196 | sel840mECG1,51370,51740,51557,True
197 | sel840mECG2,49370,49740,49560,True
198 | tiltAPB1,114283,114350,114100,False
199 | tiltAPB2,124159,124985,124886,True
200 | tiltAPB3,114000,114370,114037,True
201 | tiltAPB4,67995,67996,67322,False
202 | CHARISfive,17001,17016,17001,True
203 | CHARISfive,10998,11028,10979,True
204 | CHARISfive,10995,11028,10978,True
205 | CHARISfive,15000,15070,14974,True
206 | CHARISfive,28995,29085,35624,False
207 | CHARISten,29080,29140,25437,False
208 | CHARISten,26929,26989,26952,True
209 | CHARISten,27929,27989,27946,True
210 | Fantasia,26970,27270,69669,False
211 | Italianpowerdemand,74900,74996,91991,False
212 | Italianpowerdemand,39240,39336,91744,False
213 | Italianpowerdemand,29480,29504,14177,False
214 | STAFFIIIDatabase,126920,127370,127008,True
215 | STAFFIIIDatabase,125720,126370,40475,False
216 | STAFFIIIDatabase,106720,107370,188071,False
217 | STAFFIIIDatabase,160720,161370,161196,True
218 | STAFFIIIDatabase,150720,151370,40474,False
219 | STAFFIIIDatabase,210720,211370,210486,False
220 | STAFFIIIDatabase,64632,64852,274221,False
221 | STAFFIIIDatabase,250720,251370,-1,False
222 | STAFFIIIDatabase,163632,164852,186430,False
223 | mit14046longtermecg,91200,91700,91637,True
224 | mit14046longtermecg,131200,131700,133152,False
225 | mit14046longtermecg,191200,191700,92908,False
226 | mit14046longtermecg,143000,143300,143130,True
227 | mit14046longtermecg,123000,123300,123079,True
228 | mit14134longtermecg,29000,29100,29106,True
229 | mit14134longtermecg,47830,47850,-1,False
230 | mit14134longtermecg,57960,57970,-1,False
231 | mit14134longtermecg,19510,19610,-1,False
232 | mit14134longtermecg,47530,47790,-1,False
233 | mit14134longtermecg,57530,57790,-1,False
234 | mit14157longtermecg,24500,24501,88207,False
235 | mit14157longtermecg,24600,24601,80411,False
236 | mit14157longtermecg,75450,75451,96831,False
237 | mit14157longtermecg,46350,46390,62870,False
238 | mit14157longtermecg,89560,90370,32699,False
239 | mit14157longtermecg,72600,72780,72522,True
240 | taichidbS0715Master,593450,593514,-1,False
241 | taichidbS0715Master,884100,884200,-1,False
242 | taichidbS0715Master,837400,839100,-1,False
243 | tilt12744mtable,104630,104890,186858,False
244 | tilt12744mtable,203355,203400,169173,False
245 | tilt12754table,104630,104890,178499,False
246 | tilt12754table,270800,271070,177117,False
247 | tilt12755mtable,270800,271070,195691,False
248 | tilt12755mtable,121900,121980,195693,False
249 | weallwalk,4702,4707,6260,False
250 | weallwalk,8285,8315,6077,False
251 | weallwalk,7290,7296,4221,False
252 |
--------------------------------------------------------------------------------
/experiments/anomaly_detection/discord/discord_RobustPeriod.csv:
--------------------------------------------------------------------------------
1 | name,true_start,true_end,prediction,match
2 | DISTORTED1sddb40,52000,52620,52355,True
3 | DISTORTED2sddb40,56600,56900,56597,True
4 | DISTORTED3sddb40,46600,46900,46802,True
5 | DISTORTEDBIDMC1,5400,5600,2877,False
6 | DISTORTEDCIMIS44AirTemperature1,5391,5392,6452,False
7 | DISTORTEDCIMIS44AirTemperature2,5703,5727,5324,False
8 | DISTORTEDCIMIS44AirTemperature3,6520,6544,6513,True
9 | DISTORTEDCIMIS44AirTemperature4,5549,5597,5564,True
10 | DISTORTEDCIMIS44AirTemperature5,4852,4900,6931,False
11 | DISTORTEDCIMIS44AirTemperature6,6006,6054,6004,True
12 | DISTORTEDECG1,11800,12100,11535,False
13 | DISTORTEDECG2,16000,16100,26436,False
14 | DISTORTEDECG3,16000,16100,28056,False
15 | DISTORTEDECG3,17000,17100,15470,False
16 | DISTORTEDECG4,16800,17100,176906,False
17 | DISTORTEDECG4,16900,17100,24259,False
18 | DISTORTEDECG4,17000,17100,27385,False
19 | DISTORTEDECG4,17000,17100,24570,False
20 | DISTORTEDGP711MarkerLFM5z1,6168,6212,9722,False
21 | DISTORTEDGP711MarkerLFM5z2,7175,7388,5591,False
22 | DISTORTEDGP711MarkerLFM5z3,5948,5993,11090,False
23 | DISTORTEDGP711MarkerLFM5z4,6527,6645,10631,False
24 | DISTORTEDGP711MarkerLFM5z5,8612,8716,10150,False
25 | DISTORTEDInternalBleeding10,4526,4556,3523,False
26 | DISTORTEDInternalBleeding14,5607,5634,3986,False
27 | DISTORTEDInternalBleeding15,5684,5854,5828,True
28 | DISTORTEDInternalBleeding16,4187,4199,4613,False
29 | DISTORTEDInternalBleeding17,3198,3309,7359,False
30 | DISTORTEDInternalBleeding18,4485,4587,6802,False
31 | DISTORTEDInternalBleeding19,4187,4197,5507,False
32 | DISTORTEDInternalBleeding20,5759,5919,6805,False
33 | DISTORTEDInternalBleeding4,4675,5033,-1,False
34 | DISTORTEDInternalBleeding5,6200,6370,5939,False
35 | DISTORTEDInternalBleeding6,3474,3629,3721,True
36 | DISTORTEDInternalBleeding8,5865,5974,4949,False
37 | DISTORTEDInternalBleeding9,6599,6681,5448,False
38 | DISTORTEDLab2Cmac011215EPG1,17210,17260,17213,True
39 | DISTORTEDLab2Cmac011215EPG2,27862,27932,28297,False
40 | DISTORTEDLab2Cmac011215EPG3,16390,16420,16383,True
41 | DISTORTEDLab2Cmac011215EPG4,17390,17520,17458,True
42 | DISTORTEDLab2Cmac011215EPG5,17390,17520,17394,True
43 | DISTORTEDLab2Cmac011215EPG6,12190,12420,20600,False
44 | DISTORTEDMesoplodonDensirostris,19280,19440,19189,True
45 | DISTORTEDPowerDemand1,18485,18821,24106,False
46 | DISTORTEDPowerDemand2,23357,23717,23487,True
47 | DISTORTEDPowerDemand3,23405,23477,28528,False
48 | DISTORTEDPowerDemand4,24005,24077,24105,True
49 | DISTORTEDTkeepFifthMARS,5988,6085,7545,False
50 | DISTORTEDTkeepFirstMARS,5365,5380,6996,False
51 | DISTORTEDTkeepForthMARS,5988,6085,8983,False
52 | DISTORTEDTkeepSecondMARS,9330,9340,8579,False
53 | DISTORTEDTkeepThirdMARS,4711,4809,8785,False
54 | DISTORTEDWalkingAceleration1,2764,2995,3723,False
55 | DISTORTEDWalkingAceleration5,5920,5979,5915,True
56 | DISTORTEDapneaecg2,20950,21100,19772,False
57 | DISTORTEDapneaecg3,11111,11211,11158,True
58 | DISTORTEDapneaecg4,16000,16100,19160,False
59 | DISTORTEDapneaecg,12240,12308,12200,True
60 | DISTORTEDgait1,38500,38800,59849,False
61 | DISTORTEDgait2,46500,46800,58874,False
62 | DISTORTEDgait3,59900,60500,56687,False
63 | DISTORTEDgaitHunt1,33070,33180,36915,False
64 | DISTORTEDgaitHunt2,31200,31850,27850,False
65 | DISTORTEDgaitHunt3,38400,39200,41475,False
66 | DISTORTEDinsectEPG1,7000,7030,8793,False
67 | DISTORTEDinsectEPG2,8000,8025,7979,True
68 | DISTORTEDinsectEPG3,7000,7050,-1,False
69 | DISTORTEDinsectEPG4,6508,6558,6095,False
70 | DISTORTEDinsectEPG5,8500,8501,8463,True
71 | DISTORTEDltstdbs30791AI,52600,52800,53465,False
72 | DISTORTEDltstdbs30791AS,52600,52800,36010,False
73 | DISTORTEDltstdbs30791ES,52600,52800,52761,True
74 | DISTORTEDpark3m,72150,72495,87070,False
75 | DISTORTEDqtdbSel1005V,12400,12800,24761,False
76 | DISTORTEDqtdbSel100MLII,13400,13800,29157,False
77 | DISTORTEDresperation10,130700,131880,106242,False
78 | DISTORTEDresperation11,110800,110801,59301,False
79 | DISTORTEDresperation1,110260,110412,113775,False
80 | DISTORTEDresperation2,168250,168250,106720,False
81 | DISTORTEDresperation2,168250,168251,103505,False
82 | DISTORTEDresperation3,158250,158251,105795,False
83 | DISTORTEDresperation4,128430,128431,128468,True
84 | DISTORTEDresperation9,143411,143511,105789,False
85 | DISTORTEDs20101mML2,35774,35874,35733,True
86 | DISTORTEDs20101m,35774,35874,35756,True
87 | DISTORTEDsddb49,67950,68200,-1,False
88 | DISTORTEDsel840mECG1,51370,51740,43286,False
89 | DISTORTEDsel840mECG2,49370,49740,56875,False
90 | DISTORTEDtiltAPB1,114283,114350,110701,False
91 | DISTORTEDtiltAPB2,124159,124985,55957,False
92 | DISTORTEDtiltAPB3,114000,114370,92591,False
93 | DISTORTEDtiltAPB4,67995,67996,56917,False
94 | NOISE1sddb40,52000,52620,76199,False
95 | NOISEBIDMC1,5400,5600,7044,False
96 | NOISECIMIS44AirTemperature4,5549,5597,5568,True
97 | NOISEECG4,16900,17100,26238,False
98 | NOISEGP711MarkerLFM5z3,5948,5993,10599,False
99 | NOISEInternalBleeding16,4187,4199,2209,False
100 | NOISEInternalBleeding6,3474,3629,3625,True
101 | NOISELab2Cmac011215EPG1,17210,17260,17213,True
102 | NOISELab2Cmac011215EPG4,17390,17520,29261,False
103 | NOISEMesoplodonDensirostris,19280,19440,-1,False
104 | NOISETkeepThirdMARS,4711,4809,10357,False
105 | NOISEapneaecg4,16000,16100,37038,False
106 | NOISEgait3,59900,60500,45434,False
107 | NOISEgaitHunt2,31200,31850,43911,False
108 | NOISEinsectEPG3,7000,7050,5388,False
109 | NOISEresperation2,168250,168250,68229,False
110 | 1sddb40,52000,52620,52354,True
111 | 2sddb40,56600,56900,56637,True
112 | 3sddb40,46600,46900,67158,False
113 | BIDMC1,5400,5600,8944,False
114 | CIMIS44AirTemperature1,5391,5392,5384,True
115 | CIMIS44AirTemperature2,5703,5727,4496,False
116 | CIMIS44AirTemperature3,6520,6544,6514,True
117 | CIMIS44AirTemperature4,5549,5597,5564,True
118 | CIMIS44AirTemperature5,4852,4900,4889,True
119 | CIMIS44AirTemperature6,6006,6054,6004,True
120 | ECG1,11800,12100,23811,False
121 | ECG2,16000,16100,23811,False
122 | ECG3,16000,16100,15950,True
123 | ECG3,17000,17100,14316,False
124 | ECG4,16800,17100,95781,False
125 | ECG4,16900,17100,14316,False
126 | ECG4,17000,17100,16967,True
127 | ECG4,17000,17100,14316,False
128 | GP711MarkerLFM5z1,6168,6212,8428,False
129 | GP711MarkerLFM5z2,7175,7388,7172,True
130 | GP711MarkerLFM5z3,5948,5993,5991,True
131 | GP711MarkerLFM5z4,6527,6645,6640,True
132 | GP711MarkerLFM5z5,8612,8716,8428,False
133 | InternalBleeding10,4526,4556,4516,True
134 | InternalBleeding14,5607,5634,5595,True
135 | InternalBleeding15,5684,5854,5712,True
136 | InternalBleeding16,4187,4199,4189,True
137 | InternalBleeding17,3198,3309,3173,True
138 | InternalBleeding18,4485,4587,4584,True
139 | InternalBleeding19,4187,4197,4177,True
140 | InternalBleeding20,5759,5919,5829,True
141 | InternalBleeding4,4675,5033,-1,False
142 | InternalBleeding5,6200,6370,6197,True
143 | InternalBleeding6,3474,3629,7210,False
144 | InternalBleeding8,5865,5974,3866,False
145 | InternalBleeding9,6599,6681,6598,True
146 | Lab2Cmac011215EPG1,17210,17260,11701,False
147 | Lab2Cmac011215EPG2,27862,27932,11701,False
148 | Lab2Cmac011215EPG3,16390,16420,16388,True
149 | Lab2Cmac011215EPG4,17390,17520,11685,False
150 | Lab2Cmac011215EPG5,17390,17520,17394,True
151 | Lab2Cmac011215EPG6,12190,12420,12172,True
152 | MesoplodonDensirostris,19280,19440,19193,True
153 | PowerDemand1,18485,18821,24105,False
154 | PowerDemand2,23357,23717,23372,True
155 | PowerDemand3,23405,23477,24105,False
156 | PowerDemand4,24005,24077,24105,True
157 | TkeepFifthMARS,5988,6085,4756,False
158 | TkeepFirstMARS,5365,5380,4756,False
159 | TkeepForthMARS,5988,6085,4756,False
160 | TkeepSecondMARS,9330,9340,4756,False
161 | TkeepThirdMARS,4711,4809,9968,False
162 | WalkingAceleration1,2764,2995,3735,False
163 | WalkingAceleration5,5920,5979,5916,True
164 | apneaecg2,20950,21100,20927,True
165 | apneaecg3,11111,11211,11161,True
166 | apneaecg4,16000,16100,27825,False
167 | apneaecg,12240,12308,12200,True
168 | gait1,38500,38800,41405,False
169 | gait2,46500,46800,41405,False
170 | gait3,59900,60500,41405,False
171 | gaitHunt1,33070,33180,33106,True
172 | gaitHunt2,31200,31850,31454,True
173 | gaitHunt3,38400,39200,39016,True
174 | insectEPG1,7000,7030,8752,False
175 | insectEPG2,8000,8025,7921,True
176 | insectEPG3,7000,7050,8813,False
177 | insectEPG4,6508,6558,6095,False
178 | insectEPG5,8500,8501,8496,True
179 | ltstdbs30791AI,52600,52800,52509,True
180 | ltstdbs30791AS,52600,52800,41755,False
181 | ltstdbs30791ES,52600,52800,52590,True
182 | park3m,72150,72495,72468,True
183 | qtdbSel1005V,12400,12800,12606,True
184 | qtdbSel100MLII,13400,13800,14349,False
185 | resperation10,130700,131880,134623,False
186 | resperation11,110800,110801,134609,False
187 | resperation1,110260,110412,134601,False
188 | resperation2,168250,168250,49772,False
189 | resperation2,168250,168251,134604,False
190 | resperation3,158250,158251,134612,False
191 | resperation4,128430,128431,82956,False
192 | resperation9,143411,143511,95790,False
193 | s20101mML2,35774,35874,35788,True
194 | s20101m,35774,35874,35756,True
195 | sddb49,67950,68200,-1,False
196 | sel840mECG1,51370,51740,24389,False
197 | sel840mECG2,49370,49740,56813,False
198 | tiltAPB1,114283,114350,114228,True
199 | tiltAPB2,124159,124985,124969,True
200 | tiltAPB3,114000,114370,113929,True
201 | tiltAPB4,67995,67996,67992,True
202 | CHARISfive,17001,17016,17003,True
203 | CHARISfive,10998,11028,16685,False
204 | CHARISfive,10995,11028,10978,True
205 | CHARISfive,15000,15070,14989,True
206 | CHARISfive,28995,29085,14765,False
207 | CHARISten,29080,29140,25437,False
208 | CHARISten,26929,26989,37278,False
209 | CHARISten,27929,27989,27946,True
210 | Fantasia,26970,27270,26994,True
211 | Italianpowerdemand,74900,74996,53267,False
212 | Italianpowerdemand,39240,39336,92671,False
213 | Italianpowerdemand,29480,29504,24105,False
214 | STAFFIIIDatabase,126920,127370,92434,False
215 | STAFFIIIDatabase,125720,126370,106122,False
216 | STAFFIIIDatabase,106720,107370,104903,False
217 | STAFFIIIDatabase,160720,161370,112224,False
218 | STAFFIIIDatabase,150720,151370,106122,False
219 | STAFFIIIDatabase,210720,211370,92374,False
220 | STAFFIIIDatabase,64632,64852,92274,False
221 | STAFFIIIDatabase,250720,251370,269899,False
222 | STAFFIIIDatabase,163632,164852,273726,False
223 | mit14046longtermecg,91200,91700,90875,False
224 | mit14046longtermecg,131200,131700,78062,False
225 | mit14046longtermecg,191200,191700,80878,False
226 | mit14046longtermecg,143000,143300,103123,False
227 | mit14046longtermecg,123000,123300,123156,True
228 | mit14134longtermecg,29000,29100,29259,False
229 | mit14134longtermecg,47830,47850,19423,False
230 | mit14134longtermecg,57960,57970,22107,False
231 | mit14134longtermecg,19510,19610,41528,False
232 | mit14134longtermecg,47530,47790,47582,True
233 | mit14134longtermecg,57530,57790,57631,True
234 | mit14157longtermecg,24500,24501,24779,False
235 | mit14157longtermecg,24600,24601,81562,False
236 | mit14157longtermecg,75450,75451,21253,False
237 | mit14157longtermecg,46350,46390,-1,False
238 | mit14157longtermecg,89560,90370,48856,False
239 | mit14157longtermecg,72600,72780,73732,False
240 | taichidbS0715Master,593450,593514,449118,False
241 | taichidbS0715Master,884100,884200,425156,False
242 | taichidbS0715Master,837400,839100,656359,False
243 | tilt12744mtable,104630,104890,186937,False
244 | tilt12744mtable,203355,203400,169244,False
245 | tilt12754table,104630,104890,296910,False
246 | tilt12754table,270800,271070,295380,False
247 | tilt12755mtable,270800,271070,195702,False
248 | tilt12755mtable,121900,121980,55395,False
249 | weallwalk,4702,4707,6261,False
250 | weallwalk,8285,8315,4557,False
251 | weallwalk,7290,7296,6837,False
252 |
--------------------------------------------------------------------------------
/experiments/anomaly_detection/discord/discord_SuSS.csv:
--------------------------------------------------------------------------------
1 | name,true_start,true_end,prediction,match
2 | DISTORTED1sddb40,52000,52620,75502,False
3 | DISTORTED2sddb40,56600,56900,56597,True
4 | DISTORTED3sddb40,46600,46900,46799,True
5 | DISTORTEDBIDMC1,5400,5600,5472,True
6 | DISTORTEDCIMIS44AirTemperature1,5391,5392,7172,False
7 | DISTORTEDCIMIS44AirTemperature2,5703,5727,5681,True
8 | DISTORTEDCIMIS44AirTemperature3,6520,6544,6501,True
9 | DISTORTEDCIMIS44AirTemperature4,5549,5597,7171,False
10 | DISTORTEDCIMIS44AirTemperature5,4852,4900,4859,True
11 | DISTORTEDCIMIS44AirTemperature6,6006,6054,6010,True
12 | DISTORTEDECG1,11800,12100,25862,False
13 | DISTORTEDECG2,16000,16100,26432,False
14 | DISTORTEDECG3,16000,16100,23254,False
15 | DISTORTEDECG3,17000,17100,15436,False
16 | DISTORTEDECG4,16800,17100,17099,True
17 | DISTORTEDECG4,16900,17100,6861,False
18 | DISTORTEDECG4,17000,17100,5366,False
19 | DISTORTEDECG4,17000,17100,24395,False
20 | DISTORTEDGP711MarkerLFM5z1,6168,6212,6867,False
21 | DISTORTEDGP711MarkerLFM5z2,7175,7388,8861,False
22 | DISTORTEDGP711MarkerLFM5z3,5948,5993,11021,False
23 | DISTORTEDGP711MarkerLFM5z4,6527,6645,10603,False
24 | DISTORTEDGP711MarkerLFM5z5,8612,8716,8400,False
25 | DISTORTEDInternalBleeding10,4526,4556,4493,True
26 | DISTORTEDInternalBleeding14,5607,5634,5567,True
27 | DISTORTEDInternalBleeding15,5684,5854,5796,True
28 | DISTORTEDInternalBleeding16,4187,4199,3308,False
29 | DISTORTEDInternalBleeding17,3198,3309,2567,False
30 | DISTORTEDInternalBleeding18,4485,4587,5682,False
31 | DISTORTEDInternalBleeding19,4187,4197,6965,False
32 | DISTORTEDInternalBleeding20,5759,5919,6767,False
33 | DISTORTEDInternalBleeding4,4675,5033,4400,False
34 | DISTORTEDInternalBleeding5,6200,6370,6189,True
35 | DISTORTEDInternalBleeding6,3474,3629,3698,True
36 | DISTORTEDInternalBleeding8,5865,5974,3103,False
37 | DISTORTEDInternalBleeding9,6599,6681,5234,False
38 | DISTORTEDLab2Cmac011215EPG1,17210,17260,29882,False
39 | DISTORTEDLab2Cmac011215EPG2,27862,27932,27890,True
40 | DISTORTEDLab2Cmac011215EPG3,16390,16420,16377,True
41 | DISTORTEDLab2Cmac011215EPG4,17390,17520,17581,True
42 | DISTORTEDLab2Cmac011215EPG5,17390,17520,17392,True
43 | DISTORTEDLab2Cmac011215EPG6,12190,12420,12386,True
44 | DISTORTEDMesoplodonDensirostris,19280,19440,14894,False
45 | DISTORTEDPowerDemand1,18485,18821,18637,True
46 | DISTORTEDPowerDemand2,23357,23717,22969,False
47 | DISTORTEDPowerDemand3,23405,23477,22976,False
48 | DISTORTEDPowerDemand4,24005,24077,24040,True
49 | DISTORTEDTkeepFifthMARS,5988,6085,6713,False
50 | DISTORTEDTkeepFirstMARS,5365,5380,6595,False
51 | DISTORTEDTkeepForthMARS,5988,6085,9840,False
52 | DISTORTEDTkeepSecondMARS,9330,9340,4434,False
53 | DISTORTEDTkeepThirdMARS,4711,4809,9744,False
54 | DISTORTEDWalkingAceleration1,2764,2995,5742,False
55 | DISTORTEDWalkingAceleration5,5920,5979,5915,True
56 | DISTORTEDapneaecg2,20950,21100,20927,True
57 | DISTORTEDapneaecg3,11111,11211,11126,True
58 | DISTORTEDapneaecg4,16000,16100,16008,True
59 | DISTORTEDapneaecg,12240,12308,12201,True
60 | DISTORTEDgait1,38500,38800,59849,False
61 | DISTORTEDgait2,46500,46800,40002,False
62 | DISTORTEDgait3,59900,60500,56699,False
63 | DISTORTEDgaitHunt1,33070,33180,57873,False
64 | DISTORTEDgaitHunt2,31200,31850,62467,False
65 | DISTORTEDgaitHunt3,38400,39200,38728,True
66 | DISTORTEDinsectEPG1,7000,7030,8811,False
67 | DISTORTEDinsectEPG2,8000,8025,8008,True
68 | DISTORTEDinsectEPG3,7000,7050,8811,False
69 | DISTORTEDinsectEPG4,6508,6558,6531,True
70 | DISTORTEDinsectEPG5,8500,8501,8510,True
71 | DISTORTEDltstdbs30791AI,52600,52800,53441,False
72 | DISTORTEDltstdbs30791AS,52600,52800,37961,False
73 | DISTORTEDltstdbs30791ES,52600,52800,24031,False
74 | DISTORTEDpark3m,72150,72495,76625,False
75 | DISTORTEDqtdbSel1005V,12400,12800,22931,False
76 | DISTORTEDqtdbSel100MLII,13400,13800,13661,True
77 | DISTORTEDresperation10,130700,131880,93611,False
78 | DISTORTEDresperation11,110800,110801,184413,False
79 | DISTORTEDresperation1,110260,110412,182802,False
80 | DISTORTEDresperation2,168250,168250,125630,False
81 | DISTORTEDresperation2,168250,168251,164442,False
82 | DISTORTEDresperation3,158250,158251,88521,False
83 | DISTORTEDresperation4,128430,128431,115285,False
84 | DISTORTEDresperation9,143411,143511,96872,False
85 | DISTORTEDs20101mML2,35774,35874,35769,True
86 | DISTORTEDs20101m,35774,35874,35786,True
87 | DISTORTEDsddb49,67950,68200,72818,False
88 | DISTORTEDsel840mECG1,51370,51740,24344,False
89 | DISTORTEDsel840mECG2,49370,49740,44508,False
90 | DISTORTEDtiltAPB1,114283,114350,114231,True
91 | DISTORTEDtiltAPB2,124159,124985,55942,False
92 | DISTORTEDtiltAPB3,114000,114370,63293,False
93 | DISTORTEDtiltAPB4,67995,67996,85030,False
94 | NOISE1sddb40,52000,52620,76198,False
95 | NOISEBIDMC1,5400,5600,5522,True
96 | NOISECIMIS44AirTemperature4,5549,5597,7556,False
97 | NOISEECG4,16900,17100,20117,False
98 | NOISEGP711MarkerLFM5z3,5948,5993,11464,False
99 | NOISEInternalBleeding16,4187,4199,6789,False
100 | NOISEInternalBleeding6,3474,3629,3701,True
101 | NOISELab2Cmac011215EPG1,17210,17260,17207,True
102 | NOISELab2Cmac011215EPG4,17390,17520,17583,True
103 | NOISEMesoplodonDensirostris,19280,19440,14567,False
104 | NOISETkeepThirdMARS,4711,4809,5414,False
105 | NOISEapneaecg4,16000,16100,6583,False
106 | NOISEgait3,59900,60500,45783,False
107 | NOISEgaitHunt2,31200,31850,43911,False
108 | NOISEinsectEPG3,7000,7050,8813,False
109 | NOISEresperation2,168250,168250,68276,False
110 | 1sddb40,52000,52620,76194,False
111 | 2sddb40,56600,56900,56721,True
112 | 3sddb40,46600,46900,46649,True
113 | BIDMC1,5400,5600,5524,True
114 | CIMIS44AirTemperature1,5391,5392,5327,True
115 | CIMIS44AirTemperature2,5703,5727,5682,True
116 | CIMIS44AirTemperature3,6520,6544,6499,True
117 | CIMIS44AirTemperature4,5549,5597,5327,False
118 | CIMIS44AirTemperature5,4852,4900,4830,True
119 | CIMIS44AirTemperature6,6006,6054,6009,True
120 | ECG1,11800,12100,13509,False
121 | ECG2,16000,16100,25867,False
122 | ECG3,16000,16100,23427,False
123 | ECG3,17000,17100,23429,False
124 | ECG4,16800,17100,17099,True
125 | ECG4,16900,17100,16937,True
126 | ECG4,17000,17100,6207,False
127 | ECG4,17000,17100,23429,False
128 | GP711MarkerLFM5z1,6168,6212,10828,False
129 | GP711MarkerLFM5z2,7175,7388,10828,False
130 | GP711MarkerLFM5z3,5948,5993,10828,False
131 | GP711MarkerLFM5z4,6527,6645,10830,False
132 | GP711MarkerLFM5z5,8612,8716,10830,False
133 | InternalBleeding10,4526,4556,4477,True
134 | InternalBleeding14,5607,5634,5571,True
135 | InternalBleeding15,5684,5854,5806,True
136 | InternalBleeding16,4187,4199,4189,True
137 | InternalBleeding17,3198,3309,3292,True
138 | InternalBleeding18,4485,4587,4574,True
139 | InternalBleeding19,4187,4197,4183,True
140 | InternalBleeding20,5759,5919,5799,True
141 | InternalBleeding4,4675,5033,4721,True
142 | InternalBleeding5,6200,6370,6184,True
143 | InternalBleeding6,3474,3629,3502,True
144 | InternalBleeding8,5865,5974,5831,True
145 | InternalBleeding9,6599,6681,6598,True
146 | Lab2Cmac011215EPG1,17210,17260,17209,True
147 | Lab2Cmac011215EPG2,27862,27932,27893,True
148 | Lab2Cmac011215EPG3,16390,16420,16379,True
149 | Lab2Cmac011215EPG4,17390,17520,17583,True
150 | Lab2Cmac011215EPG5,17390,17520,17392,True
151 | Lab2Cmac011215EPG6,12190,12420,12386,True
152 | MesoplodonDensirostris,19280,19440,14904,False
153 | PowerDemand1,18485,18821,18470,True
154 | PowerDemand2,23357,23717,22970,False
155 | PowerDemand3,23405,23477,22969,False
156 | PowerDemand4,24005,24077,24042,True
157 | TkeepFifthMARS,5988,6085,6027,True
158 | TkeepFirstMARS,5365,5380,5321,True
159 | TkeepForthMARS,5988,6085,6002,True
160 | TkeepSecondMARS,9330,9340,9334,True
161 | TkeepThirdMARS,4711,4809,4727,True
162 | WalkingAceleration1,2764,2995,4025,False
163 | WalkingAceleration5,5920,5979,5916,True
164 | apneaecg2,20950,21100,20928,True
165 | apneaecg3,11111,11211,11125,True
166 | apneaecg4,16000,16100,16065,True
167 | apneaecg,12240,12308,12202,True
168 | gait1,38500,38800,59558,False
169 | gait2,46500,46800,59558,False
170 | gait3,59900,60500,60199,True
171 | gaitHunt1,33070,33180,33103,True
172 | gaitHunt2,31200,31850,31443,True
173 | gaitHunt3,38400,39200,38725,True
174 | insectEPG1,7000,7030,7000,True
175 | insectEPG2,8000,8025,8009,True
176 | insectEPG3,7000,7050,8813,False
177 | insectEPG4,6508,6558,6533,True
178 | insectEPG5,8500,8501,8508,True
179 | ltstdbs30791AI,52600,52800,53443,False
180 | ltstdbs30791AS,52600,52800,34311,False
181 | ltstdbs30791ES,52600,52800,52763,True
182 | park3m,72150,72495,72468,True
183 | qtdbSel1005V,12400,12800,12666,True
184 | qtdbSel100MLII,13400,13800,13660,True
185 | resperation10,130700,131880,68305,False
186 | resperation11,110800,110801,68305,False
187 | resperation1,110260,110412,110299,True
188 | resperation2,168250,168250,68305,False
189 | resperation2,168250,168251,68305,False
190 | resperation3,158250,158251,68305,False
191 | resperation4,128430,128431,128568,False
192 | resperation9,143411,143511,68305,False
193 | s20101mML2,35774,35874,35770,True
194 | s20101m,35774,35874,35787,True
195 | sddb49,67950,68200,37018,False
196 | sel840mECG1,51370,51740,24343,False
197 | sel840mECG2,49370,49740,55769,False
198 | tiltAPB1,114283,114350,114232,True
199 | tiltAPB2,124159,124985,124079,True
200 | tiltAPB3,114000,114370,113947,True
201 | tiltAPB4,67995,67996,67994,True
202 | CHARISfive,17001,17016,17000,True
203 | CHARISfive,10998,11028,10974,True
204 | CHARISfive,10995,11028,10997,True
205 | CHARISfive,15000,15070,14920,True
206 | CHARISfive,28995,29085,28964,True
207 | CHARISten,29080,29140,25390,False
208 | CHARISten,26929,26989,26950,True
209 | CHARISten,27929,27989,27946,True
210 | Fantasia,26970,27270,26868,False
211 | Italianpowerdemand,74900,74996,55138,False
212 | Italianpowerdemand,39240,39336,54997,False
213 | Italianpowerdemand,29480,29504,22970,False
214 | STAFFIIIDatabase,126920,127370,208049,False
215 | STAFFIIIDatabase,125720,126370,138862,False
216 | STAFFIIIDatabase,106720,107370,58486,False
217 | STAFFIIIDatabase,160720,161370,59250,False
218 | STAFFIIIDatabase,150720,151370,138862,False
219 | STAFFIIIDatabase,210720,211370,207989,False
220 | STAFFIIIDatabase,64632,64852,207889,False
221 | STAFFIIIDatabase,250720,251370,242338,False
222 | STAFFIIIDatabase,163632,164852,164156,True
223 | mit14046longtermecg,91200,91700,91637,True
224 | mit14046longtermecg,131200,131700,101716,False
225 | mit14046longtermecg,191200,191700,92909,False
226 | mit14046longtermecg,143000,143300,143130,True
227 | mit14046longtermecg,123000,123300,123157,True
228 | mit14134longtermecg,29000,29100,24722,False
229 | mit14134longtermecg,47830,47850,30436,False
230 | mit14134longtermecg,57960,57970,22107,False
231 | mit14134longtermecg,19510,19610,39561,False
232 | mit14134longtermecg,47530,47790,47603,True
233 | mit14134longtermecg,57530,57790,57669,True
234 | mit14157longtermecg,24500,24501,27464,False
235 | mit14157longtermecg,24600,24601,63580,False
236 | mit14157longtermecg,75450,75451,97001,False
237 | mit14157longtermecg,46350,46390,50529,False
238 | mit14157longtermecg,89560,90370,90075,True
239 | mit14157longtermecg,72600,72780,31374,False
240 | taichidbS0715Master,593450,593514,543781,False
241 | taichidbS0715Master,884100,884200,569944,False
242 | taichidbS0715Master,837400,839100,684662,False
243 | tilt12744mtable,104630,104890,187027,False
244 | tilt12744mtable,203355,203400,169318,False
245 | tilt12754table,104630,104890,296889,False
246 | tilt12754table,270800,271070,295374,False
247 | tilt12755mtable,270800,271070,213153,False
248 | tilt12755mtable,121900,121980,55420,False
249 | weallwalk,4702,4707,6260,False
250 | weallwalk,8285,8315,8265,True
251 | weallwalk,7290,7296,6557,False
252 |
--------------------------------------------------------------------------------
/experiments/anomaly_detection/svm/svm_MWF.csv:
--------------------------------------------------------------------------------
1 | name,true_start,true_end,prediction,match
2 | DISTORTED1sddb40,52000,52620,70896,False
3 | DISTORTED2sddb40,56600,56900,71212,False
4 | DISTORTED3sddb40,46600,46900,71076,False
5 | DISTORTEDBIDMC1,5400,5600,5473,True
6 | DISTORTEDCIMIS44AirTemperature1,5391,5392,6054,False
7 | DISTORTEDCIMIS44AirTemperature2,5703,5727,5904,False
8 | DISTORTEDCIMIS44AirTemperature3,6520,6544,7015,False
9 | DISTORTEDCIMIS44AirTemperature4,5549,5597,6680,False
10 | DISTORTEDCIMIS44AirTemperature5,4852,4900,4494,False
11 | DISTORTEDCIMIS44AirTemperature6,6006,6054,6772,False
12 | DISTORTEDECG1,11800,12100,11844,True
13 | DISTORTEDECG2,16000,16100,22723,False
14 | DISTORTEDECG3,16000,16100,23089,False
15 | DISTORTEDECG3,17000,17100,9432,False
16 | DISTORTEDECG4,16800,17100,16994,True
17 | DISTORTEDECG4,16900,17100,17067,True
18 | DISTORTEDECG4,17000,17100,14492,False
19 | DISTORTEDECG4,17000,17100,11738,False
20 | DISTORTEDGP711MarkerLFM5z1,6168,6212,10571,False
21 | DISTORTEDGP711MarkerLFM5z2,7175,7388,7064,False
22 | DISTORTEDGP711MarkerLFM5z3,5948,5993,6805,False
23 | DISTORTEDGP711MarkerLFM5z4,6527,6645,6370,False
24 | DISTORTEDGP711MarkerLFM5z5,8612,8716,11336,False
25 | DISTORTEDInternalBleeding10,4526,4556,5618,False
26 | DISTORTEDInternalBleeding14,5607,5634,6609,False
27 | DISTORTEDInternalBleeding15,5684,5854,5295,False
28 | DISTORTEDInternalBleeding16,4187,4199,1238,False
29 | DISTORTEDInternalBleeding17,3198,3309,2299,False
30 | DISTORTEDInternalBleeding18,4485,4587,2374,False
31 | DISTORTEDInternalBleeding19,4187,4197,3198,False
32 | DISTORTEDInternalBleeding20,5759,5919,5635,False
33 | DISTORTEDInternalBleeding4,4675,5033,4294,False
34 | DISTORTEDInternalBleeding5,6200,6370,6134,True
35 | DISTORTEDInternalBleeding6,3474,3629,5136,False
36 | DISTORTEDInternalBleeding8,5865,5974,3660,False
37 | DISTORTEDInternalBleeding9,6599,6681,4991,False
38 | DISTORTEDLab2Cmac011215EPG1,17210,17260,29841,False
39 | DISTORTEDLab2Cmac011215EPG2,27862,27932,12812,False
40 | DISTORTEDLab2Cmac011215EPG3,16390,16420,29790,False
41 | DISTORTEDLab2Cmac011215EPG4,17390,17520,29906,False
42 | DISTORTEDLab2Cmac011215EPG5,17390,17520,17371,True
43 | DISTORTEDLab2Cmac011215EPG6,12190,12420,13010,False
44 | DISTORTEDMesoplodonDensirostris,19280,19440,24465,False
45 | DISTORTEDPowerDemand1,18485,18821,14116,False
46 | DISTORTEDPowerDemand2,23357,23717,14112,False
47 | DISTORTEDPowerDemand3,23405,23477,22996,False
48 | DISTORTEDPowerDemand4,24005,24077,22940,False
49 | DISTORTEDTkeepFifthMARS,5988,6085,10444,False
50 | DISTORTEDTkeepFirstMARS,5365,5380,4385,False
51 | DISTORTEDTkeepForthMARS,5988,6085,8724,False
52 | DISTORTEDTkeepSecondMARS,9330,9340,9318,True
53 | DISTORTEDTkeepThirdMARS,4711,4809,4630,True
54 | DISTORTEDWalkingAceleration1,2764,2995,4034,False
55 | DISTORTEDWalkingAceleration5,5920,5979,3552,False
56 | DISTORTEDapneaecg2,20950,21100,-1,False
57 | DISTORTEDapneaecg3,11111,11211,29934,False
58 | DISTORTEDapneaecg4,16000,16100,-1,False
59 | DISTORTEDapneaecg,12240,12308,-1,False
60 | DISTORTEDgait1,38500,38800,48867,False
61 | DISTORTEDgait2,46500,46800,57390,False
62 | DISTORTEDgait3,59900,60500,59344,False
63 | DISTORTEDgaitHunt1,33070,33180,33207,True
64 | DISTORTEDgaitHunt2,31200,31850,25000,False
65 | DISTORTEDgaitHunt3,38400,39200,43766,False
66 | DISTORTEDinsectEPG1,7000,7030,7399,False
67 | DISTORTEDinsectEPG2,8000,8025,7994,True
68 | DISTORTEDinsectEPG3,7000,7050,6045,False
69 | DISTORTEDinsectEPG4,6508,6558,5179,False
70 | DISTORTEDinsectEPG5,8500,8501,8497,True
71 | DISTORTEDltstdbs30791AI,52600,52800,52666,True
72 | DISTORTEDltstdbs30791AS,52600,52800,52677,True
73 | DISTORTEDltstdbs30791ES,52600,52800,53368,False
74 | DISTORTEDpark3m,72150,72495,69248,False
75 | DISTORTEDqtdbSel1005V,12400,12800,29333,False
76 | DISTORTEDqtdbSel100MLII,13400,13800,23615,False
77 | DISTORTEDresperation10,130700,131880,134595,False
78 | DISTORTEDresperation11,110800,110801,134575,False
79 | DISTORTEDresperation1,110260,110412,134574,False
80 | DISTORTEDresperation2,168250,168250,131256,False
81 | DISTORTEDresperation2,168250,168251,134576,False
82 | DISTORTEDresperation3,158250,158251,131249,False
83 | DISTORTEDresperation4,128430,128431,134835,False
84 | DISTORTEDresperation9,143411,143511,131260,False
85 | DISTORTEDs20101mML2,35774,35874,38117,False
86 | DISTORTEDs20101m,35774,35874,17025,False
87 | DISTORTEDsddb49,67950,68200,51387,False
88 | DISTORTEDsel840mECG1,51370,51740,24667,False
89 | DISTORTEDsel840mECG2,49370,49740,43266,False
90 | DISTORTEDtiltAPB1,114283,114350,100263,False
91 | DISTORTEDtiltAPB2,124159,124985,97409,False
92 | DISTORTEDtiltAPB3,114000,114370,97236,False
93 | DISTORTEDtiltAPB4,67995,67996,97422,False
94 | NOISE1sddb40,52000,52620,70998,False
95 | NOISEBIDMC1,5400,5600,5454,True
96 | NOISECIMIS44AirTemperature4,5549,5597,6664,False
97 | NOISEECG4,16900,17100,16972,True
98 | NOISEGP711MarkerLFM5z3,5948,5993,8790,False
99 | NOISEInternalBleeding16,4187,4199,2152,False
100 | NOISEInternalBleeding6,3474,3629,7423,False
101 | NOISELab2Cmac011215EPG1,17210,17260,17210,True
102 | NOISELab2Cmac011215EPG4,17390,17520,29907,False
103 | NOISEMesoplodonDensirostris,19280,19440,24490,False
104 | NOISETkeepThirdMARS,4711,4809,4692,True
105 | NOISEapneaecg4,16000,16100,-1,False
106 | NOISEgait3,59900,60500,56904,False
107 | NOISEgaitHunt2,31200,31850,43665,False
108 | NOISEinsectEPG3,7000,7050,8820,False
109 | NOISEresperation2,168250,168250,134555,False
110 | 1sddb40,52000,52620,70960,False
111 | 2sddb40,56600,56900,71070,False
112 | 3sddb40,46600,46900,71093,False
113 | BIDMC1,5400,5600,5473,True
114 | CIMIS44AirTemperature1,5391,5392,7504,False
115 | CIMIS44AirTemperature2,5703,5727,6665,False
116 | CIMIS44AirTemperature3,6520,6544,6663,False
117 | CIMIS44AirTemperature4,5549,5597,6665,False
118 | CIMIS44AirTemperature5,4852,4900,6665,False
119 | CIMIS44AirTemperature6,6006,6054,6689,False
120 | ECG1,11800,12100,11895,True
121 | ECG2,16000,16100,22804,False
122 | ECG3,16000,16100,23081,False
123 | ECG3,17000,17100,23117,False
124 | ECG4,16800,17100,134559,False
125 | ECG4,16900,17100,6168,False
126 | ECG4,17000,17100,23019,False
127 | ECG4,17000,17100,23003,False
128 | GP711MarkerLFM5z1,6168,6212,5999,False
129 | GP711MarkerLFM5z2,7175,7388,7063,False
130 | GP711MarkerLFM5z3,5948,5993,8786,False
131 | GP711MarkerLFM5z4,6527,6645,6369,False
132 | GP711MarkerLFM5z5,8612,8716,8786,True
133 | InternalBleeding10,4526,4556,5590,False
134 | InternalBleeding14,5607,5634,6617,False
135 | InternalBleeding15,5684,5854,5799,True
136 | InternalBleeding16,4187,4199,2125,False
137 | InternalBleeding17,3198,3309,6674,False
138 | InternalBleeding18,4485,4587,3334,False
139 | InternalBleeding19,4187,4197,3271,False
140 | InternalBleeding20,5759,5919,5638,False
141 | InternalBleeding4,4675,5033,1098,False
142 | InternalBleeding5,6200,6370,6134,True
143 | InternalBleeding6,3474,3629,6228,False
144 | InternalBleeding8,5865,5974,5866,True
145 | InternalBleeding9,6599,6681,7281,False
146 | Lab2Cmac011215EPG1,17210,17260,17210,True
147 | Lab2Cmac011215EPG2,27862,27932,29791,False
148 | Lab2Cmac011215EPG3,16390,16420,29791,False
149 | Lab2Cmac011215EPG4,17390,17520,29907,False
150 | Lab2Cmac011215EPG5,17390,17520,17404,True
151 | Lab2Cmac011215EPG6,12190,12420,29700,False
152 | MesoplodonDensirostris,19280,19440,24490,False
153 | PowerDemand1,18485,18821,14116,False
154 | PowerDemand2,23357,23717,14213,False
155 | PowerDemand3,23405,23477,22985,False
156 | PowerDemand4,24005,24077,22983,False
157 | TkeepFifthMARS,5988,6085,10736,False
158 | TkeepFirstMARS,5365,5380,10806,False
159 | TkeepForthMARS,5988,6085,10710,False
160 | TkeepSecondMARS,9330,9340,9318,True
161 | TkeepThirdMARS,4711,4809,4692,True
162 | WalkingAceleration1,2764,2995,2448,False
163 | WalkingAceleration5,5920,5979,4033,False
164 | apneaecg2,20950,21100,-1,False
165 | apneaecg3,11111,11211,-1,False
166 | apneaecg4,16000,16100,-1,False
167 | apneaecg,12240,12308,-1,False
168 | gait1,38500,38800,56841,False
169 | gait2,46500,46800,35656,False
170 | gait3,59900,60500,56841,False
171 | gaitHunt1,33070,33180,43758,False
172 | gaitHunt2,31200,31850,43705,False
173 | gaitHunt3,38400,39200,43622,False
174 | insectEPG1,7000,7030,8820,False
175 | insectEPG2,8000,8025,7995,True
176 | insectEPG3,7000,7050,8820,False
177 | insectEPG4,6508,6558,8820,False
178 | insectEPG5,8500,8501,8497,True
179 | ltstdbs30791AI,52600,52800,52586,True
180 | ltstdbs30791AS,52600,52800,52510,True
181 | ltstdbs30791ES,52600,52800,32826,False
182 | park3m,72150,72495,72175,True
183 | qtdbSel1005V,12400,12800,-1,False
184 | qtdbSel100MLII,13400,13800,23671,False
185 | resperation10,130700,131880,134554,False
186 | resperation11,110800,110801,131246,False
187 | resperation1,110260,110412,131260,False
188 | resperation2,168250,168250,134566,False
189 | resperation2,168250,168251,134565,False
190 | resperation3,158250,158251,134580,False
191 | resperation4,128430,128431,131521,False
192 | resperation9,143411,143511,131263,False
193 | s20101mML2,35774,35874,38110,False
194 | s20101m,35774,35874,17922,False
195 | sddb49,67950,68200,47480,False
196 | sel840mECG1,51370,51740,51193,False
197 | sel840mECG2,49370,49740,43271,False
198 | tiltAPB1,114283,114350,100032,False
199 | tiltAPB2,124159,124985,97408,False
200 | tiltAPB3,114000,114370,97410,False
201 | tiltAPB4,67995,67996,97232,False
202 | CHARISfive,17001,17016,15405,False
203 | CHARISfive,10998,11028,37607,False
204 | CHARISfive,10995,11028,11679,False
205 | CHARISfive,15000,15070,37856,False
206 | CHARISfive,28995,29085,35725,False
207 | CHARISten,29080,29140,26081,False
208 | CHARISten,26929,26989,6844,False
209 | CHARISten,27929,27989,6680,False
210 | Fantasia,26970,27270,69122,False
211 | Italianpowerdemand,74900,74996,56988,False
212 | Italianpowerdemand,39240,39336,56583,False
213 | Italianpowerdemand,29480,29504,14176,False
214 | STAFFIIIDatabase,126920,127370,174708,False
215 | STAFFIIIDatabase,125720,126370,54538,False
216 | STAFFIIIDatabase,106720,107370,140157,False
217 | STAFFIIIDatabase,160720,161370,119126,False
218 | STAFFIIIDatabase,150720,151370,54753,False
219 | STAFFIIIDatabase,210720,211370,174677,False
220 | STAFFIIIDatabase,64632,64852,174531,False
221 | STAFFIIIDatabase,250720,251370,-1,False
222 | STAFFIIIDatabase,163632,164852,246429,False
223 | mit14046longtermecg,91200,91700,91224,True
224 | mit14046longtermecg,131200,131700,106893,False
225 | mit14046longtermecg,191200,191700,79658,False
226 | mit14046longtermecg,143000,143300,87541,False
227 | mit14046longtermecg,123000,123300,179852,False
228 | mit14134longtermecg,29000,29100,40394,False
229 | mit14134longtermecg,47830,47850,-1,False
230 | mit14134longtermecg,57960,57970,-1,False
231 | mit14134longtermecg,19510,19610,-1,False
232 | mit14134longtermecg,47530,47790,-1,False
233 | mit14134longtermecg,57530,57790,-1,False
234 | mit14157longtermecg,24500,24501,79711,False
235 | mit14157longtermecg,24600,24601,50885,False
236 | mit14157longtermecg,75450,75451,90697,False
237 | mit14157longtermecg,46350,46390,62901,False
238 | mit14157longtermecg,89560,90370,38804,False
239 | mit14157longtermecg,72600,72780,68151,False
240 | taichidbS0715Master,593450,593514,-1,False
241 | taichidbS0715Master,884100,884200,-1,False
242 | taichidbS0715Master,837400,839100,-1,False
243 | tilt12744mtable,104630,104890,187976,False
244 | tilt12744mtable,203355,203400,169298,False
245 | tilt12754table,104630,104890,190380,False
246 | tilt12754table,270800,271070,188998,False
247 | tilt12755mtable,270800,271070,106068,False
248 | tilt12755mtable,121900,121980,106035,False
249 | weallwalk,4702,4707,2761,False
250 | weallwalk,8285,8315,10246,False
251 | weallwalk,7290,7296,10185,False
252 |
--------------------------------------------------------------------------------
/experiments/motifs/images/ECG-Heartbeat_grid.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ermshaua/window-size-selection/e247e2d05c0be1b59536420f5e979818d3ba2b79/experiments/motifs/images/ECG-Heartbeat_grid.pdf
--------------------------------------------------------------------------------
/experiments/motifs/images/EEG-Sleep-Data_grid.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ermshaua/window-size-selection/e247e2d05c0be1b59536420f5e979818d3ba2b79/experiments/motifs/images/EEG-Sleep-Data_grid.pdf
--------------------------------------------------------------------------------
/experiments/motifs/images/Muscle-Activation_grid.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ermshaua/window-size-selection/e247e2d05c0be1b59536420f5e979818d3ba2b79/experiments/motifs/images/Muscle-Activation_grid.pdf
--------------------------------------------------------------------------------
/experiments/motifs/images/fNIRS_grid.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ermshaua/window-size-selection/e247e2d05c0be1b59536420f5e979818d3ba2b79/experiments/motifs/images/fNIRS_grid.pdf
--------------------------------------------------------------------------------
/experiments/motifs/window_sizes.csv:
--------------------------------------------------------------------------------
1 | ,dataset,Ground Truth,FFT,ACF,SuSS,MWF,Autoperiod,RobustPeriod
2 | 0,winding_col,60,99,60,62,117,60,339
3 | 1,ecg-heartbeat-av,125,600,73,104,138,635,43
4 | 2,fNIRS_subLen_600,160,800,44,122,-1,1143,318
5 | 3,muscle_activation,600,879,866,108,-1,875,175
6 | 4,npo141,25,20,121,128,372,22,-1
7 |
--------------------------------------------------------------------------------
/experiments/ranks.csv:
--------------------------------------------------------------------------------
1 | method,clasp,floss,window,discord,isolation_forest,svm,avg
2 | ACF,6,6,2,2,3,5,4.0
3 | AutoPeriod,5,5,6,1,2,1,3.3
4 | FFT,2,1,3,4,1,2,2.17
5 | Human,1,4,4,5,7,7,4.7
6 | MWF,4,2,5,3,6,4,4.0
7 | RobustPeriod,7,7,7,7,5,6,6.5
8 | SuSS,3,3,1,6,4,3,3.3
--------------------------------------------------------------------------------
/experiments/segmentation/window/window_ACF.csv:
--------------------------------------------------------------------------------
1 | name,true_cps,found_cps,f1_score,covering_score
2 | Adiac,"[572, 1012, 1232]","[390, 610, 1315]",0.25,0.561
3 | ArrowHead,[753],[350],0.5,0.558
4 | Beef,[705],[545],0.5,0.794
5 | BeetleFly,[1280],[455],0.5,0.482
6 | BirdChicken,[1280],[1880],0.5,0.606
7 | Car,"[577, 1154, 1550]","[235, 1475, 2070]",0.25,0.492
8 | CBF,"[384, 704]","[535, 635]",0.333,0.601
9 | ChlorineConcentration,[2365],[935],0.5,0.672
10 | CinCECGTorso,"[2663, 5121]","[1525, 4230]",0.333,0.561
11 | Coffee,[500],[780],0.5,0.541
12 | Computers,[5625],[2195],0.5,0.506
13 | CricketX,"[712, 1293, 1930, 2586]","[630, 985, 1155, 1960]",0.4,0.632
14 | CricketY,"[525, 1162, 1837, 2399]","[1305, 1660, 2570, 2860]",0.2,0.493
15 | CricketZ,"[600, 1106, 1574, 2174]","[65, 405, 575, 2015]",0.4,0.462
16 | DiatomSizeReduction,"[517, 948]","[635, 915]",0.333,0.786
17 | DistalPhalanxOutlineAgeGroup,[300],[1245],0.5,0.573
18 | DistalPhalanxTW,"[580, 2220]","[2270, 2490]",0.333,0.602
19 | Earthquakes,[8448],[8605],0.5,0.97
20 | ECG200,[744],[130],0.5,0.583
21 | ECG5000,[1277],[605],0.5,0.497
22 | ECGFiveDays,[476],[595],0.5,0.726
23 | ElectricDevices,"[1090, 4436, 5712, 7923]","[2325, 7975, 9245, 11300]",0.4,0.411
24 | FaceAll,"[1310, 2620, 3930, 5240, 6550, 7860]","[110, 1290, 2600, 3400, 4365, 8100]",0.429,0.602
25 | FaceFour,"[2800, 5600, 6650]","[1390, 3235, 3985]",0.25,0.374
26 | FacesUCR,"[851, 1637, 2292, 3733, 4715, 5566]","[575, 1020, 1950, 3195, 4445, 6020]",0.143,0.507
27 | FiftyWords,"[1755, 3408, 4521]","[1765, 2045, 3130]",0.5,0.702
28 | Fish,"[1504, 2950, 4570, 5785, 7058, 8504]","[1595, 3325, 4365, 6335, 7030, 8820]",0.429,0.736
29 | GunPoint,[900],[1300],0.5,0.639
30 | Haptics,"[1228, 3548]","[3445, 5625]",0.333,0.661
31 | InlineSkate,"[1058, 2704]","[425, 4200]",0.333,0.386
32 | InsectWingbeatSound,"[320, 640, 960]","[415, 550, 1240]",0.25,0.51
33 | ItalyPowerDemand,[816],[1495],0.5,0.485
34 | LargeKitchenAppliances,"[2812, 5624]","[5135, 6060]",0.333,0.602
35 | Lightning2,[398],[215],0.5,0.722
36 | Lightning7,"[1276, 2552, 3828, 5742]","[905, 1685, 2475, 3475]",0.2,0.607
37 | Mallat,"[768, 1792, 2560]","[800, 1250, 1760]",0.75,0.608
38 | Meat,"[1120, 2240]","[45, 745]",0.333,0.494
39 | MedicalImages,[1732],[520],0.5,0.457
40 | MoteStrain,[840],[1065],0.5,0.76
41 | NonInvasiveFetalECGThorax1,"[1687, 4124, 6233, 8108, 10358]","[6325, 8270, 8925, 10520, 11880]",0.333,0.518
42 | NonInvasiveFetalECGThorax2,"[1687, 4124, 6233, 8108, 10358, 12420]","[2505, 8925, 10145, 12020, 13050, 13825]",0.143,0.455
43 | OliveOil,"[1425, 3705]","[745, 5020]",0.333,0.587
44 | OSULeaf,"[907, 1680]","[1670, 1955]",0.667,0.535
45 | Plane,"[540, 1044, 1368, 1944, 2412, 3060]","[1130, 1755, 2115, 2330, 2685, 3615]",0.143,0.446
46 | ProximalPhalanxOutlineAgeGroup,"[720, 2110]","[2565, 2845]",0.333,0.528
47 | ProximalPhalanxTW,"[320, 2500, 3660]","[950, 1890, 3930]",0.25,0.444
48 | ShapesAll,"[1280, 2560, 3840, 5120]","[3795, 4765, 5165, 5625]",0.6,0.46
49 | SonyAIBORobotSurface1,[420],[1310],0.5,0.541
50 | SonyAIBORobotSurface2,[715],[1640],0.5,0.49
51 | StarLightCurves,"[486, 1366]","[1700, 2540]",0.333,0.448
52 | SwedishLeaf,"[928, 2080, 3200]","[1035, 1990, 3695]",0.25,0.731
53 | Symbols,"[796, 1293, 1591]","[50, 745, 945]",0.25,0.551
54 | SyntheticControl,"[750, 1500, 2250, 3000]","[880, 1845, 2415, 3135]",0.2,0.668
55 | ToeSegmentation1,[1385],[1750],0.5,0.764
56 | ToeSegmentation2,[1543],[2620],0.5,0.469
57 | Trace,"[1443, 2955]","[4085, 5050]",0.333,0.4
58 | TwoLeadECG,[246],[275],0.5,0.883
59 | TwoPatterns,"[2168, 4064, 6064]","[1335, 2485, 5670]",0.25,0.587
60 | UWaveGestureLibraryAll,"[1801, 3395, 4960, 6584]","[3555, 5755, 7300, 7890]",0.2,0.44
61 | UWaveGestureLibraryX,"[600, 1131, 1652, 2193]","[1965, 2230, 2555, 2780]",0.2,0.356
62 | UWaveGestureLibraryY,"[600, 1131, 1652, 2193]","[1340, 1640, 2195, 2630]",0.6,0.618
63 | UWaveGestureLibraryZ,"[600, 1131, 1652, 2193]","[225, 450, 1610, 1975]",0.2,0.511
64 | Wafer,[115],[765],0.5,0.509
65 | WordSynonyms,"[202, 2227]","[720, 2105]",0.333,0.643
66 | Worms,"[435, 786]","[495, 1175]",0.333,0.612
67 | Yoga,[7295],[2170],0.5,0.488
68 | Crop,"[1725, 3450, 5175, 8625, 12075, 15525, 17250, 18975]","[1735, 4155, 7735, 9045, 11560, 14320, 18090, 19190]",0.222,0.622
69 | EOGHorizontalSignal,"[1406, 2812, 4218]","[2840, 4245, 4650]",0.75,0.63
70 | EOGVerticalSignal,"[1406, 2812, 3749, 5155, 6608]","[1355, 1830, 2840, 4170, 5345]",0.5,0.648
71 | FreezerRegularTrain,"[2257, 4514, 7900]","[805, 2155, 4415]",0.75,0.598
72 | Ham,"[1400, 2935, 4335]","[695, 3630, 4505]",0.25,0.595
73 | MelbournePedestrian,"[576, 1152, 2016, 2592, 3168, 4032]","[665, 965, 2385, 3105, 3810, 4640]",0.143,0.595
74 | MiddlePhalanxOutlineAgeGroup,"[880, 2608, 6400, 7720]","[6505, 8295, 9175, 10055]",0.2,0.438
75 | MiddlePhalanxOutlineCorrect,"[1060, 3000, 4060]","[730, 3010, 3690]",0.5,0.832
76 | PowerCons,"[405, 810, 1215]","[50, 690, 860]",0.25,0.473
77 | ProximalPhalanxOutlineCorrect,"[776, 3212, 4376]","[715, 4380, 4755]",0.5,0.658
78 | Strawberry,"[804, 2250, 3054]","[1665, 3525, 5200]",0.25,0.498
79 | Chinatown,[],[],1.0,1.0
80 | DodgerLoopDay,[],[],1.0,1.0
81 | Herring,[],[],1.0,1.0
82 | MiddlePhalanxTW,[],[],1.0,1.0
83 | ShapeletSim,[],[],1.0,1.0
84 | UMD,[],[],1.0,1.0
85 |
--------------------------------------------------------------------------------
/experiments/segmentation/window/window_Autoperiod.csv:
--------------------------------------------------------------------------------
1 | name,true_cps,found_cps,f1_score,covering_score
2 | Adiac,"[572, 1012, 1232]","[390, 610, 1315]",0.25,0.561
3 | ArrowHead,[753],[1310],0.5,0.472
4 | Beef,[705],[1265],0.5,0.477
5 | BeetleFly,[1280],[1925],0.5,0.581
6 | BirdChicken,[1280],[495],0.5,0.503
7 | Car,"[577, 1154, 1550]","[1295, 1475, 1715]",0.25,0.528
8 | CBF,"[384, 704]","[535, 635]",0.333,0.601
9 | ChlorineConcentration,[2365],[7580],0.5,0.56
10 | CinCECGTorso,"[2663, 5121]","[1525, 3935]",0.333,0.515
11 | Coffee,[500],[780],0.5,0.541
12 | Computers,[5625],[2195],0.5,0.506
13 | CricketX,"[712, 1293, 1930, 2586]","[630, 985, 1155, 1960]",0.4,0.632
14 | CricketY,"[525, 1162, 1837, 2399]","[1305, 1660, 2570, 2860]",0.2,0.493
15 | CricketZ,"[600, 1106, 1574, 2174]","[405, 650, 950, 2035]",0.2,0.576
16 | DiatomSizeReduction,"[517, 948]","[635, 915]",0.333,0.786
17 | DistalPhalanxOutlineAgeGroup,[300],[1245],0.5,0.573
18 | DistalPhalanxTW,"[580, 2220]","[2270, 2490]",0.333,0.602
19 | Earthquakes,[8448],[8605],0.5,0.97
20 | ECG200,[744],[685],0.5,0.952
21 | ECG5000,[1277],[105],0.5,0.506
22 | ECGFiveDays,[476],[185],0.5,0.437
23 | ElectricDevices,"[1090, 4436, 5712, 7923]",[],0.0,0.0
24 | FaceAll,"[1310, 2620, 3930, 5240, 6550, 7860]",[],0.0,0.0
25 | FaceFour,"[2800, 5600, 6650]","[1390, 3195, 3895]",0.25,0.377
26 | FacesUCR,"[851, 1637, 2292, 3733, 4715, 5566]","[650, 1755, 2215, 3920, 5295, 6475]",0.143,0.677
27 | FiftyWords,"[1755, 3408, 4521]","[1765, 2045, 3130]",0.5,0.702
28 | Fish,"[1504, 2950, 4570, 5785, 7058, 8504]","[630, 1570, 3405, 3925, 5085, 6545]",0.286,0.459
29 | GunPoint,[900],[1300],0.5,0.639
30 | Haptics,"[1228, 3548]","[3445, 5625]",0.333,0.661
31 | InlineSkate,"[1058, 2704]","[775, 2535]",0.333,0.829
32 | InsectWingbeatSound,"[320, 640, 960]","[440, 550, 1240]",0.25,0.48
33 | ItalyPowerDemand,[816],[525],0.5,0.687
34 | LargeKitchenAppliances,"[2812, 5624]","[5135, 6060]",0.333,0.602
35 | Lightning2,[398],[285],0.5,0.822
36 | Lightning7,"[1276, 2552, 3828, 5742]","[535, 1035, 2675, 3635]",0.2,0.607
37 | Mallat,"[768, 1792, 2560]","[225, 1930, 2315]",0.25,0.611
38 | Meat,"[1120, 2240]","[45, 745]",0.333,0.494
39 | MedicalImages,[1732],[520],0.5,0.457
40 | MoteStrain,[840],[1395],0.5,0.471
41 | NonInvasiveFetalECGThorax1,"[1687, 4124, 6233, 8108, 10358]","[6325, 8270, 8925, 10520, 11880]",0.333,0.518
42 | NonInvasiveFetalECGThorax2,"[1687, 4124, 6233, 8108, 10358, 12420]","[2505, 8925, 10145, 12020, 13050, 13825]",0.143,0.455
43 | OliveOil,"[1425, 3705]","[745, 5020]",0.333,0.587
44 | OSULeaf,"[907, 1680]","[1375, 1570]",0.333,0.542
45 | Plane,"[540, 1044, 1368, 1944, 2412, 3060]","[2030, 2255, 2560, 3100, 3460, 3740]",0.143,0.407
46 | ProximalPhalanxOutlineAgeGroup,"[720, 2110]","[2565, 2845]",0.333,0.528
47 | ProximalPhalanxTW,"[320, 2500, 3660]","[950, 1890, 3930]",0.25,0.444
48 | ShapesAll,"[1280, 2560, 3840, 5120]","[1450, 2055, 2800, 4810]",0.2,0.608
49 | SonyAIBORobotSurface1,[420],[1305],0.5,0.539
50 | SonyAIBORobotSurface2,[715],[350],0.5,0.638
51 | StarLightCurves,"[486, 1366]",[],0.0,0.0
52 | SwedishLeaf,"[928, 2080, 3200]","[20, 340, 620]",0.25,0.314
53 | Symbols,"[796, 1293, 1591]","[50, 745, 945]",0.25,0.551
54 | SyntheticControl,"[750, 1500, 2250, 3000]","[880, 1845, 2415, 3135]",0.2,0.668
55 | ToeSegmentation1,[1385],[1750],0.5,0.764
56 | ToeSegmentation2,[1543],[1620],0.5,0.951
57 | Trace,"[1443, 2955]","[4085, 5050]",0.333,0.4
58 | TwoLeadECG,[246],[320],0.5,0.722
59 | TwoPatterns,"[2168, 4064, 6064]","[2915, 4350, 4770]",0.25,0.554
60 | UWaveGestureLibraryAll,"[1801, 3395, 4960, 6584]","[565, 3710, 5900, 6330]",0.2,0.517
61 | UWaveGestureLibraryX,"[600, 1131, 1652, 2193]","[1185, 1515, 1770, 2090]",0.2,0.613
62 | UWaveGestureLibraryY,"[600, 1131, 1652, 2193]","[1280, 2180, 2385, 2700]",0.4,0.466
63 | UWaveGestureLibraryZ,"[600, 1131, 1652, 2193]","[225, 1135, 1340, 2380]",0.4,0.518
64 | Wafer,[115],[325],0.5,0.76
65 | WordSynonyms,"[202, 2227]","[195, 2150]",0.667,0.94
66 | Worms,"[435, 786]","[790, 1175]",0.667,0.631
67 | Yoga,[7295],[7490],0.5,0.976
68 | Crop,"[1725, 3450, 5175, 8625, 12075, 15525, 17250, 18975]","[605, 2410, 5355, 7770, 11220, 16130, 18120, 19430]",0.222,0.576
69 | EOGHorizontalSignal,"[1406, 2812, 4218]","[2840, 4245, 4650]",0.75,0.63
70 | EOGVerticalSignal,"[1406, 2812, 3749, 5155, 6608]","[1355, 1830, 2840, 4170, 5345]",0.5,0.648
71 | FreezerRegularTrain,"[2257, 4514, 7900]","[805, 2155, 4415]",0.75,0.598
72 | Ham,"[1400, 2935, 4335]","[1570, 3240, 4505]",0.25,0.806
73 | MelbournePedestrian,"[576, 1152, 2016, 2592, 3168, 4032]","[545, 1025, 1505, 3545, 4385, 4865]",0.286,0.496
74 | MiddlePhalanxOutlineAgeGroup,"[880, 2608, 6400, 7720]","[6505, 8295, 9175, 10055]",0.2,0.438
75 | MiddlePhalanxOutlineCorrect,"[1060, 3000, 4060]","[730, 3010, 3690]",0.5,0.832
76 | PowerCons,"[405, 810, 1215]","[450, 765, 1275]",0.25,0.807
77 | ProximalPhalanxOutlineCorrect,"[776, 3212, 4376]","[715, 4380, 4755]",0.5,0.658
78 | Strawberry,"[804, 2250, 3054]","[3290, 3790, 5200]",0.25,0.41
79 | Chinatown,[],[],1.0,1.0
80 | DodgerLoopDay,[],[],1.0,1.0
81 | Herring,[],[],1.0,1.0
82 | MiddlePhalanxTW,[],[],1.0,1.0
83 | ShapeletSim,[],[],0.0,0.0
84 | UMD,[],[],1.0,1.0
85 |
--------------------------------------------------------------------------------
/experiments/segmentation/window/window_FFT.csv:
--------------------------------------------------------------------------------
1 | name,true_cps,found_cps,f1_score,covering_score
2 | Adiac,"[572, 1012, 1232]","[390, 610, 1315]",0.25,0.561
3 | ArrowHead,[753],[495],0.5,0.701
4 | Beef,[705],[1265],0.5,0.477
5 | BeetleFly,[1280],[1275],1.0,0.996
6 | BirdChicken,[1280],[495],0.5,0.503
7 | Car,"[577, 1154, 1550]","[1295, 1475, 1715]",0.25,0.528
8 | CBF,"[384, 704]","[535, 635]",0.333,0.601
9 | ChlorineConcentration,[2365],[7580],0.5,0.56
10 | CinCECGTorso,"[2663, 5121]","[1525, 6640]",0.333,0.454
11 | Coffee,[500],[780],0.5,0.541
12 | Computers,[5625],[2195],0.5,0.506
13 | CricketX,"[712, 1293, 1930, 2586]","[630, 985, 1155, 1960]",0.4,0.632
14 | CricketY,"[525, 1162, 1837, 2399]","[1305, 1660, 2570, 2860]",0.2,0.493
15 | CricketZ,"[600, 1106, 1574, 2174]","[405, 650, 950, 2035]",0.2,0.576
16 | DiatomSizeReduction,"[517, 948]","[635, 915]",0.333,0.786
17 | DistalPhalanxOutlineAgeGroup,[300],[1245],0.5,0.573
18 | DistalPhalanxTW,"[580, 2220]","[2270, 2490]",0.333,0.602
19 | Earthquakes,[8448],[8605],0.5,0.97
20 | ECG200,[744],[395],0.5,0.734
21 | ECG5000,[1277],[1905],0.5,0.533
22 | ECGFiveDays,[476],[185],0.5,0.437
23 | ElectricDevices,"[1090, 4436, 5712, 7923]","[2325, 9385, 10440, 11165]",0.2,0.297
24 | FaceAll,"[1310, 2620, 3930, 5240, 6550, 7860]","[920, 2590, 4365, 6715, 8100, 9085]",0.286,0.651
25 | FaceFour,"[2800, 5600, 6650]","[670, 1390, 4510]",0.25,0.367
26 | FacesUCR,"[851, 1637, 2292, 3733, 4715, 5566]","[650, 1755, 2215, 3920, 5295, 6475]",0.143,0.677
27 | FiftyWords,"[1755, 3408, 4521]","[1765, 2045, 3130]",0.5,0.702
28 | Fish,"[1504, 2950, 4570, 5785, 7058, 8504]","[630, 1570, 3405, 3925, 5085, 6545]",0.286,0.459
29 | GunPoint,[900],[1300],0.5,0.639
30 | Haptics,"[1228, 3548]","[3445, 5625]",0.333,0.661
31 | InlineSkate,"[1058, 2704]","[775, 2535]",0.333,0.829
32 | InsectWingbeatSound,"[320, 640, 960]","[440, 550, 1240]",0.25,0.48
33 | ItalyPowerDemand,[816],[525],0.5,0.687
34 | LargeKitchenAppliances,"[2812, 5624]","[5135, 6060]",0.333,0.602
35 | Lightning2,[398],[285],0.5,0.822
36 | Lightning7,"[1276, 2552, 3828, 5742]","[535, 1035, 2675, 3635]",0.2,0.607
37 | Mallat,"[768, 1792, 2560]","[245, 1930, 2315]",0.25,0.618
38 | Meat,"[1120, 2240]","[45, 325]",0.333,0.329
39 | MedicalImages,[1732],[520],0.5,0.457
40 | MoteStrain,[840],[1395],0.5,0.471
41 | NonInvasiveFetalECGThorax1,"[1687, 4124, 6233, 8108, 10358]","[6325, 8270, 8925, 10520, 11880]",0.333,0.518
42 | NonInvasiveFetalECGThorax2,"[1687, 4124, 6233, 8108, 10358, 12420]","[2505, 8925, 10145, 12020, 13050, 13825]",0.143,0.455
43 | OliveOil,"[1425, 3705]","[745, 5020]",0.333,0.587
44 | OSULeaf,"[907, 1680]","[1375, 1570]",0.333,0.542
45 | Plane,"[540, 1044, 1368, 1944, 2412, 3060]","[2030, 2255, 2560, 3100, 3460, 3740]",0.143,0.407
46 | ProximalPhalanxOutlineAgeGroup,"[720, 2110]","[2565, 2845]",0.333,0.528
47 | ProximalPhalanxTW,"[320, 2500, 3660]","[950, 1890, 3930]",0.25,0.444
48 | ShapesAll,"[1280, 2560, 3840, 5120]","[1450, 2055, 2800, 4810]",0.2,0.608
49 | SonyAIBORobotSurface1,[420],[1305],0.5,0.539
50 | SonyAIBORobotSurface2,[715],[350],0.5,0.638
51 | StarLightCurves,"[486, 1366]","[1665, 2460]",0.333,0.438
52 | SwedishLeaf,"[928, 2080, 3200]","[20, 340, 620]",0.25,0.314
53 | Symbols,"[796, 1293, 1591]","[995, 1095, 1815]",0.25,0.5
54 | SyntheticControl,"[750, 1500, 2250, 3000]","[880, 1845, 2415, 3135]",0.2,0.668
55 | ToeSegmentation1,[1385],[765],0.5,0.622
56 | ToeSegmentation2,[1543],[1620],0.5,0.951
57 | Trace,"[1443, 2955]","[4085, 5050]",0.333,0.4
58 | TwoLeadECG,[246],[320],0.5,0.722
59 | TwoPatterns,"[2168, 4064, 6064]","[3015, 3660, 4535]",0.25,0.508
60 | UWaveGestureLibraryAll,"[1801, 3395, 4960, 6584]","[535, 1680, 5185, 5680]",0.2,0.512
61 | UWaveGestureLibraryX,"[600, 1131, 1652, 2193]","[1965, 2230, 2555, 2780]",0.2,0.356
62 | UWaveGestureLibraryY,"[600, 1131, 1652, 2193]","[1340, 1640, 2195, 2630]",0.6,0.618
63 | UWaveGestureLibraryZ,"[600, 1131, 1652, 2193]","[225, 450, 1610, 1975]",0.2,0.511
64 | Wafer,[115],[15],0.5,0.839
65 | WordSynonyms,"[202, 2227]","[2015, 2150]",0.333,0.745
66 | Worms,"[435, 786]","[500, 965]",0.333,0.679
67 | Yoga,[7295],[9885],0.5,0.718
68 | Crop,"[1725, 3450, 5175, 8625, 12075, 15525, 17250, 18975]","[605, 2410, 5355, 7770, 11220, 16130, 18120, 19430]",0.222,0.576
69 | EOGHorizontalSignal,"[1406, 2812, 4218]","[2840, 4245, 4650]",0.75,0.63
70 | EOGVerticalSignal,"[1406, 2812, 3749, 5155, 6608]","[1355, 1825, 2840, 4125, 5345]",0.5,0.657
71 | FreezerRegularTrain,"[2257, 4514, 7900]","[805, 2155, 4415]",0.75,0.598
72 | Ham,"[1400, 2935, 4335]","[1570, 3240, 4505]",0.25,0.806
73 | MelbournePedestrian,"[576, 1152, 2016, 2592, 3168, 4032]","[785, 1925, 2700, 3120, 4570, 4865]",0.286,0.568
74 | MiddlePhalanxOutlineAgeGroup,"[880, 2608, 6400, 7720]","[6505, 8295, 9175, 10055]",0.2,0.438
75 | MiddlePhalanxOutlineCorrect,"[1060, 3000, 4060]","[730, 3010, 3690]",0.5,0.832
76 | PowerCons,"[405, 810, 1215]","[140, 690, 950]",0.25,0.418
77 | ProximalPhalanxOutlineCorrect,"[776, 3212, 4376]","[715, 4380, 4755]",0.5,0.658
78 | Strawberry,"[804, 2250, 3054]","[3290, 3790, 5200]",0.25,0.41
79 | Chinatown,[],[],1.0,1.0
80 | DodgerLoopDay,[],[],1.0,1.0
81 | Herring,[],[],1.0,1.0
82 | MiddlePhalanxTW,[],[],1.0,1.0
83 | ShapeletSim,[],[],1.0,1.0
84 | UMD,[],[],1.0,1.0
85 |
--------------------------------------------------------------------------------
/experiments/segmentation/window/window_Human.csv:
--------------------------------------------------------------------------------
1 | name,true_cps,found_cps,f1_score,covering_score
2 | Adiac,"[572, 1012, 1232]","[700, 1140, 1325]",0.25,0.608
3 | ArrowHead,[753],[685],0.5,0.913
4 | Beef,[705],[915],0.5,0.736
5 | BeetleFly,[1280],[2505],0.5,0.495
6 | BirdChicken,[1280],[1380],0.5,0.925
7 | Car,"[577, 1154, 1550]","[1295, 1475, 1715]",0.25,0.528
8 | CBF,"[384, 704]","[465, 635]",0.333,0.717
9 | ChlorineConcentration,[2365],[3565],0.5,0.744
10 | CinCECGTorso,"[2663, 5121]","[95, 3380]",0.333,0.569
11 | Coffee,[500],[745],0.5,0.591
12 | Computers,[5625],[4660],0.5,0.841
13 | CricketX,"[712, 1293, 1930, 2586]","[135, 630, 1155, 1360]",0.2,0.479
14 | CricketY,"[525, 1162, 1837, 2399]","[865, 1265, 1660, 1920]",0.2,0.515
15 | CricketZ,"[600, 1106, 1574, 2174]","[65, 405, 1005, 1495]",0.2,0.548
16 | DiatomSizeReduction,"[517, 948]","[95, 440]",0.333,0.543
17 | DistalPhalanxOutlineAgeGroup,[300],[1245],0.5,0.573
18 | DistalPhalanxTW,"[580, 2220]","[100, 2480]",0.333,0.52
19 | Earthquakes,[8448],[8605],0.5,0.97
20 | ECG200,[744],[395],0.5,0.734
21 | ECG5000,[1277],[1905],0.5,0.533
22 | ECGFiveDays,[476],[595],0.5,0.726
23 | ElectricDevices,"[1090, 4436, 5712, 7923]","[2325, 9385, 10440, 11165]",0.2,0.297
24 | FaceAll,"[1310, 2620, 3930, 5240, 6550, 7860]","[920, 2590, 4365, 6715, 8100, 9085]",0.286,0.651
25 | FaceFour,"[2800, 5600, 6650]","[1390, 3195, 3895]",0.25,0.377
26 | FacesUCR,"[851, 1637, 2292, 3733, 4715, 5566]","[1615, 2530, 3050, 4450, 5870, 6260]",0.286,0.482
27 | FiftyWords,"[1755, 3408, 4521]","[1895, 2335, 5115]",0.25,0.527
28 | Fish,"[1504, 2950, 4570, 5785, 7058, 8504]","[515, 3290, 4045, 6040, 6705, 8180]",0.143,0.561
29 | GunPoint,[900],[1095],0.5,0.811
30 | Haptics,"[1228, 3548]","[300, 4080]",0.333,0.598
31 | InlineSkate,"[1058, 2704]","[2235, 4675]",0.333,0.587
32 | InsectWingbeatSound,"[320, 640, 960]","[480, 560, 1105]",0.25,0.513
33 | ItalyPowerDemand,[816],[1040],0.5,0.751
34 | LargeKitchenAppliances,"[2812, 5624]","[5135, 6875]",0.333,0.505
35 | Lightning2,[398],[285],0.5,0.822
36 | Lightning7,"[1276, 2552, 3828, 5742]","[270, 1175, 1880, 3500]",0.2,0.535
37 | Mallat,"[768, 1792, 2560]","[2085, 2340, 3080]",0.25,0.486
38 | Meat,"[1120, 2240]","[1780, 3180]",0.333,0.506
39 | MedicalImages,[1732],[545],0.5,0.451
40 | MoteStrain,[840],[1065],0.5,0.76
41 | NonInvasiveFetalECGThorax1,"[1687, 4124, 6233, 8108, 10358]","[910, 1660, 4190, 5785, 7565]",0.5,0.632
42 | NonInvasiveFetalECGThorax2,"[1687, 4124, 6233, 8108, 10358, 12420]","[910, 1660, 5035, 6160, 7565, 11925]",0.429,0.582
43 | OliveOil,"[1425, 3705]","[3210, 4635]",0.333,0.608
44 | OSULeaf,"[907, 1680]","[1070, 1570]",0.333,0.761
45 | Plane,"[540, 1044, 1368, 1944, 2412, 3060]","[465, 795, 1155, 2595, 3315, 3705]",0.143,0.491
46 | ProximalPhalanxOutlineAgeGroup,"[720, 2110]","[2565, 2845]",0.333,0.528
47 | ProximalPhalanxTW,"[320, 2500, 3660]","[300, 2500, 3860]",0.75,0.897
48 | ShapesAll,"[1280, 2560, 3840, 5120]","[2305, 3845, 5460, 6195]",0.4,0.63
49 | SonyAIBORobotSurface1,[420],[425],1.0,0.993
50 | SonyAIBORobotSurface2,[715],[350],0.5,0.638
51 | StarLightCurves,"[486, 1366]","[1665, 2460]",0.333,0.438
52 | SwedishLeaf,"[928, 2080, 3200]","[1075, 1805, 3220]",0.5,0.816
53 | Symbols,"[796, 1293, 1591]","[100, 895, 995]",0.25,0.505
54 | SyntheticControl,"[750, 1500, 2250, 3000]","[1890, 2325, 3060, 3600]",0.2,0.557
55 | ToeSegmentation1,[1385],[2305],0.5,0.468
56 | ToeSegmentation2,[1543],[2400],0.5,0.544
57 | Trace,"[1443, 2955]","[1855, 3710]",0.333,0.636
58 | TwoLeadECG,[246],[135],0.5,0.607
59 | TwoPatterns,"[2168, 4064, 6064]","[3015, 3660, 4535]",0.25,0.508
60 | UWaveGestureLibraryAll,"[1801, 3395, 4960, 6584]","[4810, 6065, 7280, 7960]",0.2,0.395
61 | UWaveGestureLibraryX,"[600, 1131, 1652, 2193]","[1965, 2230, 2555, 2780]",0.2,0.356
62 | UWaveGestureLibraryY,"[600, 1131, 1652, 2193]","[1340, 1640, 2195, 2630]",0.6,0.618
63 | UWaveGestureLibraryZ,"[600, 1131, 1652, 2193]","[225, 450, 1610, 1975]",0.2,0.511
64 | Wafer,[115],[765],0.5,0.509
65 | WordSynonyms,"[202, 2227]","[1345, 1815]",0.333,0.467
66 | Worms,"[435, 786]","[790, 1175]",0.667,0.631
67 | Yoga,[7295],[5875],0.5,0.835
68 | Crop,"[1725, 3450, 5175, 8625, 12075, 15525, 17250, 18975]","[2185, 3335, 9730, 11685, 13035, 14815, 18240, 19475]",0.222,0.543
69 | EOGHorizontalSignal,"[1406, 2812, 4218]","[2525, 4245, 5040]",0.5,0.638
70 | EOGVerticalSignal,"[1406, 2812, 3749, 5155, 6608]","[495, 1355, 5185, 7025, 7885]",0.5,0.51
71 | FreezerRegularTrain,"[2257, 4514, 7900]","[2195, 8590, 9630]",0.5,0.571
72 | Ham,"[1400, 2935, 4335]","[2850, 3980, 5785]",0.25,0.615
73 | MelbournePedestrian,"[576, 1152, 2016, 2592, 3168, 4032]","[785, 1925, 2700, 3120, 4570, 4865]",0.286,0.568
74 | MiddlePhalanxOutlineAgeGroup,"[880, 2608, 6400, 7720]","[585, 7875, 9195, 10155]",0.2,0.439
75 | MiddlePhalanxOutlineCorrect,"[1060, 3000, 4060]","[3060, 4000, 7240]",0.75,0.714
76 | PowerCons,"[405, 810, 1215]","[535, 680, 1385]",0.25,0.516
77 | ProximalPhalanxOutlineCorrect,"[776, 3212, 4376]","[715, 4380, 4755]",0.5,0.658
78 | Strawberry,"[804, 2250, 3054]","[3950, 4420, 5595]",0.25,0.342
79 | Chinatown,[],[],1.0,1.0
80 | DodgerLoopDay,[],[],1.0,1.0
81 | Herring,[],[],1.0,1.0
82 | MiddlePhalanxTW,[],[],1.0,1.0
83 | ShapeletSim,[],[],1.0,1.0
84 | UMD,[],[],1.0,1.0
85 |
--------------------------------------------------------------------------------
/experiments/segmentation/window/window_MWF.csv:
--------------------------------------------------------------------------------
1 | name,true_cps,found_cps,f1_score,covering_score
2 | Adiac,"[572, 1012, 1232]","[390, 610, 1315]",0.25,0.561
3 | ArrowHead,[753],[1310],0.5,0.472
4 | Beef,[705],[545],0.5,0.794
5 | BeetleFly,[1280],[1925],0.5,0.581
6 | BirdChicken,[1280],[2415],0.5,0.487
7 | Car,"[577, 1154, 1550]","[1295, 1475, 1715]",0.25,0.528
8 | CBF,"[384, 704]",[],0.0,0.0
9 | ChlorineConcentration,[2365],[7580],0.5,0.56
10 | CinCECGTorso,"[2663, 5121]","[1525, 3815]",0.333,0.497
11 | Coffee,[500],[780],0.5,0.541
12 | Computers,[5625],[2195],0.5,0.506
13 | CricketX,"[712, 1293, 1930, 2586]","[630, 985, 1155, 1960]",0.4,0.632
14 | CricketY,"[525, 1162, 1837, 2399]","[1305, 1660, 2570, 2860]",0.2,0.493
15 | CricketZ,"[600, 1106, 1574, 2174]","[405, 650, 950, 2035]",0.2,0.576
16 | DiatomSizeReduction,"[517, 948]","[635, 915]",0.333,0.786
17 | DistalPhalanxOutlineAgeGroup,[300],[1240],0.5,0.57
18 | DistalPhalanxTW,"[580, 2220]","[2270, 2490]",0.333,0.602
19 | Earthquakes,[8448],[8605],0.5,0.97
20 | ECG200,[744],[685],0.5,0.952
21 | ECG5000,[1277],[1905],0.5,0.533
22 | ECGFiveDays,[476],[],0.0,0.0
23 | ElectricDevices,"[1090, 4436, 5712, 7923]","[2325, 5215, 8900, 11165]",0.2,0.53
24 | FaceAll,"[1310, 2620, 3930, 5240, 6550, 7860]","[2120, 2580, 3400, 4365, 6705, 8100]",0.286,0.569
25 | FaceFour,"[2800, 5600, 6650]","[1390, 3195, 3900]",0.25,0.377
26 | FacesUCR,"[851, 1637, 2292, 3733, 4715, 5566]","[510, 1950, 3050, 4930, 5800, 6415]",0.143,0.515
27 | FiftyWords,"[1755, 3408, 4521]","[1765, 2045, 3130]",0.5,0.702
28 | Fish,"[1504, 2950, 4570, 5785, 7058, 8504]","[630, 1570, 3405, 3925, 5085, 6545]",0.286,0.459
29 | GunPoint,[900],[1300],0.5,0.639
30 | Haptics,"[1228, 3548]","[3445, 5625]",0.333,0.661
31 | InlineSkate,"[1058, 2704]","[775, 2535]",0.333,0.829
32 | InsectWingbeatSound,"[320, 640, 960]","[360, 550, 1105]",0.25,0.652
33 | ItalyPowerDemand,[816],[525],0.5,0.687
34 | LargeKitchenAppliances,"[2812, 5624]","[5135, 6060]",0.333,0.602
35 | Lightning2,[398],[285],0.5,0.822
36 | Lightning7,"[1276, 2552, 3828, 5742]","[535, 1035, 2675, 3635]",0.2,0.607
37 | Mallat,"[768, 1792, 2560]","[950, 1975, 2360]",0.25,0.744
38 | Meat,"[1120, 2240]","[45, 745]",0.333,0.494
39 | MedicalImages,[1732],[520],0.5,0.457
40 | MoteStrain,[840],[1395],0.5,0.471
41 | NonInvasiveFetalECGThorax1,"[1687, 4124, 6233, 8108, 10358]","[6325, 8270, 8925, 10520, 11880]",0.333,0.518
42 | NonInvasiveFetalECGThorax2,"[1687, 4124, 6233, 8108, 10358, 12420]","[2505, 8925, 10145, 12020, 13050, 13825]",0.143,0.455
43 | OliveOil,"[1425, 3705]","[745, 5020]",0.333,0.587
44 | OSULeaf,"[907, 1680]","[1690, 2015]",0.667,0.56
45 | Plane,"[540, 1044, 1368, 1944, 2412, 3060]","[2030, 2255, 2560, 3100, 3460, 3740]",0.143,0.407
46 | ProximalPhalanxOutlineAgeGroup,"[720, 2110]","[3130, 3960]",0.333,0.403
47 | ProximalPhalanxTW,"[320, 2500, 3660]","[950, 1890, 3930]",0.25,0.444
48 | ShapesAll,"[1280, 2560, 3840, 5120]","[1450, 2055, 4190, 4810]",0.2,0.649
49 | SonyAIBORobotSurface1,[420],[1305],0.5,0.539
50 | SonyAIBORobotSurface2,[715],[990],0.5,0.73
51 | StarLightCurves,"[486, 1366]","[1665, 2660]",0.333,0.501
52 | SwedishLeaf,"[928, 2080, 3200]","[20, 340, 620]",0.25,0.314
53 | Symbols,"[796, 1293, 1591]","[995, 1095, 1815]",0.25,0.5
54 | SyntheticControl,"[750, 1500, 2250, 3000]","[880, 1845, 2415, 3135]",0.2,0.668
55 | ToeSegmentation1,[1385],[1905],0.5,0.676
56 | ToeSegmentation2,[1543],[1620],0.5,0.951
57 | Trace,"[1443, 2955]","[4085, 5050]",0.333,0.4
58 | TwoLeadECG,[246],[],0.0,0.0
59 | TwoPatterns,"[2168, 4064, 6064]","[3150, 3975, 5310]",0.25,0.613
60 | UWaveGestureLibraryAll,"[1801, 3395, 4960, 6584]","[4810, 6065, 7280, 7960]",0.2,0.395
61 | UWaveGestureLibraryX,"[600, 1131, 1652, 2193]","[1965, 2230, 2555, 2780]",0.2,0.356
62 | UWaveGestureLibraryY,"[600, 1131, 1652, 2193]","[1340, 1640, 2195, 2630]",0.6,0.618
63 | UWaveGestureLibraryZ,"[600, 1131, 1652, 2193]","[225, 450, 1610, 1975]",0.2,0.511
64 | Wafer,[115],[765],0.5,0.509
65 | WordSynonyms,"[202, 2227]","[2015, 2150]",0.333,0.745
66 | Worms,"[435, 786]","[510, 975]",0.333,0.656
67 | Yoga,[7295],[4030],0.5,0.647
68 | Crop,"[1725, 3450, 5175, 8625, 12075, 15525, 17250, 18975]","[605, 2410, 5355, 7770, 11220, 16130, 18120, 19430]",0.222,0.576
69 | EOGHorizontalSignal,"[1406, 2812, 4218]","[2840, 4245, 4650]",0.75,0.63
70 | EOGVerticalSignal,"[1406, 2812, 3749, 5155, 6608]","[1355, 1830, 2840, 4170, 5345]",0.5,0.648
71 | FreezerRegularTrain,"[2257, 4514, 7900]","[805, 2155, 4415]",0.75,0.598
72 | Ham,"[1400, 2935, 4335]","[695, 3630, 4505]",0.25,0.595
73 | MelbournePedestrian,"[576, 1152, 2016, 2592, 3168, 4032]","[545, 1025, 1505, 3545, 4385, 4865]",0.286,0.496
74 | MiddlePhalanxOutlineAgeGroup,"[880, 2608, 6400, 7720]","[6505, 8295, 9175, 10055]",0.2,0.438
75 | MiddlePhalanxOutlineCorrect,"[1060, 3000, 4060]","[730, 3010, 3690]",0.5,0.832
76 | PowerCons,"[405, 810, 1215]","[680, 870, 1385]",0.25,0.483
77 | ProximalPhalanxOutlineCorrect,"[776, 3212, 4376]","[770, 4380, 5940]",0.75,0.725
78 | Strawberry,"[804, 2250, 3054]","[3290, 3790, 5200]",0.25,0.41
79 | Chinatown,[],[],0.0,0.0
80 | DodgerLoopDay,[],[],1.0,1.0
81 | Herring,[],[],1.0,1.0
82 | MiddlePhalanxTW,[],[],1.0,1.0
83 | ShapeletSim,[],[],1.0,1.0
84 | UMD,[],[],1.0,1.0
85 |
--------------------------------------------------------------------------------
/experiments/segmentation/window/window_RobustPeriod.csv:
--------------------------------------------------------------------------------
1 | name,true_cps,found_cps,f1_score,covering_score
2 | Adiac,"[572, 1012, 1232]","[680, 1325, 1405]",0.25,0.59
3 | ArrowHead,[753],[495],0.5,0.701
4 | Beef,[705],[100],0.5,0.484
5 | BeetleFly,[1280],[1275],1.0,0.996
6 | BirdChicken,[1280],[495],0.5,0.503
7 | Car,"[577, 1154, 1550]","[1295, 1475, 1715]",0.25,0.528
8 | CBF,"[384, 704]","[235, 440]",0.333,0.529
9 | ChlorineConcentration,[2365],[7580],0.5,0.56
10 | CinCECGTorso,"[2663, 5121]",[],0.0,0.0
11 | Coffee,[500],[780],0.5,0.541
12 | Computers,[5625],[2195],0.5,0.506
13 | CricketX,"[712, 1293, 1930, 2586]","[275, 575, 2055, 2615]",0.4,0.578
14 | CricketY,"[525, 1162, 1837, 2399]","[1305, 1660, 2570, 2860]",0.2,0.493
15 | CricketZ,"[600, 1106, 1574, 2174]","[550, 855, 1825, 2070]",0.2,0.629
16 | DiatomSizeReduction,"[517, 948]","[80, 165]",0.333,0.318
17 | DistalPhalanxOutlineAgeGroup,[300],[],0.0,0.0
18 | DistalPhalanxTW,"[580, 2220]",[],0.0,0.0
19 | Earthquakes,[8448],[8605],0.5,0.97
20 | ECG200,[744],[1155],0.5,0.718
21 | ECG5000,[1277],[105],0.5,0.506
22 | ECGFiveDays,[476],[185],0.5,0.437
23 | ElectricDevices,"[1090, 4436, 5712, 7923]",[],0.0,0.0
24 | FaceAll,"[1310, 2620, 3930, 5240, 6550, 7860]","[2590, 3375, 4365, 6715, 8060, 8585]",0.286,0.519
25 | FaceFour,"[2800, 5600, 6650]","[670, 1390, 4510]",0.25,0.367
26 | FacesUCR,"[851, 1637, 2292, 3733, 4715, 5566]","[650, 990, 1615, 3050, 4120, 5870]",0.286,0.526
27 | FiftyWords,"[1755, 3408, 4521]","[1765, 2045, 3130]",0.5,0.702
28 | Fish,"[1504, 2950, 4570, 5785, 7058, 8504]","[515, 3290, 4045, 5200, 6705, 7225]",0.143,0.455
29 | GunPoint,[900],[1300],0.5,0.639
30 | Haptics,"[1228, 3548]","[340, 730]",0.333,0.424
31 | InlineSkate,"[1058, 2704]","[775, 2535]",0.333,0.829
32 | InsectWingbeatSound,"[320, 640, 960]","[360, 480, 550]",0.25,0.535
33 | ItalyPowerDemand,[816],[1105],0.5,0.688
34 | LargeKitchenAppliances,"[2812, 5624]","[5135, 6060]",0.333,0.602
35 | Lightning2,[398],[110],0.5,0.582
36 | Lightning7,"[1276, 2552, 3828, 5742]","[60, 750, 1400, 1880]",0.2,0.373
37 | Mallat,"[768, 1792, 2560]","[800, 1250, 1760]",0.75,0.608
38 | Meat,"[1120, 2240]","[1275, 2395]",0.333,0.832
39 | MedicalImages,[1732],[1090],0.5,0.601
40 | MoteStrain,[840],[665],0.5,0.81
41 | NonInvasiveFetalECGThorax1,"[1687, 4124, 6233, 8108, 10358]","[1735, 2485, 3235, 3985, 9890]",0.333,0.487
42 | NonInvasiveFetalECGThorax2,"[1687, 4124, 6233, 8108, 10358, 12420]","[1660, 4425, 5315, 6955, 10940, 12065]",0.286,0.636
43 | OliveOil,"[1425, 3705]","[250, 1390]",0.667,0.578
44 | OSULeaf,"[907, 1680]","[330, 2015]",0.333,0.366
45 | Plane,"[540, 1044, 1368, 1944, 2412, 3060]","[140, 465, 1155, 1995, 2595, 3460]",0.143,0.547
46 | ProximalPhalanxOutlineAgeGroup,"[720, 2110]",[],0.0,0.0
47 | ProximalPhalanxTW,"[320, 2500, 3660]",[],0.0,0.0
48 | ShapesAll,"[1280, 2560, 3840, 5120]","[1450, 2055, 2800, 4810]",0.2,0.608
49 | SonyAIBORobotSurface1,[420],[1235],0.5,0.51
50 | SonyAIBORobotSurface2,[715],[990],0.5,0.73
51 | StarLightCurves,"[486, 1366]",[],0.0,0.0
52 | SwedishLeaf,"[928, 2080, 3200]","[20, 340, 620]",0.25,0.314
53 | Symbols,"[796, 1293, 1591]","[895, 995, 1095]",0.25,0.546
54 | SyntheticControl,"[750, 1500, 2250, 3000]","[1570, 2260, 2975, 3570]",0.6,0.708
55 | ToeSegmentation1,[1385],[1905],0.5,0.676
56 | ToeSegmentation2,[1543],[1620],0.5,0.951
57 | Trace,"[1443, 2955]","[3230, 4330]",0.333,0.482
58 | TwoLeadECG,[246],[],0.0,0.0
59 | TwoPatterns,"[2168, 4064, 6064]","[2915, 4350, 4770]",0.25,0.554
60 | UWaveGestureLibraryAll,"[1801, 3395, 4960, 6584]","[535, 1680, 5185, 5680]",0.2,0.512
61 | UWaveGestureLibraryX,"[600, 1131, 1652, 2193]","[245, 2285, 2595, 2800]",0.2,0.344
62 | UWaveGestureLibraryY,"[600, 1131, 1652, 2193]","[1335, 1650, 2180, 2630]",0.6,0.621
63 | UWaveGestureLibraryZ,"[600, 1131, 1652, 2193]","[405, 1440, 1620, 1950]",0.2,0.564
64 | Wafer,[115],[145],0.5,0.955
65 | WordSynonyms,"[202, 2227]","[1345, 1815]",0.333,0.467
66 | Worms,"[435, 786]",[],0.0,0.0
67 | Yoga,[7295],[10100],0.5,0.698
68 | Crop,"[1725, 3450, 5175, 8625, 12075, 15525, 17250, 18975]","[2185, 3335, 5735, 10120, 11220, 13035, 16270, 19475]",0.222,0.555
69 | EOGHorizontalSignal,"[1406, 2812, 4218]","[2525, 2915, 4245]",0.5,0.685
70 | EOGVerticalSignal,"[1406, 2812, 3749, 5155, 6608]","[495, 1355, 5185, 7025, 7885]",0.5,0.51
71 | FreezerRegularTrain,"[2257, 4514, 7900]","[2195, 8590, 9630]",0.5,0.571
72 | Ham,"[1400, 2935, 4335]","[1570, 3240, 4505]",0.25,0.806
73 | MelbournePedestrian,"[576, 1152, 2016, 2592, 3168, 4032]","[785, 2045, 2760, 3065, 3545, 4415]",0.286,0.553
74 | MiddlePhalanxOutlineAgeGroup,"[880, 2608, 6400, 7720]","[825, 8135, 8935, 10155]",0.4,0.452
75 | MiddlePhalanxOutlineCorrect,"[1060, 3000, 4060]","[660, 3760, 7180]",0.25,0.631
76 | PowerCons,"[405, 810, 1215]","[450, 765, 1275]",0.25,0.807
77 | ProximalPhalanxOutlineCorrect,"[776, 3212, 4376]","[790, 4440, 4750]",0.5,0.666
78 | Strawberry,"[804, 2250, 3054]","[3290, 3790, 5200]",0.25,0.41
79 | Chinatown,[],[],1.0,1.0
80 | DodgerLoopDay,[],[],1.0,1.0
81 | Herring,[],[],1.0,1.0
82 | MiddlePhalanxTW,[],[],1.0,1.0
83 | ShapeletSim,[],[],1.0,1.0
84 | UMD,[],[],1.0,1.0
85 |
--------------------------------------------------------------------------------
/experiments/segmentation/window/window_SuSS.csv:
--------------------------------------------------------------------------------
1 | name,true_cps,found_cps,f1_score,covering_score
2 | Adiac,"[572, 1012, 1232]","[390, 610, 1315]",0.25,0.561
3 | ArrowHead,[753],[1310],0.5,0.472
4 | Beef,[705],[1265],0.5,0.477
5 | BeetleFly,[1280],[25],0.5,0.498
6 | BirdChicken,[1280],[495],0.5,0.503
7 | Car,"[577, 1154, 1550]","[1295, 1475, 2075]",0.25,0.537
8 | CBF,"[384, 704]","[485, 535]",0.333,0.575
9 | ChlorineConcentration,[2365],[940],0.5,0.673
10 | CinCECGTorso,"[2663, 5121]","[6640, 7055]",0.333,0.336
11 | Coffee,[500],[780],0.5,0.541
12 | Computers,[5625],[2630],0.5,0.56
13 | CricketX,"[712, 1293, 1930, 2586]","[30, 705, 1360, 1960]",0.6,0.748
14 | CricketY,"[525, 1162, 1837, 2399]","[330, 1550, 2635, 2915]",0.2,0.458
15 | CricketZ,"[600, 1106, 1574, 2174]","[50, 350, 595, 2130]",0.4,0.487
16 | DiatomSizeReduction,"[517, 948]","[440, 915]",0.333,0.845
17 | DistalPhalanxOutlineAgeGroup,[300],[1215],0.5,0.557
18 | DistalPhalanxTW,"[580, 2220]","[2270, 2490]",0.333,0.602
19 | Earthquakes,[8448],[8605],0.5,0.97
20 | ECG200,[744],[395],0.5,0.734
21 | ECG5000,[1277],[1800],0.5,0.564
22 | ECGFiveDays,[476],[595],0.5,0.726
23 | ElectricDevices,"[1090, 4436, 5712, 7923]","[2325, 9385, 10350, 11195]",0.2,0.289
24 | FaceAll,"[1310, 2620, 3930, 5240, 6550, 7860]","[1290, 2600, 3400, 4365, 6725, 8100]",0.429,0.708
25 | FaceFour,"[2800, 5600, 6650]","[1390, 3200, 3905]",0.25,0.377
26 | FacesUCR,"[851, 1637, 2292, 3733, 4715, 5566]","[40, 535, 1060, 1455, 4450, 5820]",0.143,0.483
27 | FiftyWords,"[1755, 3408, 4521]","[20, 1765, 2045]",0.5,0.562
28 | Fish,"[1504, 2950, 4570, 5785, 7058, 8504]","[630, 1570, 3115, 4155, 4910, 6545]",0.286,0.536
29 | GunPoint,[900],[1300],0.5,0.639
30 | Haptics,"[1228, 3548]","[4800, 5825]",0.333,0.419
31 | InlineSkate,"[1058, 2704]","[775, 1115]",0.333,0.556
32 | InsectWingbeatSound,"[320, 640, 960]","[150, 325, 550]",0.5,0.526
33 | ItalyPowerDemand,[816],[1065],0.5,0.727
34 | LargeKitchenAppliances,"[2812, 5624]","[5135, 6665]",0.333,0.53
35 | Lightning2,[398],[110],0.5,0.582
36 | Lightning7,"[1276, 2552, 3828, 5742]","[535, 1175, 2680, 3635]",0.2,0.636
37 | Mallat,"[768, 1792, 2560]","[225, 630, 2805]",0.25,0.585
38 | Meat,"[1120, 2240]","[45, 325]",0.333,0.329
39 | MedicalImages,[1732],[520],0.5,0.457
40 | MoteStrain,[840],[1395],0.5,0.471
41 | NonInvasiveFetalECGThorax1,"[1687, 4124, 6233, 8108, 10358]","[6325, 8270, 8925, 10050, 11925]",0.333,0.501
42 | NonInvasiveFetalECGThorax2,"[1687, 4124, 6233, 8108, 10358, 12420]","[1800, 3675, 5315, 8690, 12580, 14080]",0.286,0.632
43 | OliveOil,"[1425, 3705]","[2920, 4630]",0.333,0.593
44 | OSULeaf,"[907, 1680]","[330, 2010]",0.333,0.366
45 | Plane,"[540, 1044, 1368, 1944, 2412, 3060]","[1075, 1365, 2110, 2660, 3200, 3460]",0.429,0.553
46 | ProximalPhalanxOutlineAgeGroup,"[720, 2110]","[705, 2055]",0.667,0.966
47 | ProximalPhalanxTW,"[320, 2500, 3660]","[950, 1890, 3930]",0.25,0.444
48 | ShapesAll,"[1280, 2560, 3840, 5120]","[1445, 2055, 2640, 3570]",0.2,0.599
49 | SonyAIBORobotSurface1,[420],[1305],0.5,0.539
50 | SonyAIBORobotSurface2,[715],[860],0.5,0.849
51 | StarLightCurves,"[486, 1366]","[1925, 2440]",0.333,0.401
52 | SwedishLeaf,"[928, 2080, 3200]","[1035, 1745, 2005]",0.25,0.607
53 | Symbols,"[796, 1293, 1591]","[100, 200, 995]",0.25,0.429
54 | SyntheticControl,"[750, 1500, 2250, 3000]","[1875, 2255, 2730, 2995]",0.6,0.585
55 | ToeSegmentation1,[1385],[825],0.5,0.654
56 | ToeSegmentation2,[1543],[1620],0.5,0.951
57 | Trace,"[1443, 2955]","[1855, 3710]",0.333,0.636
58 | TwoLeadECG,[246],[320],0.5,0.722
59 | TwoPatterns,"[2168, 4064, 6064]","[2170, 3975, 4695]",0.5,0.725
60 | UWaveGestureLibraryAll,"[1801, 3395, 4960, 6584]","[4765, 6065, 7280, 7960]",0.2,0.392
61 | UWaveGestureLibraryX,"[600, 1131, 1652, 2193]","[1965, 2210, 2525, 2805]",0.4,0.355
62 | UWaveGestureLibraryY,"[600, 1131, 1652, 2193]","[1410, 1630, 2195, 2630]",0.6,0.578
63 | UWaveGestureLibraryZ,"[600, 1131, 1652, 2193]","[450, 1330, 1620, 1915]",0.2,0.618
64 | Wafer,[115],[40],0.5,0.878
65 | WordSynonyms,"[202, 2227]","[195, 1680]",0.667,0.713
66 | Worms,"[435, 786]","[285, 975]",0.333,0.586
67 | Yoga,[7295],[6190],0.5,0.869
68 | Crop,"[1725, 3450, 5175, 8625, 12075, 15525, 17250, 18975]","[1735, 3925, 8940, 11560, 12870, 14320, 18090, 19190]",0.222,0.627
69 | EOGHorizontalSignal,"[1406, 2812, 4218]","[2840, 4245, 4650]",0.75,0.63
70 | EOGVerticalSignal,"[1406, 2812, 3749, 5155, 6608]","[1355, 1875, 2840, 4170, 5345]",0.5,0.643
71 | FreezerRegularTrain,"[2257, 4514, 7900]","[805, 4645, 7730]",0.25,0.748
72 | Ham,"[1400, 2935, 4335]","[415, 3350, 4105]",0.25,0.564
73 | MelbournePedestrian,"[576, 1152, 2016, 2592, 3168, 4032]","[680, 1135, 2155, 2755, 3095, 3835]",0.286,0.75
74 | MiddlePhalanxOutlineAgeGroup,"[880, 2608, 6400, 7720]","[345, 5000, 6505, 7465]",0.2,0.563
75 | MiddlePhalanxOutlineCorrect,"[1060, 3000, 4060]","[730, 3010, 3690]",0.5,0.832
76 | PowerCons,"[405, 810, 1215]","[575, 705, 805]",0.5,0.529
77 | ProximalPhalanxOutlineCorrect,"[776, 3212, 4376]","[75, 770, 4380]",0.75,0.722
78 | Strawberry,"[804, 2250, 3054]","[2255, 2695, 3060]",0.75,0.764
79 | Chinatown,[],[],1.0,1.0
80 | DodgerLoopDay,[],[],1.0,1.0
81 | Herring,[],[],1.0,1.0
82 | MiddlePhalanxTW,[],[],1.0,1.0
83 | ShapeletSim,[],[],1.0,1.0
84 | UMD,[],[],1.0,1.0
85 |
--------------------------------------------------------------------------------
/experiments/segmentation/window_sizes.csv:
--------------------------------------------------------------------------------
1 | ,dataset,Human,FFT,ACF,SuSS,MWF,Autoperiod,RobustPeriod
2 | 0,Adiac,10,22,22,22,22,22,4
3 | 1,ArrowHead,10,31,63,32,32,32,31
4 | 2,Beef,50,58,118,66,117,61,7
5 | 3,BeetleFly,10,21,258,34,112,27,22
6 | 4,BirdChicken,20,42,255,48,69,44,43
7 | 5,Car,20,18,36,24,18,18,18
8 | 6,CBF,20,32,32,36,-1,32,343
9 | 7,ChlorineConcentration,10,20,83,36,20,21,21
10 | 8,CinCECGTorso,10,199,825,106,269,235,-1
11 | 9,Coffee,10,35,36,30,9,36,4
12 | 10,Computers,50,45,44,68,45,44,45
13 | 11,CricketX,10,18,19,42,19,19,69
14 | 12,CricketY,10,18,19,34,19,19,19
15 | 13,CricketZ,10,18,112,44,19,19,323
16 | 14,DiatomSizeReduction,20,43,43,34,43,43,14
17 | 15,DistalPhalanxOutlineAgeGroup,50,10,10,20,16,10,3
18 | 16,DistalPhalanxTW,10,20,20,20,20,20,3
19 | 17,Earthquakes,10,19,557,68,88,22,435
20 | 18,ECG200,20,23,48,32,24,24,12
21 | 19,ECG5000,10,11,35,26,9,4,4
22 | 20,ECGFiveDays,20,17,68,42,-1,16,17
23 | 21,ElectricDevices,10,10,12,82,8,-1,-1
24 | 22,FaceAll,10,10,33,40,22,-1,6
25 | 23,FaceFour,50,43,349,88,85,46,44
26 | 24,FacesUCR,20,10,262,34,44,10,22
27 | 25,FiftyWords,10,33,34,38,33,34,34
28 | 26,Fish,10,28,58,30,29,29,14
29 | 27,GunPoint,10,37,37,40,37,37,37
30 | 28,Haptics,10,68,68,50,68,68,17
31 | 29,InlineSkate,10,117,235,72,118,117,118
32 | 30,InsectWingbeatSound,10,16,48,26,12,16,83
33 | 31,ItalyPowerDemand,20,24,48,28,24,24,12
34 | 32,LargeKitchenAppliances,100,22,23,46,22,23,22
35 | 33,Lightning2,20,19,60,34,20,20,34
36 | 34,Lightning7,50,159,638,96,160,159,27
37 | 35,Mallat,10,42,128,38,89,41,128
38 | 36,Meat,10,27,56,44,56,56,5
39 | 37,MedicalImages,10,49,49,52,49,49,16
40 | 38,MoteStrain,50,83,251,78,83,84,16
41 | 39,NonInvasiveFetalECGThorax1,20,46,47,44,47,47,7
42 | 40,NonInvasiveFetalECGThorax2,20,46,47,40,47,47,10
43 | 41,OliveOil,50,285,285,70,270,285,26
44 | 42,OSULeaf,10,13,53,26,41,13,64
45 | 43,Plane,10,18,36,26,18,18,12
46 | 44,ProximalPhalanxOutlineAgeGroup,10,10,10,20,16,10,3
47 | 45,ProximalPhalanxTW,10,20,20,20,20,20,3
48 | 46,ShapesAll,10,64,128,58,69,65,64
49 | 47,SonyAIBORobotSurface1,20,35,70,42,36,33,14
50 | 48,SonyAIBORobotSurface2,10,13,130,48,31,7,32
51 | 49,StarLightCurves,10,10,16,20,9,-1,3
52 | 50,SwedishLeaf,10,16,32,30,16,16,16
53 | 51,Symbols,10,99,100,60,99,100,33
54 | 52,SyntheticControl,10,15,15,24,15,15,160
55 | 53,ToeSegmentation1,10,26,22,40,82,24,88
56 | 54,ToeSegmentation2,10,33,68,48,36,35,34
57 | 55,Trace,50,68,69,50,68,69,34
58 | 56,TwoLeadECG,10,20,41,26,-1,20,-1
59 | 57,TwoPatterns,10,10,112,26,12,8,8
60 | 58,UWaveGestureLibraryAll,10,14,59,20,11,5,15
61 | 59,UWaveGestureLibraryX,10,10,10,20,11,5,35
62 | 60,UWaveGestureLibraryY,10,10,10,20,11,5,61
63 | 61,UWaveGestureLibraryZ,10,10,10,20,11,5,36
64 | 62,Wafer,20,12,184,26,9,6,264
65 | 63,WordSynonyms,10,33,101,40,33,34,11
66 | 64,Worms,10,19,38,30,24,11,-1
67 | 65,Yoga,10,26,107,34,43,24,18
68 | 66,Crop,10,22,46,52,23,23,12
69 | 67,EOGHorizontalSignal,20,80,78,80,78,78,19
70 | 68,EOGVerticalSignal,20,77,78,70,78,78,20
71 | 69,FreezerRegularTrain,20,75,75,64,75,75,15
72 | 70,Ham,10,26,108,52,107,26,27
73 | 71,MelbournePedestrian,10,11,24,20,12,12,6
74 | 72,MiddlePhalanxOutlineAgeGroup,10,39,40,28,40,40,13
75 | 73,MiddlePhalanxOutlineCorrect,10,20,20,20,20,20,136
76 | 74,PowerCons,10,17,18,26,12,5,5
77 | 75,ProximalPhalanxOutlineCorrect,10,10,10,20,16,10,135
78 | 76,Strawberry,10,14,44,22,14,15,15
79 | 77,Chinatown,10,24,24,24,-1,24,24
80 | 78,DodgerLoopDay,20,288,13,62,288,287,96
81 | 79,Herring,10,64,128,48,64,64,64
82 | 80,MiddlePhalanxTW,10,80,80,38,74,80,27
83 | 81,ShapeletSim,50,11,641,22,194,2,100
84 | 82,UMD,10,138,151,74,143,151,25
85 |
--------------------------------------------------------------------------------
/notebooks/README.md:
--------------------------------------------------------------------------------
1 | # Notebooks
2 | This folder contains Jupyter notebooks to analyse the anomaly detection, segmentation and motif discovery benchmark results.
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | numpy~=1.23.5
2 | pandas~=1.5.3
3 | joblib~=1.2.0
4 | numba~=0.53.0
5 | scipy~=1.10.1
6 | tqdm~=4.62.3
7 | matplotlib~=3.6.3
8 | seaborn~=0.11.2
9 | daproli~=0.22
10 | statsmodels~=0.13.5
11 | astropy~=4.3.1
12 | six~=1.16.0
13 | stumpy~=1.11.0
14 | ruptures~=1.1.5
15 | scikit-learn~=0.24.2
--------------------------------------------------------------------------------
/src/README.md:
--------------------------------------------------------------------------------
1 | # Source Code
2 | In this folder, we store source codes for the anomaly detection, segmentation and motif discovery as well as the used window size selection procedures.
3 |
4 | - `anomaly_detection` contains the code for the anomaly detection algorithms
5 | - `motifs` contains the code for the motif discovery algorithms, in part taken from
6 | - https://github.com/jMotif/SAX
7 | - https://sites.google.com/site/timeseriesmotifsets/
8 | - `segmentation` contains the code the segmentation algorithms, partially taken from
9 | - https://sites.google.com/view/ts-parameter-free-clasp/
10 | - `window_size` contains the window size selection code, in part taken (and adapted) from
11 | - https://github.com/ariaghora/robust-period
12 | - https://github.com/akofke/autoperiod
13 | - https://sites.google.com/view/multi-window-finder/
14 | - https://sites.google.com/view/ts-parameter-free-clasp/
--------------------------------------------------------------------------------
/src/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ermshaua/window-size-selection/e247e2d05c0be1b59536420f5e979818d3ba2b79/src/__init__.py
--------------------------------------------------------------------------------
/src/anomaly_detection/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ermshaua/window-size-selection/e247e2d05c0be1b59536420f5e979818d3ba2b79/src/anomaly_detection/__init__.py
--------------------------------------------------------------------------------
/src/anomaly_detection/discord.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 |
3 | import stumpy
4 |
5 |
6 | def discord(ts, window_size, test_start):
7 | mp = stumpy.stump(ts, m=max(3, window_size))
8 | return test_start + np.argsort(mp[test_start:, 0])[-1]
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/anomaly_detection/isolation_forest.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 |
3 | from src.utils import sliding_window
4 | from sklearn.ensemble import IsolationForest
5 |
6 |
7 | def isolation_forest(ts, window_size, test_start):
8 | W = sliding_window(ts, max(3, window_size))
9 |
10 | est = IsolationForest().fit(W[:test_start-window_size+1,:])
11 | profile = est.score_samples(W[test_start:,:])
12 |
13 | return test_start + np.argmin(profile)
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/anomaly_detection/svm.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 |
3 | from src.utils import sliding_window
4 | from sklearn.linear_model import SGDOneClassSVM
5 |
6 |
7 | def svm(ts, window_size, test_start):
8 | W = sliding_window(ts, max(3, window_size))
9 |
10 | est = SGDOneClassSVM().fit(W[:test_start-window_size+1,:])
11 | profile = est.score_samples(W[test_start:,:])
12 |
13 | return test_start + np.argmin(profile)
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/data_loader.py:
--------------------------------------------------------------------------------
1 | import os, json
2 |
3 | import numpy as np
4 | import pandas as pd
5 | import daproli as dp
6 |
7 | from tqdm import tqdm
8 | from ast import literal_eval
9 | from os.path import exists
10 | from scipy.stats import zscore
11 |
12 |
13 | def load_tssb_dataset():
14 | desc_filename = "../datasets/TSSB/desc.txt"
15 | desc_file = []
16 |
17 | with open(desc_filename, 'r') as file:
18 | for line in file.readlines(): desc_file.append(line.split(","))
19 |
20 | df = []
21 |
22 | for row in desc_file:
23 | (ts_name, window_size), change_points = row[:2], row[2:]
24 |
25 | ts = np.loadtxt(fname=os.path.join('../datasets/TSSB/', ts_name + '.txt'),
26 | dtype=np.float64)
27 | df.append(
28 | (ts_name, int(window_size), np.array([int(_) for _ in change_points]), ts))
29 |
30 | return pd.DataFrame.from_records(df,
31 | columns=["name", "window_size", "change_points",
32 | "time_series"])
33 |
34 |
35 | def load_ucr_anomaly_dataset(selection=None, verbose=0, n_jobs=1):
36 | file_names = os.listdir("../datasets/UCRAnomaly/")
37 | file_names = dp.filter(lambda fn: fn.endswith(".txt"), file_names)
38 |
39 | if selection is None:
40 | selection = slice(len(file_names))
41 |
42 | if isinstance(selection, int):
43 | selection = slice(selection, selection + 1)
44 |
45 | def read_ts(file_name):
46 | file_name, _ = os.path.splitext(file_name)
47 | file_name = file_name.split("_")
48 | name_id, name, test_start, anomaly_start, anomaly_end = file_name[0], file_name[
49 | 3], file_name[4], file_name[5], file_name[6]
50 | ts = np.loadtxt(fname=os.path.join(
51 | f'../datasets/UCRAnomaly/{name_id}_UCR_Anomaly_{name}_{test_start}_{anomaly_start}_{anomaly_end}.txt'),
52 | dtype=np.float64).flatten()
53 |
54 | return int(name_id), name, int(test_start), int(anomaly_start), int(
55 | anomaly_end), ts
56 |
57 | df = dp.map(read_ts,
58 | tqdm(np.array(sorted(file_names, key=lambda s: int(s[:3])))[selection],
59 | disable=verbose < 1), ret_type=list, n_jobs=n_jobs)
60 | return pd.DataFrame.from_records(df, columns=["idx", "name", "test_start",
61 | "anomaly_start", "anomaly_end",
62 | "time_series"])
63 |
64 |
65 | ##################
66 | #### Motifs #####
67 | ##################
68 | def load_motifs_datasets(sampling_factor=10000):
69 | def resample(data, sampling_factor=10000):
70 | if len(data) > sampling_factor:
71 | factor = np.int32(len(data) / sampling_factor)
72 | data = data[::factor]
73 | return data
74 |
75 | def read_ground_truth(dataset):
76 | file = '../datasets/motifs/' + dataset + "_gt.csv"
77 | if (exists(file)):
78 | print(file)
79 | series = pd.read_csv(
80 | file, index_col=0,
81 | converters={1: literal_eval, 2: literal_eval, 3: literal_eval})
82 | return series
83 | return None
84 |
85 | full_path = '../datasets/motifs/'
86 | desc_filename = full_path+"desc.csv"
87 | desc_file = []
88 |
89 | with open(desc_filename, 'r') as file:
90 | for line in file.readlines(): desc_file.append(line.split(","))
91 |
92 | df = []
93 | for (ts_name, window_size) in desc_file:
94 | data = pd.read_csv(full_path + ts_name + ".csv", index_col=0).squeeze("columns")
95 | print("Dataset Original Length n: ", len(data))
96 |
97 | data = resample(data, sampling_factor)
98 | print("Dataset Sampled Length n: ", len(data))
99 |
100 | data[:] = zscore(data)
101 | gt = read_ground_truth(ts_name)
102 | df.append((ts_name, data.values, window_size, gt))
103 |
104 | return pd.DataFrame.from_records(df, columns=["name", "time_series", "window_size", "gt"])
105 |
--------------------------------------------------------------------------------
/src/motifs/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ermshaua/window-size-selection/e247e2d05c0be1b59536420f5e979818d3ba2b79/src/motifs/__init__.py
--------------------------------------------------------------------------------
/src/motifs/jars/emma.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ermshaua/window-size-selection/e247e2d05c0be1b59536420f5e979818d3ba2b79/src/motifs/jars/emma.jar
--------------------------------------------------------------------------------
/src/motifs/jars/latent_motifs.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ermshaua/window-size-selection/e247e2d05c0be1b59536420f5e979818d3ba2b79/src/motifs/jars/latent_motifs.jar
--------------------------------------------------------------------------------
/src/motifs/jars/set_finder.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ermshaua/window-size-selection/e247e2d05c0be1b59536420f5e979818d3ba2b79/src/motifs/jars/set_finder.jar
--------------------------------------------------------------------------------
/src/segmentation/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ermshaua/window-size-selection/e247e2d05c0be1b59536420f5e979818d3ba2b79/src/segmentation/__init__.py
--------------------------------------------------------------------------------
/src/segmentation/clasp/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ermshaua/window-size-selection/e247e2d05c0be1b59536420f5e979818d3ba2b79/src/segmentation/clasp/__init__.py
--------------------------------------------------------------------------------
/src/segmentation/clasp/clasp.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | import pandas as pd
3 |
4 | from src.segmentation.clasp.knn import iterative_knn
5 | from src.segmentation.clasp.scoring import binary_roc_auc_score
6 | from numba import njit, prange
7 |
8 |
9 | @njit(fastmath=True, cache=True)
10 | def _labels(knn_mask, split_idx, window_size):
11 | n_timepoints, k_neighbours = knn_mask.shape
12 |
13 | y_true = np.concatenate((
14 | np.zeros(split_idx, dtype=np.int64),
15 | np.ones(n_timepoints - split_idx, dtype=np.int64),
16 | ))
17 |
18 | knn_labels = np.zeros(shape=(k_neighbours, n_timepoints), dtype=np.int64)
19 |
20 | for i_neighbor in range(k_neighbours):
21 | neighbours = knn_mask[:, i_neighbor]
22 | knn_labels[i_neighbor] = y_true[neighbours]
23 |
24 | ones = np.sum(knn_labels, axis=0)
25 | zeros = k_neighbours - ones
26 | y_pred = np.asarray(ones > zeros, dtype=np.int64)
27 |
28 | exclusion_zone = np.arange(split_idx - window_size, split_idx)
29 | y_pred[exclusion_zone] = 1
30 |
31 | return y_true, y_pred
32 |
33 |
34 | @njit(fastmath=True, cache=False)
35 | def _profile(window_size, knn, score, offset):
36 | n_timepoints, _ = knn.shape
37 | profile = np.full(shape=n_timepoints, fill_value=-np.inf, dtype=np.float64)
38 | offset = max(10*window_size, offset)
39 |
40 | for split_idx in range(offset, n_timepoints - offset):
41 | y_true, y_pred = _labels(knn, split_idx, window_size)
42 |
43 | try:
44 | _score = score(y_true, y_pred)
45 |
46 | if not np.isnan(_score):
47 | profile[split_idx] = _score
48 | except:
49 | pass
50 |
51 | return profile
52 |
53 |
54 | class ClaSP:
55 |
56 | def __init__(self, window_size, k_neighbours=3, score=binary_roc_auc_score, offset=.05):
57 | self.window_size = window_size
58 | self.k_neighbours = k_neighbours
59 | self.score = score
60 | self.offset = offset
61 |
62 | def fit(self, time_series):
63 | return self
64 |
65 | def transform(self, time_series, interpolate=False):
66 | self.dist, self.knn = iterative_knn(time_series, self.window_size, self.k_neighbours)
67 |
68 | n_timepoints = self.knn.shape[0]
69 | offset = np.int64(n_timepoints * self.offset)
70 |
71 | profile = _profile(self.window_size, self.knn, self.score, offset)
72 |
73 | if interpolate:
74 | profile = pd.Series(profile).interpolate(limit_direction="both").to_numpy()
75 |
76 | return profile
77 |
78 | def fit_transform(self, time_series, interpolate=False):
79 | return self.fit(time_series).transform(time_series, interpolate=interpolate)
--------------------------------------------------------------------------------
/src/segmentation/clasp/ensemble_clasp.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | import pandas as pd
3 | import daproli as dp
4 |
5 | from src.segmentation.clasp.interval_knn import IntervalKneighbours
6 | from src.segmentation.clasp.scoring import binary_roc_auc_score
7 | from src.segmentation.clasp.clasp import _profile
8 |
9 |
10 | class ClaSPEnsemble:
11 |
12 | def __init__(self, window_size, n_iter=30, k_neighbours=3, score=binary_roc_auc_score, min_seg_size=None, interval_knn=None, interval=None, offset=.05, random_state=1379):
13 | self.window_size = window_size
14 | self.n_iter = n_iter
15 | self.k_neighbours = k_neighbours
16 | self.score = score
17 | self.min_seg_size = min_seg_size
18 | self.interval_knn = interval_knn
19 | self.interval = interval
20 | self.offset = offset
21 | self.random_state = random_state
22 |
23 | def fit(self, time_series):
24 | return self
25 |
26 | def _calculate_tcs(self, time_series):
27 | tcs = [(0, time_series.shape[0])]
28 | np.random.seed(self.random_state)
29 |
30 | while len(tcs) < self.n_iter and time_series.shape[0] > 3 * self.min_seg_size:
31 | lbound, area = np.random.choice(time_series.shape[0], 2, replace=True)
32 |
33 | if time_series.shape[0] - lbound < area:
34 | area = time_series.shape[0] - lbound
35 |
36 | ubound = lbound + area
37 | if ubound - lbound < 2 * self.min_seg_size: continue
38 | tcs.append((lbound, ubound))
39 |
40 | return np.asarray(tcs, dtype=np.int64)
41 |
42 | def _ensemble_profiles(self, time_series):
43 | self.tcs = self._calculate_tcs(time_series)
44 | _, self.knn = self.interval_knn.knn(self.interval, self.tcs)
45 |
46 | n_timepoints = self.knn.shape[0]
47 | offset = np.int64(n_timepoints * self.offset)
48 |
49 | profile = np.full(shape=n_timepoints, fill_value=-np.inf, dtype=np.float64) #
50 | bounds = np.full(shape=(n_timepoints, 3), fill_value=-1, dtype=np.int64)
51 |
52 | for idx, (lbound, ubound) in enumerate(self.tcs):
53 | tc_knn = self.knn[lbound:ubound, idx * self.k_neighbours:(idx + 1) * self.k_neighbours] - lbound
54 |
55 | tc_profile = _profile(self.window_size, tc_knn, self.score, offset)
56 | not_ninf = np.logical_not(tc_profile == -np.inf)
57 |
58 | tc = (ubound - lbound) / self.knn.shape[0]
59 | tc_profile[not_ninf] = (2 * tc_profile[not_ninf] + tc) / 3
60 |
61 | change_idx = profile[lbound:ubound] < tc_profile
62 | change_mask = np.logical_and(change_idx, not_ninf)
63 |
64 | profile[lbound:ubound][change_mask] = tc_profile[change_mask]
65 | bounds[lbound:ubound][change_mask] = np.array([idx, lbound, ubound])
66 |
67 | return profile, bounds
68 |
69 | def transform(self, time_series, interpolate=False):
70 | if self.min_seg_size is None:
71 | self.min_seg_size = int(max(10 * self.window_size, self.offset * time_series.shape[0]))
72 |
73 | if self.interval_knn is None:
74 | self.interval_knn = IntervalKneighbours(time_series, self.window_size, self.k_neighbours)
75 |
76 | if self.interval is None:
77 | self.interval = (0, time_series.shape[0])
78 |
79 | profile, self.bounds = self._ensemble_profiles(time_series)
80 |
81 | if interpolate:
82 | profile[np.isinf(profile)] = np.nan
83 | profile = pd.Series(profile).interpolate(limit_direction="both").to_numpy()
84 |
85 | return profile
86 |
87 | def fit_transform(self, time_series, interpolate=False):
88 | return self.fit(time_series).transform(time_series, interpolate=interpolate)
89 |
90 | def applc_tc(self, profile, change_point):
91 | idx, lbound, ubound = self.bounds[change_point]
92 |
93 | if lbound == -1:
94 | return None, None, None
95 |
96 | tc_profile = profile[lbound:ubound]
97 | tc_knn = self.knn[lbound:ubound, idx * self.k_neighbours:(idx + 1) * self.k_neighbours] - lbound
98 | tc_change_point = change_point - lbound
99 |
100 | return tc_profile, tc_knn, tc_change_point
--------------------------------------------------------------------------------
/src/segmentation/clasp/interval_knn.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | import numpy.fft as fft
3 | from numba import njit
4 |
5 |
6 | @njit(fastmath=True, cache=True)
7 | def _sliding_mean_std(time_series, window_size):
8 | # s = np.insert(np.cumsum(time_series), 0, 0)
9 | # sSq = np.insert(np.cumsum(time_series ** 2), 0, 0)
10 |
11 | s = np.concatenate((np.zeros(1, dtype=np.float64), np.cumsum(time_series)))
12 | sSq = np.concatenate((np.zeros(1, dtype=np.float64), np.cumsum(time_series ** 2)))
13 |
14 | segSum = s[window_size:] - s[:-window_size]
15 | segSumSq = sSq[window_size:] - sSq[:-window_size]
16 |
17 | movmean = segSum / window_size
18 | movstd = np.sqrt(1e-9 + segSumSq / window_size - (segSum / window_size) ** 2)
19 |
20 | return [movmean, movstd]
21 |
22 |
23 | def _sliding_dot(query, time_series):
24 | m = len(query)
25 | n = len(time_series)
26 |
27 | time_series_add = 0
28 | if n % 2 == 1:
29 | time_series = np.insert(time_series, 0, 0)
30 | time_series_add = 1
31 |
32 | q_add = 0
33 | if m % 2 == 1:
34 | query = np.insert(query, 0, 0)
35 | q_add = 1
36 |
37 | query = query[::-1]
38 | query = np.pad(query, (0, n - m + time_series_add - q_add), 'constant')
39 | trim = m - 1 + time_series_add
40 | dot_product = fft.irfft(fft.rfft(time_series) * fft.rfft(query))
41 | return dot_product[trim:]
42 |
43 |
44 | @njit(fastmath=True, cache=True)
45 | def find_knn(idx, k_neighbours, lbound, ubound, exclusion_radius=0):
46 | knns = list()
47 |
48 | for neigh_a in idx:
49 | if len(knns) == k_neighbours: break
50 | if neigh_a < lbound or neigh_a >= ubound: continue
51 |
52 | valid = True
53 |
54 | for neigh_b in knns:
55 | if np.abs(neigh_a - neigh_b) <= exclusion_radius:
56 | valid = False
57 | break
58 |
59 | if valid is True:
60 | knns.append(neigh_a)
61 |
62 | return np.array(knns)
63 |
64 |
65 | @njit(fastmath=True, cache=True)
66 | def argkmin(dist, k):
67 | args = np.zeros(shape=k, dtype=np.int64)
68 | vals = np.zeros(shape=k, dtype=np.float64)
69 |
70 | for idx in range(k):
71 | min_arg = np.nan
72 | min_val = np.inf
73 |
74 | for kdx, val in enumerate(dist):
75 | if val < min_val:
76 | min_val = val
77 | min_arg = kdx
78 |
79 | min_arg = np.int64(min_arg)
80 |
81 | args[idx] = min_arg
82 | vals[idx] = min_val
83 |
84 | dist[min_arg] = np.inf
85 |
86 | dist[args] = vals
87 | return args
88 |
89 |
90 | @njit(fastmath=True, cache=True)
91 | def _iterative_knn(time_series, window_size, k_neighbours, tcs, dot_first):
92 | l = len(time_series) - window_size + 1
93 | exclusion_radius = np.int64(window_size / 2)
94 |
95 | knns = np.zeros(shape=(l, len(tcs) * k_neighbours), dtype=np.int64)
96 | dists = np.zeros(shape=(l, len(tcs) * k_neighbours), dtype=np.float64)
97 |
98 | dot_prev = None
99 | means, stds = _sliding_mean_std(time_series, window_size)
100 |
101 | for order in range(0, l):
102 | if order == 0:
103 | dot_rolled = dot_first
104 | else:
105 | dot_rolled = np.roll(dot_prev, 1) + time_series[order + window_size - 1] * time_series[window_size - 1:l + window_size] - time_series[order - 1] * np.roll(time_series[:l], 1)
106 | dot_rolled[0] = dot_first[order]
107 |
108 | x_mean = means[order]
109 | x_std = stds[order]
110 |
111 | # dist is squared
112 | dist = 2 * window_size * (1 - (dot_rolled - window_size * means * x_mean) / (window_size * stds * x_std))
113 |
114 | # self-join: exclusion zone
115 | trivialMatchRange = (
116 | int(max(0, order - np.round(exclusion_radius, 0))),
117 | int(min(order + np.round(exclusion_radius + 1, 0), l))
118 | )
119 |
120 | dist[trivialMatchRange[0]:trivialMatchRange[1]] = np.max(dist)
121 | # idx = np.argsort(dist, kind="mergesort") # #
122 |
123 | for kdx, (lbound, ubound) in enumerate(tcs):
124 | if order < lbound or order >= ubound: continue
125 |
126 | tc_nn = lbound + argkmin(dist[lbound:ubound], k_neighbours)
127 | # tc_nn = find_knn(idx, k_neighbours, lbound, ubound, exclusion_radius=0)
128 |
129 | knns[order, kdx * k_neighbours:(kdx + 1) * k_neighbours] = tc_nn
130 | dists[order, kdx * k_neighbours:(kdx + 1) * k_neighbours] = dist[tc_nn]
131 |
132 | dot_prev = dot_rolled
133 |
134 | return dists, knns
135 |
136 |
137 | class IntervalKneighbours:
138 |
139 | def __init__(self, time_series, window_size, k_neighbours):
140 | self.time_series = time_series
141 | self.window_size = window_size
142 | self.k_neighbours = k_neighbours
143 | self.knns = [set() for _ in range(time_series.shape[0])]
144 |
145 | def knn(self, interval, tcs):
146 | interval_start, interval_end = interval
147 | time_series = self.time_series[interval_start:interval_end]
148 |
149 | dot_first = _sliding_dot(time_series[:self.window_size], time_series)
150 | local_dists, local_knns = _iterative_knn(time_series, self.window_size, self.k_neighbours, tcs, dot_first)
151 |
152 | return local_dists, local_knns
--------------------------------------------------------------------------------
/src/segmentation/clasp/knn.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | import numpy.fft as fft
3 | from numba import njit
4 |
5 |
6 | @njit(fastmath=True, cache=True)
7 | def _sliding_mean_std(time_series, window_size):
8 | # s = np.insert(np.cumsum(time_series), 0, 0)
9 | # sSq = np.insert(np.cumsum(time_series ** 2), 0, 0)
10 |
11 | s = np.concatenate((np.zeros(1, dtype=np.float64), np.cumsum(time_series)))
12 | sSq = np.concatenate((np.zeros(1, dtype=np.float64), np.cumsum(time_series ** 2)))
13 |
14 | segSum = s[window_size:] - s[:-window_size]
15 | segSumSq = sSq[window_size:] - sSq[:-window_size]
16 |
17 | movmean = segSum / window_size
18 | movstd = np.sqrt(1e-9 + segSumSq / window_size - (segSum / window_size) ** 2)
19 |
20 | return [movmean, movstd]
21 |
22 |
23 | def _sliding_dot(query, time_series):
24 | m = len(query)
25 | n = len(time_series)
26 |
27 | time_series_add = 0
28 | if n % 2 == 1:
29 | time_series = np.insert(time_series, 0, 0)
30 | time_series_add = 1
31 |
32 | q_add = 0
33 | if m % 2 == 1:
34 | query = np.insert(query, 0, 0)
35 | q_add = 1
36 |
37 | query = query[::-1]
38 | query = np.pad(query, (0, n - m + time_series_add - q_add), 'constant')
39 | trim = m - 1 + time_series_add
40 | dot_product = fft.irfft(fft.rfft(time_series) * fft.rfft(query))
41 | return dot_product[trim:]
42 |
43 |
44 | @njit(fastmath=True, cache=True)
45 | def find_knn(idx, k_neighbours, lbound, ubound, exclusion_radius=0):
46 | knns = list()
47 |
48 | for neigh_a in idx:
49 | if len(knns) == k_neighbours: break
50 | if neigh_a < lbound or neigh_a >= ubound: continue
51 |
52 | valid = True
53 |
54 | for neigh_b in knns:
55 | if np.abs(neigh_a - neigh_b) <= exclusion_radius:
56 | valid = False
57 | break
58 |
59 | if valid is True:
60 | knns.append(neigh_a)
61 |
62 | return np.array(knns)
63 |
64 |
65 | @njit(fastmath=True, cache=True)
66 | def argkmin(dist, k):
67 | args = np.zeros(shape=k, dtype=np.int64)
68 | vals = np.zeros(shape=k, dtype=np.float64)
69 |
70 | for idx in range(k):
71 | min_arg = np.nan
72 | min_val = np.inf
73 |
74 | for kdx, val in enumerate(dist):
75 | if val < min_val:
76 | min_val = val
77 | min_arg = kdx
78 |
79 | min_arg = np.int64(min_arg)
80 |
81 | args[idx] = min_arg
82 | vals[idx] = min_val
83 |
84 | dist[min_arg] = np.inf
85 |
86 | dist[args] = vals
87 | return args
88 |
89 |
90 | # @njit(fastmath=True, cache=True)
91 | def _iterative_knn(time_series, window_size, k_neighbours, tcs, dot_first):
92 | l = len(time_series) - window_size + 1
93 | exclusion_radius = np.int64(window_size / 2)
94 |
95 | if tcs is None: tcs = [(0, time_series.shape[0])]
96 |
97 | knns = np.zeros(shape=(l, len(tcs) * k_neighbours), dtype=np.int64)
98 | dists = np.zeros(shape=(l, len(tcs) * k_neighbours), dtype=np.float64)
99 |
100 | dot_prev = None
101 | means, stds = _sliding_mean_std(time_series, window_size)
102 |
103 | for order in range(0, l):
104 | if order == 0:
105 | dot_rolled = dot_first
106 | else:
107 | dot_rolled = np.roll(dot_prev, 1) + time_series[order + window_size - 1] * time_series[window_size - 1:l + window_size] - time_series[order - 1] * np.roll(time_series[:l], 1)
108 | dot_rolled[0] = dot_first[order]
109 |
110 | x_mean = means[order]
111 | x_std = stds[order]
112 |
113 | # dist is squared
114 | dist = 2 * window_size * (1 - (dot_rolled - window_size * means * x_mean) / (window_size * stds * x_std))
115 |
116 | # self-join: exclusion zone
117 | trivialMatchRange = (
118 | int(max(0, order - np.round(exclusion_radius, 0))),
119 | int(min(order + np.round(exclusion_radius + 1, 0), l))
120 | )
121 |
122 | dist[trivialMatchRange[0]:trivialMatchRange[1]] = np.max(dist)
123 | # idx = np.argsort(dist, kind="mergesort") # #
124 |
125 | for kdx, (lbound, ubound) in enumerate(tcs):
126 | if order < lbound or order >= ubound: continue
127 | tc_nn = lbound + argkmin(dist[lbound:ubound], k_neighbours)
128 |
129 | # tc_nn = find_knn(idx, k_neighbours, lbound, ubound, exclusion_radius=0)
130 |
131 | knns[order, kdx * k_neighbours:(kdx + 1) * k_neighbours] = tc_nn
132 | dists[order, kdx * k_neighbours:(kdx + 1) * k_neighbours] = dist[tc_nn]
133 |
134 | dot_prev = dot_rolled
135 |
136 | return dists, knns
137 |
138 |
139 | def iterative_knn(time_series, window_size, k_neighbours, tcs=None, verbose=0):
140 | dot_first = _sliding_dot(time_series[:window_size], time_series)
141 | return _iterative_knn(time_series, window_size, k_neighbours, tcs, dot_first)
--------------------------------------------------------------------------------
/src/segmentation/clasp/penalty.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 |
3 | from src.segmentation.clasp.clasp import _labels
4 | from scipy.stats import ranksums
5 |
6 |
7 | def _gini(knn, change_point, window_size):
8 | _, y_pred = _labels(knn, change_point, window_size)
9 |
10 | gini = 0
11 | for label in (0,1): gini += np.square(np.sum(y_pred == label) / y_pred.shape[0])
12 | return 1 - gini
13 |
14 |
15 | def _gini_part(knn, change_point, window_size):
16 | _, y_pred = _labels(knn, change_point, window_size)
17 |
18 | left_y_pred = y_pred[:change_point]
19 | left_gini = 0
20 | for label in (0,1): left_gini += np.square(np.sum(left_y_pred == label) / left_y_pred.shape[0])
21 | left_gini = 1 - left_gini
22 |
23 | right_y_pred = y_pred[change_point:]
24 | right_gini = 0
25 | for label in (0, 1): right_gini += np.square(np.sum(right_y_pred == label) / right_y_pred.shape[0])
26 | right_gini = 1 - right_gini
27 |
28 | return (left_y_pred.shape[0] / y_pred.shape[0]) * left_gini + (right_y_pred.shape[0] / y_pred.shape[0]) * right_gini
29 |
30 |
31 | def gini_gain_test(profile, knn, change_point, window_size, threshold=.02):
32 | gini = _gini(knn, change_point, window_size) - _gini_part(knn, change_point, window_size)
33 | return gini >= threshold
34 |
35 |
36 | def rank_sums_test(profile, knn, change_point, window_size, threshold=1e-15):
37 | _, y_pred = _labels(knn, change_point, window_size)
38 | _, p = ranksums(y_pred[:change_point], y_pred[change_point:])
39 | return p <= threshold
40 |
41 |
42 | def threshold_test(profile, knn, change_point, window_size, min_score=.75):
43 | return profile[change_point] >= min_score
--------------------------------------------------------------------------------
/src/segmentation/clasp/scoring.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 |
3 | from numba import njit
4 |
5 |
6 | @njit(fastmath=True, cache=True)
7 | def binary_accuracy_score(y_true, y_pred):
8 | tptn = np.sum(y_true == y_pred)
9 | tptnfpfn = y_true.shape[0]
10 | return np.float64(tptn / tptnfpfn)
11 |
12 |
13 | @njit(fastmath=True, cache=True)
14 | def binary_f1_score(y_true, y_pred):
15 | f1_scores = np.zeros(shape=2, dtype=np.float64)
16 |
17 | for label in (0,1):
18 | tp = np.sum(np.logical_and(y_true == label, y_pred == label))
19 | fp = np.sum(np.logical_and(y_true != label, y_pred == label))
20 | fn = np.sum(np.logical_and(y_true == label, y_pred != label))
21 |
22 | pr = tp / (tp + fp)
23 | re = tp / (tp + fn)
24 |
25 | f1 = 2 * (pr * re) / (pr + re)
26 |
27 | f1_scores[label] = f1
28 |
29 | return np.mean(f1_scores)
30 |
31 |
32 | @njit(fastmath=True, cache=True)
33 | def binary_roc_auc_score(y_score, y_true):
34 | # make y_true a boolean vector
35 | y_true = (y_true == 1)
36 |
37 | # sort scores and corresponding truth values (y_true is sorted by design)
38 | desc_score_indices = np.arange(y_score.shape[0])[::-1]
39 |
40 | y_score = y_score[desc_score_indices]
41 | y_true = y_true[desc_score_indices]
42 |
43 | # y_score typically has many tied values. Here we extract
44 | # the indices associated with the distinct values. We also
45 | # concatenate a value for the end of the curve.
46 | distinct_value_indices = np.where(np.diff(y_score))[0]
47 | threshold_idxs = np.concatenate((
48 | distinct_value_indices,
49 | np.array([y_true.size - 1])
50 | ))
51 |
52 | # accumulate the true positives with decreasing threshold
53 | tps = np.cumsum(y_true)[threshold_idxs]
54 | fps = 1 + threshold_idxs - tps
55 |
56 | tps = np.concatenate((np.array([0]), tps))
57 | fps = np.concatenate((np.array([0]), fps))
58 |
59 | if fps[-1] <= 0 or tps[-1] <= 0:
60 | return np.nan
61 |
62 | fpr = fps / fps[-1]
63 | tpr = tps / tps[-1]
64 |
65 | if fpr.shape[0] < 2:
66 | return np.nan
67 |
68 | direction = 1
69 | dx = np.diff(fpr)
70 |
71 | if np.any(dx < 0):
72 | if np.all(dx <= 0): direction = -1
73 | else: return np.nan
74 |
75 | area = direction * np.trapz(tpr, fpr)
76 | return area
--------------------------------------------------------------------------------
/src/segmentation/clasp/segmentation.py:
--------------------------------------------------------------------------------
1 | import warnings
2 | from queue import PriorityQueue
3 |
4 | import numpy as np
5 | import pandas as pd
6 |
7 | from src.segmentation.clasp.ensemble_clasp import ClaSPEnsemble
8 | from src.segmentation.clasp.penalty import rank_sums_test
9 | from src.segmentation.clasp.scoring import binary_roc_auc_score
10 |
11 |
12 | def segmentation(time_series, window_size, n_change_points=None, min_seg_size=None, penalty=rank_sums_test,
13 | k_neighbours=3, n_iter=30, score=binary_roc_auc_score, offset=.05, **penalty_args):
14 | warnings.warn(
15 | "This code is only for reproducibility. If you want to use ClaSP in your scientific publication or application, please use the updated and maintained claspy Python package: https://github.com/ermshaua/claspy")
16 |
17 | queue = PriorityQueue()
18 |
19 | window_size = max(3, window_size)
20 |
21 | if min_seg_size is None:
22 | min_seg_size = int(max(10 * window_size, offset * time_series.shape[0]))
23 |
24 | if n_change_points is None:
25 | penalize = True
26 | n_change_points = time_series.shape[0]
27 | else:
28 | penalize = False
29 |
30 | clasp = ClaSPEnsemble(
31 | window_size=window_size,
32 | k_neighbours=k_neighbours,
33 | n_iter=n_iter,
34 | score=score,
35 | offset=offset,
36 | min_seg_size=min_seg_size,
37 | )
38 |
39 | profile = clasp.fit_transform(time_series)
40 | change_point = np.argmax(profile)
41 | global_score = np.max(profile)
42 |
43 | tc_profile, tc_knn, tc_change_point = clasp.applc_tc(profile, change_point)
44 |
45 | if penalize is False or (
46 | tc_profile is not None and penalty(tc_profile, tc_knn, tc_change_point, window_size, **penalty_args)):
47 | queue.put((-global_score, (np.arange(time_series.shape[0]).tolist(), profile, change_point, global_score)))
48 |
49 | change_points = []
50 | scores = []
51 |
52 | for idx in range(n_change_points):
53 | # happens if no valid change points exist anymore
54 | if queue.empty() is True: break
55 |
56 | priority, (local_range, local_profile, change_point, local_score) = queue.get()
57 |
58 | if priority != 0 and _cp_valid(change_point, change_points, time_series.shape[0], min_seg_size):
59 | change_points.append(change_point)
60 | scores.append(local_score)
61 |
62 | ind = np.asarray(local_range[:-window_size + 1], dtype=np.int64)
63 | profile[ind] = np.max([profile[ind], local_profile], axis=0)
64 |
65 | if idx == n_change_points - 1 or len(change_points) == n_change_points:
66 | break
67 |
68 | left_range = np.arange(local_range[0], change_point).tolist()
69 | right_range = np.arange(change_point, local_range[-1]).tolist()
70 |
71 | for local_range in (left_range, right_range):
72 | _local_segmentation(
73 | queue,
74 | time_series,
75 | window_size,
76 | clasp.interval_knn,
77 | profile,
78 | local_range,
79 | change_points,
80 | k_neighbours,
81 | n_iter,
82 | score,
83 | min_seg_size,
84 | offset,
85 | penalize,
86 | penalty,
87 | penalty_args,
88 | )
89 |
90 | change_points, scores = np.array(change_points), np.array(scores)
91 |
92 | profile[np.isinf(profile)] = np.nan
93 | profile = pd.Series(profile).interpolate(limit_direction="both").to_numpy()
94 |
95 | return profile, window_size, change_points, scores
96 |
97 |
98 | def _cp_valid(candidate, change_points, n_timepoints, min_seg_size):
99 | for change_point in [0] + change_points + [n_timepoints]:
100 | left_begin = max(0, change_point - min_seg_size)
101 | right_end = min(n_timepoints, change_point + min_seg_size)
102 |
103 | if candidate in range(left_begin, right_end):
104 | return False
105 |
106 | return True
107 |
108 |
109 | def _local_segmentation(queue, time_series, window_size, interval_knn, profile, ts_range, change_points, k_neighbours,
110 | n_iter, score, min_seg_size, offset, penalize, penalty, penalty_args):
111 | if len(ts_range) < 2 * min_seg_size: return
112 | n_timepoints = time_series.shape[0]
113 |
114 | # compute local profile and change point
115 | local_clasp = ClaSPEnsemble(
116 | window_size=window_size,
117 | k_neighbours=k_neighbours,
118 | n_iter=n_iter,
119 | score=score,
120 | interval_knn=interval_knn,
121 | interval=(ts_range[0], ts_range[-1] + 1),
122 | offset=offset,
123 | min_seg_size=min_seg_size,
124 | )
125 |
126 | local_profile = local_clasp.fit_transform(time_series[ts_range])
127 | local_change_point = np.argmax(local_profile)
128 | local_score = local_profile[local_change_point]
129 |
130 | global_change_point = ts_range[0] + local_change_point
131 | global_score = profile[global_change_point]
132 |
133 | # check if change point is a trivial match
134 | if not _cp_valid(global_change_point, change_points, n_timepoints, min_seg_size):
135 | return
136 |
137 | tc_profile, tc_knn, tc_change_point = local_clasp.applc_tc(local_profile, local_change_point)
138 |
139 | # apply penalty checks
140 | if penalize is False or (
141 | tc_profile is not None and penalty(tc_profile, tc_knn, tc_change_point, window_size, **penalty_args)):
142 | queue.put((-local_score, [ts_range, local_profile, global_change_point, local_score]))
143 |
--------------------------------------------------------------------------------
/src/segmentation/floss.py:
--------------------------------------------------------------------------------
1 | import stumpy
2 |
3 |
4 | def floss(ts, window_size, n_cps, return_cac=False):
5 | mp = stumpy.stump(ts, m=max(window_size, 3))
6 | cac, cps = stumpy.fluss(mp[:, 1], L=window_size, n_regimes=n_cps+1)
7 |
8 | if return_cac is True:
9 | return cac, cps
10 |
11 | return cps
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/segmentation/window.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 |
3 | import ruptures as rpt
4 |
5 |
6 | def window(ts, window_size, cost_func="mahalanobis", n_cps=None, offset=0.05):
7 | transformer = rpt.Window(width=max(window_size, 3), model=cost_func, min_size=int(ts.shape[0] * offset)).fit(ts)
8 | return np.array(transformer.predict(n_bkps=n_cps)[:-1], dtype=np.int64)
9 |
10 |
--------------------------------------------------------------------------------
/src/utils.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 |
3 |
4 | def sliding_window(time_series, window):
5 | shape = time_series.shape[:-1] + (time_series.shape[-1] - window + 1, window)
6 | strides = time_series.strides + (time_series.strides[-1],)
7 | return np.lib.stride_tricks.as_strided(time_series, shape=shape, strides=strides)
--------------------------------------------------------------------------------
/src/window_size/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ermshaua/window-size-selection/e247e2d05c0be1b59536420f5e979818d3ba2b79/src/window_size/__init__.py
--------------------------------------------------------------------------------
/src/window_size/autoperiod.py:
--------------------------------------------------------------------------------
1 | # coding=utf-8
2 | from __future__ import division, print_function, absolute_import
3 |
4 | import math
5 |
6 | import numpy as np
7 | import scipy
8 | from astropy.timeseries import LombScargle
9 | from scipy.signal import fftconvolve
10 | from scipy.stats import linregress
11 | from scipy import integrate
12 | from six.moves import range
13 |
14 |
15 | class Autoperiod(object):
16 | def __init__(self, times, values, plotter=None, threshold_method='mc', mc_iterations=40, confidence_level=.9):
17 |
18 | # convert absolute times to time differences from start timestamp
19 | self.times = times - times[0] if times[0] != 0 else times
20 | self.values = values
21 | self.plotter = plotter
22 | self.acf = self.autocorrelation(values)
23 | # normalize acf
24 | self.acf /= np.max(self.acf)
25 | self.acf *= 100
26 |
27 | self.time_span = self.times[-1] - self.times[0]
28 | self.time_interval = self.times[1] - self.times[0]
29 |
30 | freqs, self.powers = LombScargle(self.times, self.values).autopower(
31 | minimum_frequency=1 / self.time_span,
32 | maximum_frequency=1 / (self.time_interval * 2),
33 | normalization='psd'
34 | )
35 | self.periods = 1 / freqs
36 |
37 | self._power_norm_factor = 1 / (2 * np.var(self.values - np.mean(self.values)))
38 | # double the power, since the astropy lomb-scargle implementation halves it during the psd normalization
39 | self.powers = 2 * self.powers * self._power_norm_factor
40 |
41 | self._threshold_method = threshold_method
42 | self._mc_iterations = mc_iterations
43 | self._confidence_level = confidence_level
44 | self._power_threshold = self._get_power_threshold()
45 |
46 | self._period_hints = self._get_period_hints()
47 |
48 | period = None
49 | is_valid = False
50 | for i, p in self._period_hints:
51 | is_valid, period = self.validate_hint(i)
52 | if is_valid:
53 | break
54 |
55 | self._period = None
56 | self._sinwave = None
57 |
58 | if period and is_valid:
59 | self._period = period
60 |
61 | phase_shift = self.times[np.argmax(self.values)]
62 | amplitude = np.max(values) / 2
63 | self._sinwave = np.cos(2 * np.pi / self._period * (self.times - phase_shift)) * amplitude + amplitude
64 |
65 | if self.plotter:
66 | self.plotter.plot_timeseries(self.times, self.values)
67 | self.plotter.plot_acf(self.times, self.acf)
68 | if self._period:
69 | self.plotter.plot_sinwave(self.times, self._sinwave)
70 | self.plotter.plot_area_ratio(*self.period_area())
71 |
72 | @property
73 | def period(self):
74 | return self._period
75 |
76 | def period_blocks(self):
77 | period_region = self._sinwave > (np.max(self._sinwave) / 2)
78 |
79 | # An array of indices of the cutoff points for the period blocks, i.e. where it goes from
80 | # "on-period" to "off-period"
81 | period_cutoff_indices = np.where(period_region[:-1] != period_region[1:])[0] + 1
82 |
83 | # array([[times],
84 | # [values]])
85 | timeseries = np.stack((self.times, self.values))
86 |
87 | period_blocks = np.array_split(timeseries, period_cutoff_indices, axis=1)
88 |
89 | on_period_blocks = period_blocks[::2] if period_region[0] else period_blocks[1::2]
90 | off_period_blocks = period_blocks[1::2] if period_region[0] else period_blocks[::2]
91 |
92 | return on_period_blocks, off_period_blocks
93 |
94 | def period_block_areas(self):
95 | on_period_blocks, off_period_blocks = self.period_blocks()
96 | on_block_areas = np.array([scipy.integrate.trapz(block[1], x=block[0]) for block in on_period_blocks])
97 | off_block_areas = np.array([scipy.integrate.trapz(block[1], x=block[0]) for block in off_period_blocks])
98 | return on_block_areas, off_block_areas
99 |
100 | def period_area(self):
101 | period_region = self._sinwave > (np.max(self._sinwave) / 2)
102 |
103 | on_period_area = integrate.trapz(self.values[period_region], self.times[period_region])
104 | off_period_area = integrate.trapz(self.values[~period_region], self.times[~period_region])
105 |
106 | return on_period_area, off_period_area
107 |
108 | @property
109 | def phase_shift_guess(self):
110 | return self.times[np.argmax(self.values)]
111 |
112 | @property
113 | def threshold_method(self):
114 | return self._threshold_method
115 |
116 | @threshold_method.setter
117 | def threshold_method(self, method):
118 | self._threshold_method = method
119 | self._power_threshold = self._get_power_threshold()
120 | self._threshold_method = method
121 |
122 | def _get_period_hints(self):
123 | period_hints = []
124 |
125 | total_periods = len(self.periods)
126 | for i, period in enumerate(self.periods):
127 | if self.powers[i] > self._power_threshold and self.time_span / 2 > period > 2 * self.time_interval:
128 | if i < (total_periods - 2) and i > 2:
129 | period_hints.append((i, period))
130 |
131 | period_hints = sorted(period_hints, key=lambda p: self.powers[p[0]], reverse=True)
132 |
133 | if self.plotter:
134 | self.plotter.plot_periodogram(self.periods, self.powers, period_hints, self._power_threshold,
135 | self.time_span / 2)
136 |
137 | return period_hints
138 |
139 | def _get_power_threshold(self):
140 | if self.threshold_method == 'mc':
141 | return self._mc_threshold()
142 | elif self.threshold_method == 'stat':
143 | return self._stat_threshold()
144 | else:
145 | raise ValueError("Method must be one of 'mc', 'stat'")
146 |
147 | def _mc_threshold(self):
148 | max_powers = []
149 | shuf = np.copy(self.values)
150 | for _ in range(self._mc_iterations):
151 | np.random.shuffle(shuf)
152 | _, powers = LombScargle(self.times, shuf).autopower(normalization='psd')
153 | max_powers.append(np.max(powers))
154 |
155 | max_powers.sort()
156 | return max_powers[int(len(max_powers) * .99)] * self._power_norm_factor
157 |
158 | def _stat_threshold(self):
159 | return -1 * math.log(1 - math.pow(self._confidence_level, 1 / self.powers.size))
160 |
161 | def validate_hint(self, period_idx):
162 | search_min, search_max = self._get_acf_search_range(period_idx)
163 |
164 | min_err = float("inf")
165 | t_split = None
166 | min_slope1 = 0
167 | min_slope2 = 0
168 | for t in range(search_min + 1, search_max):
169 | seg1_x = self.times[search_min:t + 1]
170 | seg1_y = self.acf[search_min:t + 1]
171 | seg2_x = self.times[t:search_max + 1]
172 | seg2_y = self.acf[t:search_max + 1]
173 |
174 | slope1, c1, _, _, stderr1 = linregress(seg1_x, seg1_y)
175 | slope2, c2, _, _, stderr2 = linregress(seg2_x, seg2_y)
176 |
177 | if stderr1 + stderr2 < min_err and seg1_x.size > 2 and seg2_x.size > 2:
178 | min_err = stderr1 + stderr2
179 | t_split = t
180 | min_slope1 = slope1
181 | min_slope2 = slope2
182 | min_c1 = c1
183 | min_c2 = c2
184 | min_stderr1 = stderr1
185 | min_stderr2 = stderr2
186 |
187 | angle1 = np.arctan(min_slope1) / (np.pi / 2)
188 | angle2 = np.arctan(min_slope2) / (np.pi / 2)
189 | valid = min_slope1 > min_slope2 and not np.isclose(np.abs(angle1 - angle2), 0, atol=0.01)
190 | window = self.acf[search_min:search_max + 1]
191 | peak_idx = np.argmax(window) + search_min
192 |
193 | if self.plotter and (valid or self.plotter.verbose):
194 | self.plotter.plot_acf_validation(
195 | self.times,
196 | self.acf,
197 | self.times[search_min:t_split + 1], min_slope1, min_c1, min_stderr1,
198 | self.times[t_split:search_max + 1], min_slope2, min_c2, min_stderr2,
199 | t_split, peak_idx
200 | )
201 |
202 | return valid, self.times[peak_idx]
203 |
204 | def _get_acf_search_range(self, period_idx):
205 | min_period = 0.5 * (self.periods[period_idx + 1] + self.periods[period_idx + 2])
206 | max_period = 0.5 * (self.periods[period_idx - 1] + self.periods[period_idx - 2])
207 |
208 | min_idx = self.closest_index(min_period, self.times)
209 | max_idx = self.closest_index(max_period, self.times)
210 | while max_idx - min_idx + 1 < 6:
211 | if min_idx > 0:
212 | min_idx -= 1
213 | if max_idx < self.times.size - 1:
214 | max_idx += 1
215 |
216 | return min_idx, max_idx
217 |
218 | @staticmethod
219 | def autocorrelation(values):
220 | acf = fftconvolve(values, values[::-1], mode='full')
221 | return acf[acf.size // 2:]
222 |
223 | @staticmethod
224 | def closest_index(value, arr):
225 | return np.abs(arr - value).argmin()
226 |
227 |
228 | def autoperiod(ts):
229 | try:
230 | window_size = Autoperiod(np.arange(ts.shape[0]), ts).period
231 | return np.int64(window_size)
232 | except:
233 | print(f"Could not determine window size, using default value: -1")
234 | return -1
--------------------------------------------------------------------------------
/src/window_size/mwf.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 |
3 |
4 | def movmean(ts, w):
5 | """
6 | # faster solution of moving ave
7 | moving_avg = np.cumsum(ts, dtype=float)
8 | moving_avg[w:] = moving_avg[w:] - moving_avg[:-w]
9 | return moving_avg[w-1:] / w
10 | """
11 | moving_avg = np.cumsum(ts, dtype=float)
12 | moving_avg[w:] = moving_avg[w:] - moving_avg[:-w]
13 | return moving_avg[w - 1:] / w
14 |
15 |
16 | def mwf(ts, lbound=10, ubound=1_000):
17 | """
18 | finidng appropriate window size using movemean
19 | """
20 | all_averages = []
21 | window_sizes = []
22 |
23 | for w in range(lbound, ubound, 1):
24 | movingAvg = np.array(movmean(ts, w))
25 | all_averages.append(movingAvg)
26 | window_sizes.append(w)
27 |
28 | movingAvgResiduals = []
29 |
30 | for i, w in enumerate(window_sizes):
31 | moving_avg = all_averages[i][:len(all_averages[-1])]
32 | movingAvgResidual = np.log(abs(moving_avg - (moving_avg).mean()).sum())
33 | movingAvgResiduals.append(movingAvgResidual)
34 |
35 | b = (np.diff(np.sign(np.diff(movingAvgResiduals))) > 0).nonzero()[0] + 1 # local min
36 |
37 | if len(b) == 0: return -1
38 | if len(b) < 3: return window_sizes[b[0]]
39 |
40 | reswin = np.array([window_sizes[b[i]] / (i + 1) for i in range(3)])
41 | w = np.mean(reswin)
42 |
43 | # w = 0.8 * reswin[0] + 0.15 * reswin[1] + 0.05 * reswin[2]
44 | # conf = np.std(reswin) / np.sqrt(3)
45 |
46 | return int(w)
--------------------------------------------------------------------------------
/src/window_size/period.py:
--------------------------------------------------------------------------------
1 | import math
2 |
3 | import numpy as np
4 | import daproli as dp
5 |
6 | from statsmodels.tsa.stattools import acf
7 | from scipy.signal import find_peaks
8 |
9 |
10 | def dominant_fourier_freq(ts, min_size=10, max_size=1000): #
11 | fourier = np.fft.fft(ts)
12 | freq = np.fft.fftfreq(ts.shape[0], 1)
13 |
14 | magnitudes = []
15 | window_sizes = []
16 |
17 | for coef, freq in zip(fourier, freq):
18 | if coef and freq > 0:
19 | window_size = int(1 / freq)
20 | mag = math.sqrt(coef.real * coef.real + coef.imag * coef.imag)
21 |
22 | if window_size >= min_size and window_size < max_size:
23 | window_sizes.append(window_size)
24 | magnitudes.append(mag)
25 |
26 | return window_sizes[np.argmax(magnitudes)]
27 |
28 |
29 | def highest_autocorrelation(ts, min_size=10, max_size=1000):
30 | acf_values = acf(ts, fft=True, nlags=int(ts.shape[0]/2))
31 |
32 | peaks, _ = find_peaks(acf_values)
33 | peaks = peaks[np.logical_and(peaks >= min_size, peaks < max_size)]
34 | corrs = acf_values[peaks]
35 |
36 | if peaks.shape[0] == 0:
37 | return -1
38 |
39 | return peaks[np.argmax(corrs)]
--------------------------------------------------------------------------------
/src/window_size/robustperiod/__init__.py:
--------------------------------------------------------------------------------
1 | from .robustperiod import *
--------------------------------------------------------------------------------
/src/window_size/robustperiod/fisher.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | import scipy
3 |
4 |
5 | def choose(n, k):
6 | """
7 | A fast way to calculate binomial coefficients by Andrew Dalke (contrib).
8 | """
9 | if 0 <= k <= n:
10 | ntok = 1
11 | ktok = 1
12 | for t in range(1, min(k, n - k) + 1):
13 | ntok *= n
14 | ktok *= t
15 | n -= 1
16 | return ntok // ktok
17 | else:
18 | return 0
19 |
20 |
21 | def p_val_g_stat(g0, N, method='author'):
22 | if g0 == 0:
23 | g0 = 1e-8
24 |
25 | k1 = int(np.floor(1/g0))
26 | terms = np.arange(1, k1+1, dtype='int32')
27 | # Robust Period Equation
28 |
29 | fac = np.math.factorial
30 | binom = scipy.special.binom
31 |
32 | def event_term(k, N=N, g0=g0):
33 | return (-1)**(k-1) * binom(N, k) * (1-k*g0)**(N-1)
34 | # R fisher test equation
35 |
36 | def r_event_term(k, N, g0):
37 | temp_x = float(choose(N, k))
38 | temp_y = 1-k*g0
39 | if temp_y == 0:
40 | temp_y += 1e-8
41 | temp_z = np.log(temp_x) + (N-1) * np.log(temp_y)
42 | return (-1)**(k-1) * np.exp(temp_z)
43 |
44 | if method == 'author':
45 | vect_event_term = np.vectorize(event_term)
46 | else:
47 | vect_event_term = np.vectorize(r_event_term)
48 |
49 | pval = sum(vect_event_term(terms, N, g0))
50 | if pval > 1:
51 | pval = 1
52 | return pval
53 |
54 |
55 | def fisher_g_test(per, method='author'):
56 | ''' per: periodogram'''
57 | g = max(per) / np.sum(per)
58 | pval = p_val_g_stat(g, len(per), method=method)
59 | return pval, g
60 |
61 |
62 | if __name__ == '__main__':
63 | periodograms = np.loadtxt('periodograms.csv', delimiter=',')
64 |
65 | p, g = fisher_g_test(periodograms[1])
66 | print(p)
67 |
--------------------------------------------------------------------------------
/src/window_size/robustperiod/huberacf.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | import math
3 | import matplotlib.pyplot as plt
4 | from scipy.signal import find_peaks
5 |
6 |
7 | def huber_acf(periodogram):
8 | N_prime = len(periodogram)
9 | N = N_prime // 2
10 | K = np.arange(N)
11 |
12 | cond_1 = periodogram[range(N)]
13 | cond_2 = (periodogram[2 * K] - periodogram[2 * K + 1]).sum() ** 2 / N_prime
14 | cond_3 = [periodogram[N_prime - k] for k in range(N + 1, N_prime)]
15 |
16 | P_bar = np.hstack([cond_1, cond_2, cond_3])
17 | P = np.real(np.fft.ifft(P_bar))
18 |
19 | denom = (N - np.arange(0, N)) * P[0]
20 | res = P[:N] / denom
21 |
22 | return res
23 |
24 |
25 | def get_ACF_period(periodogram):
26 | N = len(periodogram)
27 | k = np.argmax(periodogram)
28 | res = huber_acf(periodogram)
29 | res_trim = res[:int(len(res) * 0.8)] # The paper didn't use entire ACF
30 | res_scaled = 2 * ((res_trim - res_trim.min()) /
31 | (res_trim.max() - res_trim.min())) - 1
32 |
33 | peaks, prop = find_peaks(res_scaled, height=0.5)
34 | distances = np.diff(peaks)
35 |
36 | acf_period = np.median(distances) if len(distances)>0 else 0
37 |
38 | Rk = (0.5 * ((N/(k+1)) + (N/k)) - 1, 0.5 * ((N/k) + (N/(k-1))) + 1)
39 | final_period = acf_period if \
40 | (Rk[1] >= acf_period >= Rk[0]) else 0
41 |
42 | return acf_period, final_period, peaks
43 |
44 |
45 | if __name__ == '__main__':
46 | periodograms = np.loadtxt('periodograms.csv', delimiter=',')
47 |
48 | per = periodograms[6]
49 |
50 | N = len(per)
51 | k = np.argmax(per)
52 | print(0.5 * ((N/(k+1)) + (N/k)) - 1, 0.5 * ((N/k) + (N/(k-1))) + 1)
53 | # print(N/k)
54 |
55 | res = huber_acf(per)
56 |
57 | _, _, peak_idx = get_ACF_period(per)
58 |
59 | plt.plot(res[:800])
60 | plt.scatter(peak_idx, res[:800][peak_idx], color='red')
61 | plt.show()
62 |
--------------------------------------------------------------------------------
/src/window_size/robustperiod/modwt.py:
--------------------------------------------------------------------------------
1 | # Adopted from https://github.com/pistonly/modwtpy/blob/master/modwt.py
2 |
3 | import pywt
4 | import numpy as np
5 |
6 |
7 | def circular_convolve_d(h_t, v_j_1, j):
8 | '''
9 | jth level decomposition
10 | h_t: \tilde{h} = h / sqrt(2)
11 | v_j_1: v_{j-1}, the (j-1)th scale coefficients
12 | return: w_j (or v_j)
13 | '''
14 | N = len(v_j_1)
15 |
16 | L = len(h_t)
17 |
18 | # Matching the paper
19 | L_j = min(N, (2**4-1)*(L-1))
20 |
21 | w_j = np.zeros(N)
22 | l = np.arange(L)
23 |
24 | for t in range(N):
25 | index = np.mod(t - 2 ** (j - 1) * l, N)
26 | v_p = np.array([v_j_1[ind] for ind in index])
27 | # Keeping up to L_j items
28 | w_j[t] = (np.array(h_t)[:L_j] * v_p[:L_j]).sum()
29 | return w_j
30 |
31 |
32 | def modwt(x, filters, level):
33 | '''
34 | filters: 'db1', 'db2', 'haar', ...
35 | return: see matlab
36 | '''
37 | # filter
38 | wavelet = pywt.Wavelet(filters)
39 | h = wavelet.dec_hi
40 | g = wavelet.dec_lo
41 | h_t = np.array(h) / np.sqrt(2)
42 | g_t = np.array(g) / np.sqrt(2)
43 | wavecoeff = []
44 | v_j_1 = x
45 | for j in range(level):
46 | w = circular_convolve_d(h_t, v_j_1, j + 1)
47 | v_j_1 = circular_convolve_d(g_t, v_j_1, j + 1)
48 | # if j > 0:
49 | wavecoeff.append(w)
50 | # wavecoeff.append(v_j_1)
51 | return np.vstack(wavecoeff)
52 |
--------------------------------------------------------------------------------
/src/window_size/robustperiod/mperioreg.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | import statsmodels.api as sm
3 | from multiprocessing import Process, Queue, cpu_count
4 |
5 |
6 | def get_fft_comp(series, j, t):
7 | n = len(series)
8 | w = 2. * np.pi * j / n
9 | idx_t = np.arange(0, n)
10 | MX = np.array([np.cos(w * idx_t), np.sin(w * idx_t)]).T
11 | if j != n/2:
12 | fitrob = sm.RLM(
13 | series,
14 | MX,
15 | M=sm.robust.norms.HuberT(t=t),
16 | deriv=0).fit()
17 | val = np.sqrt(n / (8 * np.pi)) * \
18 | np.complex(fitrob.params[0], -fitrob.params[1])
19 | return val
20 | else:
21 | fitrob = sm.RLM(
22 | series,
23 | MX,
24 | M=sm.robust.norms.HuberT(t=t),
25 | deriv=0).fit()
26 | val = np.sqrt(n / (2 * np.pi)) * \
27 | np.complex(fitrob.params[0], -0)
28 | return val
29 |
30 |
31 | def process_chunk(pid, series, indices, t, out):
32 | fft = []
33 | for j in indices:
34 | fft.append(get_fft_comp(series, j, t))
35 | out.put({pid: fft})
36 |
37 |
38 | def get_perio(series, t, n_process):
39 | n = len(series)
40 | g = n // 2
41 | idxs = np.array_split(np.arange(g), n_process)
42 |
43 | Q = Queue()
44 | procs = []
45 | for i in range(n_process):
46 | p = Process(target=process_chunk, args=[i, series, idxs[i], t, Q])
47 | procs.append(p)
48 | p.start()
49 |
50 | res_dict = {}
51 | for i in range(n_process):
52 | res_dict.update(Q.get())
53 |
54 | for p in procs:
55 | p.join()
56 |
57 | fft = []
58 | for k in range(n_process):
59 | fft += res_dict[k]
60 |
61 | perior = np.abs(np.ravel(fft)) ** 2
62 | return perior
63 |
64 |
65 | def m_perio_reg(series, t=1.345, n_process=4):
66 | if n_process==-1:
67 | n_process = cpu_count() - 1
68 | perior = get_perio(series, t, n_process)
69 | return np.array(np.hstack([perior, np.flip(perior)]))
70 |
--------------------------------------------------------------------------------
/src/window_size/robustperiod/mperioreg_fallback.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | import statsmodels.api as sm
3 |
4 |
5 | def m_perio_reg(series, t=1.345):
6 | n = len(series)
7 | g = n // 2
8 | fft = []
9 |
10 | for j in range(g):
11 | w = 2. * np.pi * j / n
12 | idx = np.arange(0, n).reshape(-1, 1)
13 | MX = np.hstack([np.cos(w * idx), np.sin(w * idx)])
14 | if j != n/2:
15 | fitrob = sm.RLM(
16 | series,
17 | MX,
18 | M=sm.robust.norms.HuberT(t=t),
19 | deriv=0).fit()
20 | val = np.sqrt(n / (8 * np.pi)) * \
21 | np.complex(fitrob.params[0], -fitrob.params[1])
22 | fft.append(val)
23 | else:
24 | fitrob = sm.RLM(
25 | series,
26 | MX,
27 | M=sm.robust.norms.HuberT(t=t),
28 | deriv=0).fit()
29 | val = np.sqrt(n / (2 * np.pi)) * \
30 | np.complex(fitrob.params[0], -0)
31 | fft.append(val)
32 |
33 | perior = np.abs(fft) ** 2
34 |
35 | return np.array(np.hstack([perior, np.flip(perior)]))
36 |
--------------------------------------------------------------------------------
/src/window_size/robustperiod/robustperiod.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | import matplotlib.pyplot as plt
3 | from astropy.stats import biweight_midvariance
4 | from statsmodels.tsa.filters.hp_filter import hpfilter
5 | from scipy.signal import find_peaks
6 |
7 | from .modwt import modwt
8 | from .utils import sinewave, triangle
9 | from .mperioreg_fallback import m_perio_reg
10 | from .huberacf import huber_acf, get_ACF_period
11 | from .fisher import fisher_g_test
12 |
13 |
14 | def extract_trend(y, reg):
15 | _, trend = hpfilter(y, reg)
16 | y_hat = y - trend
17 | return trend, y_hat
18 |
19 |
20 | def huber_func(x, c):
21 | return np.sign(x) * np.minimum(np.abs(x), c)
22 |
23 |
24 | def MAD(x):
25 | return np.mean(np.abs(x - np.median(x)))
26 |
27 |
28 | def residual_autocov(x, c):
29 | '''
30 | The \Psi transformation function
31 | '''
32 | mu = np.median(x)
33 | s = MAD(x)
34 | return huber_func((x - mu)/s, c)
35 |
36 |
37 | def robust_period_full(x, wavelet_method, num_wavelet, lmb, c, zeta=1.345):
38 | '''
39 | Params:
40 | - x: input signal with shape of (m, n), m is the number of observation and
41 | n is the number of series
42 | - wavelet_method:
43 | - num_wavelet:
44 | - lmb: Lambda (regularization param) in Hodrick–Prescott (HP) filter
45 | - c: Huber function hyperparameter
46 | - zeta: M-Periodogram hyperparameter
47 |
48 | Returns:
49 | - Array of periods
50 | - Wavelets
51 | - bivar
52 | - Periodograms
53 | - pval
54 | - ACF
55 | '''
56 |
57 | assert wavelet_method.startswith('db'), \
58 | 'wavelet method must be Daubechies family, e.g., db1, ..., db34'
59 |
60 | # 1) Preprocessing
61 | # ----------------
62 | # Extract trend and then deterend input series. Then perform residual
63 | # autocorrelation to remove extreme outliers.
64 | trend, y_hat = extract_trend(x, lmb)
65 | y_prime = residual_autocov(y_hat, c)
66 |
67 | # 2) Decoupling multiple periodicities
68 | # ------------------------------------
69 | # Perform MODWT and ranking by robust wavelet variance
70 | W = modwt(y_prime, wavelet_method, level=num_wavelet)
71 |
72 | # compute wavelet variance for all levels
73 | # TODO Clarifying Lj, so we can omit first Lj from wj
74 | bivar = np.array([biweight_midvariance(w) for w in W])
75 |
76 | # 3) Robust single periodicity detection
77 | # --------------------------------------
78 | # Compute Huber periodogram
79 | X = np.hstack([W, np.zeros_like(W)])
80 |
81 | periodograms = []
82 | p_vals = []
83 | for i, x in enumerate(X):
84 | # print(f'Calculating periodogram for level {i+1}')
85 | perio = m_perio_reg(x)
86 |
87 | try:
88 | p_val, _ = fisher_g_test(perio)
89 | periodograms.append(perio)
90 | p_vals.append(p_val)
91 | except FloatingPointError:
92 | pass
93 |
94 | periodograms = np.array(periodograms)
95 | # np.savetxt('periodograms.csv', periodograms, delimiter=',')
96 |
97 | # Compute Huber ACF
98 | ACF = np.array([huber_acf(p) for p in periodograms])
99 |
100 | periods = []
101 | for acf in ACF:
102 | peaks, _ = find_peaks(acf)
103 | distances = np.diff(peaks)
104 | final_period = np.median(distances)
105 | periods.append(final_period)
106 | periods = np.array(periods)
107 |
108 | periods = []
109 | for p in periodograms:
110 | _, final_period, _ = get_ACF_period(p)
111 | periods.append(final_period)
112 | periods = np.array(periods)
113 | final_periods = np.unique(periods[periods > 0])
114 |
115 | return (
116 | final_periods, # Periods
117 | W, # Wavelets
118 | bivar, # bivar
119 | periodograms, # periodograms
120 | p_vals, # pval
121 | ACF # ACF
122 | )
123 |
124 |
125 | def robust_period(ts, cutoff=10_000):
126 | # this implementation takes a long time ...
127 | if cutoff is not None:
128 | ts = ts[:cutoff]
129 |
130 | try:
131 | periods, _, _, _, p_vals, _ = robust_period_full(ts, 'db10', num_wavelet=8, lmb=1e+6, c=2)
132 | window_size = np.int64(periods[np.argmin(p_vals)])
133 | return window_size
134 | except:
135 | print(f"Could not determine window size, using default value: -1")
136 | return -1
137 |
138 |
--------------------------------------------------------------------------------
/src/window_size/robustperiod/utils.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 |
3 |
4 | def sinewave(N, period, amplitude):
5 | x1 = np.arange(0, N, 1)
6 | frequency = 1/period
7 | theta = 0
8 | y = amplitude * np.sin(2 * np.pi * frequency * x1 + theta)
9 | return y
10 |
11 |
12 | def triangle(length, amplitude):
13 | mid = length // 2
14 | return np.hstack([np.linspace(0, amplitude, mid),
15 | np.linspace(amplitude, 0, length-mid)])
16 |
--------------------------------------------------------------------------------
/src/window_size/suss.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | import pandas as pd
3 |
4 |
5 | def suss_score(time_series, window_size, stats):
6 | roll = pd.Series(time_series).rolling(window_size)
7 | ts_mean, ts_std, ts_min_max = stats
8 |
9 | roll_mean = roll.mean().to_numpy()[window_size:]
10 | roll_std = roll.std(ddof=0).to_numpy()[window_size:]
11 | roll_min = roll.min().to_numpy()[window_size:]
12 | roll_max = roll.max().to_numpy()[window_size:]
13 |
14 | X = np.array([
15 | roll_mean - ts_mean,
16 | roll_std - ts_std,
17 | (roll_max - roll_min) - ts_min_max
18 | ])
19 |
20 | X = np.sqrt(np.sum(np.square(X), axis=0)) / np.sqrt(window_size)
21 |
22 | return np.mean(X)
23 |
24 |
25 | def suss(time_series, lbound=10, threshold=.89):
26 | time_series = (time_series - time_series.min()) / (time_series.max() - time_series.min())
27 |
28 | ts_mean = np.mean(time_series)
29 | ts_std = np.std(time_series)
30 | ts_min_max = np.max(time_series) - np.min(time_series)
31 |
32 | stats = (ts_mean, ts_std, ts_min_max)
33 |
34 | max_score = suss_score(time_series, 1, stats)
35 | min_score = suss_score(time_series, time_series.shape[0]-1, stats)
36 |
37 | exp = 0
38 |
39 | # exponential search (to find window size interval)
40 | while True:
41 | window_size = 2 ** exp
42 |
43 | if window_size < lbound:
44 | exp += 1
45 | continue
46 |
47 | score = 1 - (suss_score(time_series, window_size, stats) - min_score) / (max_score - min_score)
48 |
49 | if score > threshold:
50 | break
51 |
52 | exp += 1
53 |
54 | lbound, ubound = max(lbound, 2 ** (exp - 1)), 2 ** exp + 1
55 |
56 | # binary search (to find window size in interval)
57 | while lbound <= ubound:
58 | window_size = int((lbound + ubound) / 2)
59 | score = 1 - (suss_score(time_series, window_size, stats) - min_score) / (max_score - min_score)
60 |
61 | if score < threshold:
62 | lbound = window_size+1
63 | elif score > threshold:
64 | ubound = window_size-1
65 | else:
66 | break
67 |
68 | return 2*lbound
--------------------------------------------------------------------------------