generated from jeongyoonlee/kaggler-template
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile.autolgb
49 lines (36 loc) · 1.46 KB
/
Makefile.autolgb
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
include Makefile.feature.esb1
N_STOP = 20
ALGO_NAME := autolgb
MODEL_NAME := $(ALGO_NAME)_$(FEATURE_NAME)
METRIC_VAL := $(DIR_METRIC)/$(MODEL_NAME).val.txt
PREDICT_VAL := $(DIR_VAL)/$(MODEL_NAME).val.yht
PREDICT_TST := $(DIR_TST)/$(MODEL_NAME).tst.yht
FEATURE_IMP := $(DIR_MODEL)/$(MODEL_NAME).imp.csv
SUBMISSION_TST := $(DIR_SUB)/$(MODEL_NAME).sub.csv
SUBMISSION_TST_GZ := $(DIR_SUB)/$(MODEL_NAME).sub.csv.gz
all: validation submission
validation: $(METRIC_VAL)
submission: $(SUBMISSION_TST)
retrain: clean_$(ALGO_NAME) submission
$(PREDICT_TST) $(PREDICT_VAL): $(FEATURE_TRN) $(FEATURE_TST) \
| $(DIR_VAL) $(DIR_TST)
./src/train_predict_autolgb.py --train-file $< \
--test-file $(word 2, $^) \
--predict-valid-file $(PREDICT_VAL) \
--predict-test-file $(PREDICT_TST) \
--early-stop $(N_STOP)
$(SUBMISSION_TST_GZ): $(SUBMISSION_TST)
gzip $<
$(SUBMISSION_TST): $(PREDICT_TST) $(HEADER) $(ID_TST) | $(DIR_SUB)
paste -d, $(lastword $^) $< > [email protected]
cat $(word 2, $^) [email protected] > $@
$(METRIC_VAL): $(PREDICT_VAL) $(Y_TRN) | $(DIR_METRIC)
python ./src/evaluate.py --predict-file $< \
--target-file $(lastword $^) > $@
cat $@
clean:: clean_$(ALGO_NAME)
clean_$(ALGO_NAME):
-rm $(METRIC_VAL) $(PREDICT_VAL) $(PREDICT_TST) $(SUBMISSION_TST)
find . -name '*.pyc' -delete
.DEFAULT_GOAL := all