-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (39 loc) · 1.56 KB
/
Copy pathMakefile
File metadata and controls
52 lines (39 loc) · 1.56 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
.PHONY: help setup install test demo generate train evaluate arms-race figures report clean
PYTHON ?= python
help:
@echo "KeyWraith make targets:"
@echo " make setup create a venv and install deps"
@echo " make install install the package (editable) + dev deps"
@echo " make test run the test suite"
@echo " make demo end-to-end demo with live endpoint alerts"
@echo " make generate synthesize the labeled dataset + feature CSV"
@echo " make train train the behavioral detector"
@echo " make evaluate detector vs baseline metrics"
@echo " make arms-race run the evasion arms-race sweep + figure"
@echo " make figures regenerate all figures"
@echo " make report regenerate every committed result artifact"
@echo " make clean remove generated artifacts and caches"
setup:
$(PYTHON) -m venv .venv
. .venv/bin/activate && pip install -U pip && pip install -r requirements.txt pytest
install:
pip install -e ".[dev]"
test:
$(PYTHON) -m pytest -q
demo:
$(PYTHON) -m keywraith.cli demo
generate:
$(PYTHON) scripts/generate_dataset.py --out data/sessions.ndjson --csv data/features.csv
train:
$(PYTHON) scripts/train_detector.py --out models/detector.pkl
evaluate:
$(PYTHON) scripts/evaluate.py --out results/metrics.json
arms-race:
$(PYTHON) scripts/evasion_arms_race.py --out results/arms_race.json
figures:
$(PYTHON) scripts/make_figures.py --outdir figures
report:
$(PYTHON) -m keywraith.cli report --outdir results
clean:
rm -rf __pycache__ */__pycache__ .pytest_cache *.egg-info build dist
rm -f models/*.pkl