Skip to content

Commit 29cffa2

Browse files
committed
py
1 parent 572ee2a commit 29cffa2

11 files changed

Lines changed: 26398 additions & 11 deletions

File tree

projects/一文梳理风控建模全流程/.ipynb_checkpoints/树模型-lightgbm-checkpoint.ipynb

Lines changed: 1203 additions & 0 deletions
Large diffs are not rendered by default.

projects/一文梳理风控建模全流程/credit_baseline.ipynb

Lines changed: 194 additions & 11 deletions
Large diffs are not rendered by default.
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
tree
2+
version=v3
3+
num_class=1
4+
num_tree_per_iteration=1
5+
label_index=0
6+
max_feature_idx=36
7+
objective=binary sigmoid:1
8+
feature_names=total_loan year_of_loan interest monthly_payment class work_year house_exist censor_status use post_code region debt_loan_ratio del_in_18month scoring_low scoring_high known_outstanding_loan known_dero pub_dero_bankrup recircle_b recircle_u initial_list_status app_type title policy_code f0 f1 f2 f3 f4 early_return early_return_amount early_return_amount_3mon issue_date_y issue_date_m issue_date_diff employer_type industry
9+
feature_infos=[818.18181819999995:47272.727270000003] [3:5] [4.7789999999999999:33.978999999999999] [30.440000000000001:1503.8900000000001] [0:6] [0:10] [0:4] [0:2] [0:13] [0:901] [0:49] [0:509.3672727] [0:15] [540:910.90909090000002] [585:1131.818182] [1:59] [0:12] [0:9999] [0:779021] [0:120.6153846] [0:1] [0:1] [0:60905] none [0:9999] [0:9999] [0:9999] [2:9999] [0:9999] [0:5] [0:17446] [0:4821.8999999999996] [2007:2018] [1:12] [2830:6909] -1:4:3:2:0:1:5 -1:13:11:3:1:2:10:7:8:12:0:4:5:9:6
10+
tree_sizes=770
11+
12+
Tree=0
13+
num_leaves=6
14+
num_cat=0
15+
split_feature=30 2 16 15 2
16+
split_gain=3093.94 124.594 59.0243 46.1935 42.6584
17+
threshold=1.0000000180025095e-35 9.9675000000000029 1.5000000000000002 17.500000000000004 15.961500000000003
18+
decision_type=2 2 2 2 2
19+
left_child=1 -1 3 -2 -3
20+
right_child=2 4 -4 -5 -6
21+
leaf_value=0.023461476907437533 -0.17987415362524772 0.10323905611372351 -0.026732447730002745 -0.10633877114664755 0.14703056722907529
22+
leaf_weight=147.41318297386169 569.9415502846241 502.41849474608898 30.554571613669395 100.48724548518658 399.18497054278851
23+
leaf_count=544 3633 1325 133 543 822
24+
internal_value=-5.60284e-08 0.108692 -0.162658 -0.168852 0.122628
25+
internal_weight=0 1049.02 700.983 670.429 901.603
26+
internal_count=7000 2691 4309 4176 2147
27+
is_linear=0
28+
shrinkage=1
29+
30+
31+
end of trees
32+
33+
feature_importances:
34+
interest=2
35+
known_outstanding_loan=1
36+
known_dero=1
37+
early_return_amount=1
38+
39+
parameters:
40+
[boosting: gbdt]
41+
[objective: binary]
42+
[metric: auc]
43+
[tree_learner: serial]
44+
[device_type: cpu]
45+
[data: ]
46+
[valid: ]
47+
[num_iterations: 1]
48+
[learning_rate: 0.1]
49+
[num_leaves: 6]
50+
[num_threads: -1]
51+
[deterministic: 0]
52+
[force_col_wise: 0]
53+
[force_row_wise: 0]
54+
[histogram_pool_size: -1]
55+
[max_depth: -1]
56+
[min_data_in_leaf: 20]
57+
[min_sum_hessian_in_leaf: 0.001]
58+
[bagging_fraction: 1]
59+
[pos_bagging_fraction: 1]
60+
[neg_bagging_fraction: 1]
61+
[bagging_freq: 0]
62+
[bagging_seed: 3]
63+
[feature_fraction: 1]
64+
[feature_fraction_bynode: 1]
65+
[feature_fraction_seed: 2]
66+
[extra_trees: 0]
67+
[extra_seed: 6]
68+
[early_stopping_round: 0]
69+
[first_metric_only: 0]
70+
[max_delta_step: 0]
71+
[lambda_l1: 0]
72+
[lambda_l2: 0]
73+
[linear_lambda: 0]
74+
[min_gain_to_split: 0]
75+
[drop_rate: 0.1]
76+
[max_drop: 50]
77+
[skip_drop: 0.5]
78+
[xgboost_dart_mode: 0]
79+
[uniform_drop: 0]
80+
[drop_seed: 4]
81+
[top_rate: 0.2]
82+
[other_rate: 0.1]
83+
[min_data_per_group: 100]
84+
[max_cat_threshold: 32]
85+
[cat_l2: 10]
86+
[cat_smooth: 10]
87+
[max_cat_to_onehot: 4]
88+
[top_k: 20]
89+
[monotone_constraints: ]
90+
[monotone_constraints_method: basic]
91+
[monotone_penalty: 0]
92+
[feature_contri: ]
93+
[forcedsplits_filename: ]
94+
[refit_decay_rate: 0.9]
95+
[cegb_tradeoff: 1]
96+
[cegb_penalty_split: 0]
97+
[cegb_penalty_feature_lazy: ]
98+
[cegb_penalty_feature_coupled: ]
99+
[path_smooth: 0]
100+
[interaction_constraints: ]
101+
[verbosity: -1]
102+
[saved_feature_importance_type: 0]
103+
[linear_tree: 0]
104+
[max_bin: 255]
105+
[max_bin_by_feature: ]
106+
[min_data_in_bin: 3]
107+
[bin_construct_sample_cnt: 200000]
108+
[data_random_seed: 1]
109+
[is_enable_sparse: 1]
110+
[enable_bundle: 1]
111+
[use_missing: 1]
112+
[zero_as_missing: 0]
113+
[feature_pre_filter: 1]
114+
[pre_partition: 0]
115+
[two_round: 0]
116+
[header: 0]
117+
[label_column: ]
118+
[weight_column: ]
119+
[group_column: ]
120+
[ignore_column: ]
121+
[categorical_feature: 35,36]
122+
[forcedbins_filename: ]
123+
[precise_float_parser: 0]
124+
[objective_seed: 5]
125+
[num_class: 1]
126+
[is_unbalance: 0]
127+
[scale_pos_weight: 1]
128+
[sigmoid: 1]
129+
[boost_from_average: 1]
130+
[reg_sqrt: 0]
131+
[alpha: 0.9]
132+
[fair_c: 1]
133+
[poisson_max_delta_step: 0.7]
134+
[tweedie_variance_power: 1.5]
135+
[lambdarank_truncation_level: 30]
136+
[lambdarank_norm: 1]
137+
[label_gain: ]
138+
[eval_at: ]
139+
[multi_error_top_k: 1]
140+
[auc_mu_weights: ]
141+
[num_machines: 1]
142+
[local_listen_port: 12400]
143+
[time_out: 120]
144+
[machine_list_filename: ]
145+
[machines: ]
146+
[gpu_platform_id: -1]
147+
[gpu_device_id: -1]
148+
[gpu_use_dp: 0]
149+
[num_gpu: 1]
150+
151+
end of parameters
152+
153+
pandas_categorical:[["\u4e0a\u5e02\u4f01\u4e1a", "\u4e16\u754c\u4e94\u767e\u5f3a", "\u5e7c\u6559\u4e0e\u4e2d\u5c0f\u5b66\u6821", "\u653f\u5e9c\u673a\u6784", "\u666e\u901a\u4f01\u4e1a", "\u9ad8\u7b49\u6559\u80b2\u673a\u6784"], ["\u4ea4\u901a\u8fd0\u8f93\u3001\u4ed3\u50a8\u548c\u90ae\u653f\u4e1a", "\u4f4f\u5bbf\u548c\u9910\u996e\u4e1a", "\u4fe1\u606f\u4f20\u8f93\u3001\u8f6f\u4ef6\u548c\u4fe1\u606f\u6280\u672f\u670d\u52a1\u4e1a", "\u516c\u5171\u670d\u52a1\u3001\u793e\u4f1a\u7ec4\u7ec7", "\u519c\u3001\u6797\u3001\u7267\u3001\u6e14\u4e1a", "\u5236\u9020\u4e1a", "\u56fd\u9645\u7ec4\u7ec7", "\u5efa\u7b51\u4e1a", "\u623f\u5730\u4ea7\u4e1a", "\u6279\u53d1\u548c\u96f6\u552e\u4e1a", "\u6587\u5316\u548c\u4f53\u80b2\u4e1a", "\u7535\u529b\u3001\u70ed\u529b\u751f\u4ea7\u4f9b\u5e94\u4e1a", "\u91c7\u77ff\u4e1a", "\u91d1\u878d\u4e1a"]]
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
tree
2+
version=v3
3+
num_class=1
4+
num_tree_per_iteration=1
5+
label_index=0
6+
max_feature_idx=36
7+
objective=binary sigmoid:1
8+
feature_names=total_loan year_of_loan interest monthly_payment class work_year house_exist censor_status use post_code region debt_loan_ratio del_in_18month scoring_low scoring_high known_outstanding_loan known_dero pub_dero_bankrup recircle_b recircle_u initial_list_status app_type title policy_code f0 f1 f2 f3 f4 early_return early_return_amount early_return_amount_3mon issue_date_y issue_date_m issue_date_diff employer_type industry
9+
feature_infos=[818.18181819999995:47272.727270000003] [3:5] [4.7789999999999999:33.978999999999999] [30.440000000000001:1503.8900000000001] [0:6] [0:10] [0:4] [0:2] [0:13] [0:901] [0:49] [0:509.3672727] [0:15] [540:910.90909090000002] [585:1131.818182] [1:59] [0:12] [0:9999] [0:779021] [0:120.6153846] [0:1] [0:1] [0:60905] none [0:9999] [0:9999] [0:9999] [2:9999] [0:9999] [0:5] [0:17446] [0:4821.8999999999996] [2007:2018] [1:12] [2830:6909] -1:4:3:2:0:1:5 -1:13:11:3:1:2:10:7:8:12:0:4:5:9:6
10+
tree_sizes=770
11+
12+
Tree=0
13+
num_leaves=6
14+
num_cat=0
15+
split_feature=30 2 16 15 2
16+
split_gain=3093.94 124.594 59.0243 46.1935 42.6584
17+
threshold=1.0000000180025095e-35 9.9675000000000029 1.5000000000000002 17.500000000000004 15.961500000000003
18+
decision_type=2 2 2 2 2
19+
left_child=1 -1 3 -2 -3
20+
right_child=2 4 -4 -5 -6
21+
leaf_value=0.023461476907437533 -0.17987415362524772 0.122628 -0.026732447730002745 -0.10633877114664755 0.122628
22+
leaf_weight=147.41318297386169 569.9415502846241 901.603 30.554571613669395 100.48724548518658 901.603
23+
leaf_count=544 3633 1325 133 543 822
24+
internal_value=-5.60284e-08 0.108692 -0.162658 -0.168852 0.122628
25+
internal_weight=0 1049.02 700.983 670.429 901.603
26+
internal_count=7000 2691 4309 4176 2147
27+
is_linear=0
28+
shrinkage=1
29+
30+
31+
end of trees
32+
33+
feature_importances:
34+
interest=2
35+
known_outstanding_loan=1
36+
known_dero=1
37+
early_return_amount=1
38+
39+
parameters:
40+
[boosting: gbdt]
41+
[objective: binary]
42+
[metric: auc,binary_logloss]
43+
[tree_learner: serial]
44+
[device_type: cpu]
45+
[data: ]
46+
[valid: ]
47+
[num_iterations: 1]
48+
[learning_rate: 0.1]
49+
[num_leaves: 6]
50+
[num_threads: -1]
51+
[deterministic: 0]
52+
[force_col_wise: 0]
53+
[force_row_wise: 0]
54+
[histogram_pool_size: -1]
55+
[max_depth: -1]
56+
[min_data_in_leaf: 20]
57+
[min_sum_hessian_in_leaf: 0.001]
58+
[bagging_fraction: 1]
59+
[pos_bagging_fraction: 1]
60+
[neg_bagging_fraction: 1]
61+
[bagging_freq: 0]
62+
[bagging_seed: 3]
63+
[feature_fraction: 1]
64+
[feature_fraction_bynode: 1]
65+
[feature_fraction_seed: 2]
66+
[extra_trees: 0]
67+
[extra_seed: 6]
68+
[early_stopping_round: 50]
69+
[first_metric_only: 0]
70+
[max_delta_step: 0]
71+
[lambda_l1: 0]
72+
[lambda_l2: 0]
73+
[linear_lambda: 0]
74+
[min_gain_to_split: 0]
75+
[drop_rate: 0.1]
76+
[max_drop: 50]
77+
[skip_drop: 0.5]
78+
[xgboost_dart_mode: 0]
79+
[uniform_drop: 0]
80+
[drop_seed: 4]
81+
[top_rate: 0.2]
82+
[other_rate: 0.1]
83+
[min_data_per_group: 100]
84+
[max_cat_threshold: 32]
85+
[cat_l2: 10]
86+
[cat_smooth: 10]
87+
[max_cat_to_onehot: 4]
88+
[top_k: 20]
89+
[monotone_constraints: ]
90+
[monotone_constraints_method: basic]
91+
[monotone_penalty: 0]
92+
[feature_contri: ]
93+
[forcedsplits_filename: ]
94+
[refit_decay_rate: 0.9]
95+
[cegb_tradeoff: 1]
96+
[cegb_penalty_split: 0]
97+
[cegb_penalty_feature_lazy: ]
98+
[cegb_penalty_feature_coupled: ]
99+
[path_smooth: 0]
100+
[interaction_constraints: ]
101+
[verbosity: -1]
102+
[saved_feature_importance_type: 0]
103+
[linear_tree: 0]
104+
[max_bin: 255]
105+
[max_bin_by_feature: ]
106+
[min_data_in_bin: 3]
107+
[bin_construct_sample_cnt: 200000]
108+
[data_random_seed: 1]
109+
[is_enable_sparse: 1]
110+
[enable_bundle: 1]
111+
[use_missing: 1]
112+
[zero_as_missing: 0]
113+
[feature_pre_filter: 1]
114+
[pre_partition: 0]
115+
[two_round: 0]
116+
[header: 0]
117+
[label_column: ]
118+
[weight_column: ]
119+
[group_column: ]
120+
[ignore_column: ]
121+
[categorical_feature: 35,36]
122+
[forcedbins_filename: ]
123+
[precise_float_parser: 0]
124+
[objective_seed: 5]
125+
[num_class: 1]
126+
[is_unbalance: 0]
127+
[scale_pos_weight: 1]
128+
[sigmoid: 1]
129+
[boost_from_average: 1]
130+
[reg_sqrt: 0]
131+
[alpha: 0.9]
132+
[fair_c: 1]
133+
[poisson_max_delta_step: 0.7]
134+
[tweedie_variance_power: 1.5]
135+
[lambdarank_truncation_level: 30]
136+
[lambdarank_norm: 1]
137+
[label_gain: ]
138+
[eval_at: ]
139+
[multi_error_top_k: 1]
140+
[auc_mu_weights: ]
141+
[num_machines: 1]
142+
[local_listen_port: 12400]
143+
[time_out: 120]
144+
[machine_list_filename: ]
145+
[machines: ]
146+
[gpu_platform_id: -1]
147+
[gpu_device_id: -1]
148+
[gpu_use_dp: 0]
149+
[num_gpu: 1]
150+
151+
end of parameters
152+
153+
pandas_categorical:[["\u4e0a\u5e02\u4f01\u4e1a", "\u4e16\u754c\u4e94\u767e\u5f3a", "\u5e7c\u6559\u4e0e\u4e2d\u5c0f\u5b66\u6821", "\u653f\u5e9c\u673a\u6784", "\u666e\u901a\u4f01\u4e1a", "\u9ad8\u7b49\u6559\u80b2\u673a\u6784"], ["\u4ea4\u901a\u8fd0\u8f93\u3001\u4ed3\u50a8\u548c\u90ae\u653f\u4e1a", "\u4f4f\u5bbf\u548c\u9910\u996e\u4e1a", "\u4fe1\u606f\u4f20\u8f93\u3001\u8f6f\u4ef6\u548c\u4fe1\u606f\u6280\u672f\u670d\u52a1\u4e1a", "\u516c\u5171\u670d\u52a1\u3001\u793e\u4f1a\u7ec4\u7ec7", "\u519c\u3001\u6797\u3001\u7267\u3001\u6e14\u4e1a", "\u5236\u9020\u4e1a", "\u56fd\u9645\u7ec4\u7ec7", "\u5efa\u7b51\u4e1a", "\u623f\u5730\u4ea7\u4e1a", "\u6279\u53d1\u548c\u96f6\u552e\u4e1a", "\u6587\u5316\u548c\u4f53\u80b2\u4e1a", "\u7535\u529b\u3001\u70ed\u529b\u751f\u4ea7\u4f9b\u5e94\u4e1a", "\u91c7\u77ff\u4e1a", "\u91d1\u878d\u4e1a"]]

0 commit comments

Comments
 (0)