generated from jeongyoonlee/kaggler-template
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile.logreg1
44 lines (36 loc) · 1.61 KB
/
Makefile.logreg1
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
include Makefile.feature.esb2
ALGO_NAME := logreg
C := 1.0
REGULARIZER := l2
CLASS_WEIGHT := balanced
SOLVER := lbfgs
MODEL_NAME := $(FEATURE_NAME)_$(ALGO_NAME)_$(REGULARIZER)_$(C)
METRIC_VAL := $(DIR_METRIC)/$(MODEL_NAME).val.txt
PREDICT_VAL := $(DIR_VAL)/$(MODEL_NAME).val.yht
PREDICT_TST := $(DIR_TST)/$(MODEL_NAME).tst.yht
SUBMISSION_TST := $(DIR_SUB)/$(MODEL_NAME)_sub.csv
all: validation submission
validation: $(METRIC_VAL)
submission: $(SUBMISSION_TST)
retrain: clean_$(ALGO_NAME) submission
submit: $(SUBMISSION_TST)
kaggle competitions submit -c $(COMPETITION) -f $< -m $(MODEL_NAME)
$(PREDICT_TST) $(PREDICT_VAL): $(FEATURE_TRN) $(FEATURE_TST) $(CV_ID) | $(DIR_VAL) $(DIR_TST)
python ./src/train_predict_logreg1.py --train-feature-file $< \
--test-feature-file $(word 2, $^) \
--predict-valid-file $(PREDICT_VAL) \
--predict-test-file $(PREDICT_TST) \
--C $(C) \
--regularizer $(REGULARIZER) \
--class_weight $(CLASS_WEIGHT) \
--solver $(SOLVER) \
--retrain
$(METRIC_VAL): $(PREDICT_VAL) $(Y_TRN) | $(DIR_METRIC)
python ./src/evaluate.py --predict-file $< \
--target-file $(lastword $^) > $@
cat $@
$(SUBMISSION_TST): $(PREDICT_TST) $(HEADER) $(ID_TST) | $(DIR_SUB)
paste -d, $(lastword $^) $< > [email protected]
cat $(word 2, $^) [email protected] > $@
.DEFAULT_GOAL := all