All datasets are part of the UCR Anomaly Archive (2021)
Please download and navigate to AnomalyDatasets_2021\UCR_TimeSeriesAnomalyDatasets2021\FilesAreInHere\ and copy
UCR_Anomaly_FullData/ to the root folder
The root directory should contain the following:
UCR_Anomaly_FullData/: Folder containing all 250 raw datasets from the UCR 2021 anomaly archive.env.yml: Conda environment file specifying all dependencies for reproducibility.
.
βββ main.py # Main script: training, evaluation, anomaly detection
βββ common.py # helper utils for contextual.py
βββ contextual.py # Contextual precision, recall, F1 evaluation functions
βββ hyperparameters.py # Configuration dictionary + dataset filenames
βββ results/ # Saved CSVs with F1, precision, recall
βββ saved_models/ # Periodically saved checkpoints (every 10k iterations)
βββ saved_raw_scores/ # Raw z-scores before filtering
# Step 1: Create the conda environment from the YAML file
conda env create -f env.yml
# Step 2: Activate the environment
conda activate research-envpython main.pyThe script will:
- Iterate through all 250 datasets defined in
hyperparameters.py - Train the TadFlow model for 100,000 iterations per dataset.
- Save raw scores, filtered scores, and evaluation metrics (F1, precision, recall) to
results/.
Each experiment logs the following to results/result.csv:
data_group, dataset_name, expected, predicted, f1_score, precision, recall, time_elapsed (minutes)