-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
30 lines (25 loc) · 1002 Bytes
/
main.py
File metadata and controls
30 lines (25 loc) · 1002 Bytes
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
from dotenv import load_dotenv
from detection.holodetect import HoloDetector
from evaluation import *
from utils import *
from utils.helpers import read_dataset
# ======================
# Environment Variables
# ======================
load_dotenv()
data_path = os.getenv('data_path')
output_path = os.getenv('output_path')
config_path = os.getenv('config_path')
hparams = Namespace(**yaml.full_load(open(config_path)))
detector = HoloDetector(hparams)
dataset = read_dataset(data_path) # data_path should contain raw & cleaned directories
training_data = read_dataset(data_path, [0, 100])
constraint = True # Change This to True if Constraints Provided
constraints = Parser().load_denial_constraints(training_data['raw'].columns, data_path + '/constraints.txt') if constraint else None
dataset['constraints'] = constraints
training_data['constraints'] = constraints
# ==========
# Evaluation
# ==========
evaluator = Evaluator()
evaluator.evaluate(detector, dataset, training_data, output_path)