-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanalyze_data.py
36 lines (21 loc) · 961 Bytes
/
analyze_data.py
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
import argparse
import os
import glob
from learning_experiment import LearningExp
parser = argparse.ArgumentParser()
parser.add_argument('path', help="Path to directory with learning experiment log files")
args = parser.parse_args()
files = glob.glob(os.path.join(args.path, '*_log.txt'))
for file in files:
print(f"Analyzing: {file}")
lexp = LearningExp.load(file)
data = lexp.get_all_training_data()
print(f"Data points in all training data:", len(data))
data_dedup = data.drop_duplicates(subset=['Shape', 'Angle'])
N_all = len(data_dedup)
print(f"Deduplicated data points in all training data:", N_all)
exposure_data = lexp.get_exposure_data(3)
print(f"Data points in all exposure 3 data:", len(exposure_data))
exposure_data_dedup = exposure_data.drop_duplicates(subset=['Shape', 'Angle'])
N_exposure = len(exposure_data_dedup)
print(f"Deduplicated data points in exposure 3 data:", N_exposure)