forked from DFKI-NI/unsupervised-concept-drift-detection
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_baselines.sh
More file actions
executable file
·113 lines (96 loc) · 3.66 KB
/
Copy pathrun_baselines.sh
File metadata and controls
executable file
·113 lines (96 loc) · 3.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/bin/bash
################################################################################
# Baseline Drift Detector Evaluation Script
#
# This script computes baseline performance metrics for dummy drift detectors
# across multiple data streams. Baselines include:
# - DummyDDBL1: Never detects drift (no retraining)
# - DummyDDBL2: Periodic retraining with various configurations
#
# The script runs multiple iterations per stream to ensure statistical
# reliability of the baseline measurements.
#
# Usage:
# ./run_baselines.sh [NUM_ITERATIONS]
#
# Arguments:
# NUM_ITERATIONS - Optional: Number of iterations per stream (default: 5)
#
# Output:
# Results are appended to Baselines_<STREAM>.out files
#
# Configuration:
# - Edit the 'streams' array to select which datasets to evaluate
# - Adjust iteration range as needed for statistical significance
#
################################################################################
################################################################################
# Load Benchmark Configuration (BASE_PATH, VENV_PATH, ...)
################################################################################
source benchmark_config.sh
################################################################################
# Configuration
################################################################################
# Number of iterations per stream (default: 5, range: 6-10 for backward compatibility)
NUM_ITERATIONS="${1:-5}"
START_ITERATION=1
END_ITERATION=$((START_ITERATION + NUM_ITERATIONS - 1))
# Data streams to evaluate
# Uncomment the streams you want to test
streams=(
#"Electricity"
#"NOAAWeather"
#"OutdoorObjects"
#"PokerHand"
#"RialtoBridgeTimelapse"
#"ForestCovertype"
#"GasSensor"
#"Ozone"
"SensorStream"
)
################################################################################
# Baseline Evaluation
################################################################################
echo "=== Baseline Drift Detector Evaluation ==="
echo "Streams: ${#streams[@]} configured"
echo "Iterations: $START_ITERATION to $END_ITERATION ($NUM_ITERATIONS total)"
echo "==========================================="
echo ""
# Check if SLURM is available
if command -v squeue &> /dev/null || [ -n "$SLURM_JOB_ID" ]; then
SLURM_AVAILABLE=true
echo "SLURM detected - using module load and venv"
else
SLURM_AVAILABLE=false
echo "Local machine detected - using python directly"
fi
echo ""
# Iterate through each stream
for stream in "${streams[@]}"; do
echo "=== Evaluating baselines on: $stream ==="
output_file="Baselines_${stream}.out"
# Run multiple iterations for statistical reliability
for ((i=START_ITERATION; i<=END_ITERATION; i++)); do
echo " Iteration $i/$END_ITERATION..."
# Log iteration number
echo "Iteration $i" >> "$output_file"
# Run baseline computation and append results
if [ "$SLURM_AVAILABLE" = true ]; then
# SLURM environment - use module load and venv
module load GCCcore/10.3.0 Python && \
source "${VENV_PATH}/bin/activate" && \
python compute_baselines.py "$stream" >> "$output_file"
else
# Local machine - use python directly
python compute_baselines.py "$stream" >> "$output_file"
fi
# Check exit status
if [ $? -ne 0 ]; then
echo " WARNING: Iteration $i failed for $stream" | tee -a "$output_file"
fi
done
echo " Results saved to: $output_file"
echo ""
done
echo "=== Baseline evaluation completed ==="
echo "Output files: Baselines_*.out"