-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathxgb_train.py
74 lines (65 loc) · 1.69 KB
/
xgb_train.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
from xgb_bagging_sample import xgb_fit_predict
xgb_params = [
{'feature_type': 'ori_num_onehot_cat',
'eta': 0.03,
'n_bags': 2,
'colsample_bytree': 0.5581,
'gamma': 1.2376,
'max_depth': 4,
'min_child_weight': 5,
'subsample': 0.8357},
{'feature_type': 'scaled_num_onehot_cat',
'eta': 0.03,
'n_bags': 2,
'colsample_bytree': 0.544,
'gamma': 2.3173,
'max_depth': 6,
'min_child_weight': 3,
'subsample': 0.628},
{'feature_type': 'scaled_num_counts_cat',
'eta': 0.03,
'n_bags': 2,
'colsample_bytree': 0.5917,
'gamma': 2.4745,
'max_depth': 6,
'min_child_weight': 5,
'subsample': 0.9033},
{'feature_type': 'ori_num_counts_cat',
'eta': 0.03,
'n_bags': 2,
'colsample_bytree': 0.5698,
'gamma': 2.3845,
'max_depth': 9,
'min_child_weight': 1,
'subsample': 0.832},
{'feature_type': 'ori_num_counts_cat',
'eta': 0.03,
'n_bags': 2,
'colsample_bytree': 0.4044,
'gamma': 2.2487,
'max_depth': 8,
'min_child_weight': 5,
'subsample': 0.9418},
{'feature_type': 'scaled_num_ordered_cat',
'eta': 0.05,
'n_bags': 2,
'colsample_bytree': 0.345,
'gamma': 1.7278,
'max_depth': 8,
'min_child_weight': 2,
'subsample': 0.7084},
{'feature_type': 'svd',
'eta': 0.03,
'n_bags': 2,
'colsample_bytree': 0.5216,
'gamma': 1.9593,
'max_depth': 4,
'min_child_weight': 2,
'subsample': 0.9417}
]
for params in xgb_params:
print 'xgb params:'
print params
xgb_fit_predict(params)
print '\nOne xgb model is trained!'
print '\nAll xgb models are done!'