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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "code",
|
5 |
+
"execution_count": 1,
|
6 |
+
"id": "c6458055",
|
7 |
+
"metadata": {},
|
8 |
+
"outputs": [
|
9 |
+
{
|
10 |
+
"data": {
|
11 |
+
"text/html": [
|
12 |
+
"<div>\n",
|
13 |
+
"<style scoped>\n",
|
14 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
15 |
+
" vertical-align: middle;\n",
|
16 |
+
" }\n",
|
17 |
+
"\n",
|
18 |
+
" .dataframe tbody tr th {\n",
|
19 |
+
" vertical-align: top;\n",
|
20 |
+
" }\n",
|
21 |
+
"\n",
|
22 |
+
" .dataframe thead th {\n",
|
23 |
+
" text-align: right;\n",
|
24 |
+
" }\n",
|
25 |
+
"</style>\n",
|
26 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
27 |
+
" <thead>\n",
|
28 |
+
" <tr style=\"text-align: right;\">\n",
|
29 |
+
" <th></th>\n",
|
30 |
+
" <th>night_call_dura_rate</th>\n",
|
31 |
+
" <th>l3m_night_call_dura_rate</th>\n",
|
32 |
+
" <th>l6m_night_call_dura_rate</th>\n",
|
33 |
+
" <th>night_call_cnt_rate</th>\n",
|
34 |
+
" <th>l3m_night_call_cnt_rate</th>\n",
|
35 |
+
" <th>l6m_night_call_cnt_rate</th>\n",
|
36 |
+
" <th>called_cnt_rate</th>\n",
|
37 |
+
" <th>l3m_called_cnt_rate</th>\n",
|
38 |
+
" <th>l6m_called_cnt_rate</th>\n",
|
39 |
+
" <th>contact_ratio</th>\n",
|
40 |
+
" <th>...</th>\n",
|
41 |
+
" <th>rcn_chnl_id</th>\n",
|
42 |
+
" <th>rcn_chnl_typ</th>\n",
|
43 |
+
" <th>rcn_mode</th>\n",
|
44 |
+
" <th>user_star_val</th>\n",
|
45 |
+
" <th>star_evalu_tm</th>\n",
|
46 |
+
" <th>is_fam_v_ntw</th>\n",
|
47 |
+
" <th>is_camp_user</th>\n",
|
48 |
+
" <th>is_camp_area_user</th>\n",
|
49 |
+
" <th>row_num</th>\n",
|
50 |
+
" <th>label</th>\n",
|
51 |
+
" </tr>\n",
|
52 |
+
" </thead>\n",
|
53 |
+
" <tbody>\n",
|
54 |
+
" <tr>\n",
|
55 |
+
" <th>0</th>\n",
|
56 |
+
" <td>1.2726</td>\n",
|
57 |
+
" <td>0.5082</td>\n",
|
58 |
+
" <td>5.5138</td>\n",
|
59 |
+
" <td>3.1250</td>\n",
|
60 |
+
" <td>2.1277</td>\n",
|
61 |
+
" <td>4.6512</td>\n",
|
62 |
+
" <td>87.5000</td>\n",
|
63 |
+
" <td>88.2979</td>\n",
|
64 |
+
" <td>84.3023</td>\n",
|
65 |
+
" <td>1</td>\n",
|
66 |
+
" <td>...</td>\n",
|
67 |
+
" <td>30507</td>\n",
|
68 |
+
" <td>3</td>\n",
|
69 |
+
" <td>4.0</td>\n",
|
70 |
+
" <td>198.0</td>\n",
|
71 |
+
" <td>202110</td>\n",
|
72 |
+
" <td>0</td>\n",
|
73 |
+
" <td>0</td>\n",
|
74 |
+
" <td>0</td>\n",
|
75 |
+
" <td>29833</td>\n",
|
76 |
+
" <td>0</td>\n",
|
77 |
+
" </tr>\n",
|
78 |
+
" <tr>\n",
|
79 |
+
" <th>1</th>\n",
|
80 |
+
" <td>8.4315</td>\n",
|
81 |
+
" <td>3.6997</td>\n",
|
82 |
+
" <td>2.0436</td>\n",
|
83 |
+
" <td>6.9767</td>\n",
|
84 |
+
" <td>2.0305</td>\n",
|
85 |
+
" <td>1.3298</td>\n",
|
86 |
+
" <td>76.7442</td>\n",
|
87 |
+
" <td>72.0812</td>\n",
|
88 |
+
" <td>67.8191</td>\n",
|
89 |
+
" <td>3</td>\n",
|
90 |
+
" <td>...</td>\n",
|
91 |
+
" <td>GZ_GZPY0612038</td>\n",
|
92 |
+
" <td>NaN</td>\n",
|
93 |
+
" <td>4.0</td>\n",
|
94 |
+
" <td>91.0</td>\n",
|
95 |
+
" <td>202207</td>\n",
|
96 |
+
" <td>0</td>\n",
|
97 |
+
" <td>0</td>\n",
|
98 |
+
" <td>0</td>\n",
|
99 |
+
" <td>18121</td>\n",
|
100 |
+
" <td>0</td>\n",
|
101 |
+
" </tr>\n",
|
102 |
+
" <tr>\n",
|
103 |
+
" <th>2</th>\n",
|
104 |
+
" <td>5.0105</td>\n",
|
105 |
+
" <td>4.7252</td>\n",
|
106 |
+
" <td>3.5456</td>\n",
|
107 |
+
" <td>7.6923</td>\n",
|
108 |
+
" <td>7.3684</td>\n",
|
109 |
+
" <td>5.4526</td>\n",
|
110 |
+
" <td>49.0385</td>\n",
|
111 |
+
" <td>55.5263</td>\n",
|
112 |
+
" <td>56.4885</td>\n",
|
113 |
+
" <td>7</td>\n",
|
114 |
+
" <td>...</td>\n",
|
115 |
+
" <td>218568</td>\n",
|
116 |
+
" <td>NaN</td>\n",
|
117 |
+
" <td>4.0</td>\n",
|
118 |
+
" <td>NaN</td>\n",
|
119 |
+
" <td>-3</td>\n",
|
120 |
+
" <td>1</td>\n",
|
121 |
+
" <td>1</td>\n",
|
122 |
+
" <td>0</td>\n",
|
123 |
+
" <td>8372</td>\n",
|
124 |
+
" <td>0</td>\n",
|
125 |
+
" </tr>\n",
|
126 |
+
" <tr>\n",
|
127 |
+
" <th>3</th>\n",
|
128 |
+
" <td>1.4925</td>\n",
|
129 |
+
" <td>0.6083</td>\n",
|
130 |
+
" <td>2.8386</td>\n",
|
131 |
+
" <td>3.8462</td>\n",
|
132 |
+
" <td>2.2222</td>\n",
|
133 |
+
" <td>5.6604</td>\n",
|
134 |
+
" <td>19.2308</td>\n",
|
135 |
+
" <td>46.6667</td>\n",
|
136 |
+
" <td>52.8302</td>\n",
|
137 |
+
" <td>0</td>\n",
|
138 |
+
" <td>...</td>\n",
|
139 |
+
" <td>2.25E+18</td>\n",
|
140 |
+
" <td>NaN</td>\n",
|
141 |
+
" <td>4.0</td>\n",
|
142 |
+
" <td>133.0</td>\n",
|
143 |
+
" <td>202112</td>\n",
|
144 |
+
" <td>1</td>\n",
|
145 |
+
" <td>1</td>\n",
|
146 |
+
" <td>0</td>\n",
|
147 |
+
" <td>32780</td>\n",
|
148 |
+
" <td>0</td>\n",
|
149 |
+
" </tr>\n",
|
150 |
+
" <tr>\n",
|
151 |
+
" <th>4</th>\n",
|
152 |
+
" <td>0.7424</td>\n",
|
153 |
+
" <td>0.6146</td>\n",
|
154 |
+
" <td>0.9135</td>\n",
|
155 |
+
" <td>0.6472</td>\n",
|
156 |
+
" <td>0.4854</td>\n",
|
157 |
+
" <td>0.3784</td>\n",
|
158 |
+
" <td>37.5405</td>\n",
|
159 |
+
" <td>38.4709</td>\n",
|
160 |
+
" <td>40.6486</td>\n",
|
161 |
+
" <td>15</td>\n",
|
162 |
+
" <td>...</td>\n",
|
163 |
+
" <td>BASS1_ST</td>\n",
|
164 |
+
" <td>9999</td>\n",
|
165 |
+
" <td>99.0</td>\n",
|
166 |
+
" <td>NaN</td>\n",
|
167 |
+
" <td>-3</td>\n",
|
168 |
+
" <td>0</td>\n",
|
169 |
+
" <td>0</td>\n",
|
170 |
+
" <td>0</td>\n",
|
171 |
+
" <td>3509</td>\n",
|
172 |
+
" <td>0</td>\n",
|
173 |
+
" </tr>\n",
|
174 |
+
" <tr>\n",
|
175 |
+
" <th>...</th>\n",
|
176 |
+
" <td>...</td>\n",
|
177 |
+
" <td>...</td>\n",
|
178 |
+
" <td>...</td>\n",
|
179 |
+
" <td>...</td>\n",
|
180 |
+
" <td>...</td>\n",
|
181 |
+
" <td>...</td>\n",
|
182 |
+
" <td>...</td>\n",
|
183 |
+
" <td>...</td>\n",
|
184 |
+
" <td>...</td>\n",
|
185 |
+
" <td>...</td>\n",
|
186 |
+
" <td>...</td>\n",
|
187 |
+
" <td>...</td>\n",
|
188 |
+
" <td>...</td>\n",
|
189 |
+
" <td>...</td>\n",
|
190 |
+
" <td>...</td>\n",
|
191 |
+
" <td>...</td>\n",
|
192 |
+
" <td>...</td>\n",
|
193 |
+
" <td>...</td>\n",
|
194 |
+
" <td>...</td>\n",
|
195 |
+
" <td>...</td>\n",
|
196 |
+
" <td>...</td>\n",
|
197 |
+
" </tr>\n",
|
198 |
+
" <tr>\n",
|
199 |
+
" <th>39138</th>\n",
|
200 |
+
" <td>0.6517</td>\n",
|
201 |
+
" <td>1.4560</td>\n",
|
202 |
+
" <td>2.2093</td>\n",
|
203 |
+
" <td>2.5510</td>\n",
|
204 |
+
" <td>3.0505</td>\n",
|
205 |
+
" <td>4.3779</td>\n",
|
206 |
+
" <td>44.6429</td>\n",
|
207 |
+
" <td>47.2831</td>\n",
|
208 |
+
" <td>49.9078</td>\n",
|
209 |
+
" <td>20</td>\n",
|
210 |
+
" <td>...</td>\n",
|
211 |
+
" <td>112000259</td>\n",
|
212 |
+
" <td>3</td>\n",
|
213 |
+
" <td>99.0</td>\n",
|
214 |
+
" <td>311.0</td>\n",
|
215 |
+
" <td>202202</td>\n",
|
216 |
+
" <td>0</td>\n",
|
217 |
+
" <td>0</td>\n",
|
218 |
+
" <td>0</td>\n",
|
219 |
+
" <td>3193</td>\n",
|
220 |
+
" <td>0</td>\n",
|
221 |
+
" </tr>\n",
|
222 |
+
" <tr>\n",
|
223 |
+
" <th>39139</th>\n",
|
224 |
+
" <td>0.3208</td>\n",
|
225 |
+
" <td>0.2805</td>\n",
|
226 |
+
" <td>0.5318</td>\n",
|
227 |
+
" <td>0.7299</td>\n",
|
228 |
+
" <td>0.7317</td>\n",
|
229 |
+
" <td>0.9901</td>\n",
|
230 |
+
" <td>27.7372</td>\n",
|
231 |
+
" <td>30.4878</td>\n",
|
232 |
+
" <td>30.5831</td>\n",
|
233 |
+
" <td>9</td>\n",
|
234 |
+
" <td>...</td>\n",
|
235 |
+
" <td>27031001</td>\n",
|
236 |
+
" <td>1002</td>\n",
|
237 |
+
" <td>4.0</td>\n",
|
238 |
+
" <td>203.0</td>\n",
|
239 |
+
" <td>202110</td>\n",
|
240 |
+
" <td>0</td>\n",
|
241 |
+
" <td>0</td>\n",
|
242 |
+
" <td>0</td>\n",
|
243 |
+
" <td>46717</td>\n",
|
244 |
+
" <td>0</td>\n",
|
245 |
+
" </tr>\n",
|
246 |
+
" <tr>\n",
|
247 |
+
" <th>39140</th>\n",
|
248 |
+
" <td>1.3945</td>\n",
|
249 |
+
" <td>4.3936</td>\n",
|
250 |
+
" <td>3.6663</td>\n",
|
251 |
+
" <td>1.8519</td>\n",
|
252 |
+
" <td>2.1277</td>\n",
|
253 |
+
" <td>2.4476</td>\n",
|
254 |
+
" <td>68.5185</td>\n",
|
255 |
+
" <td>64.7754</td>\n",
|
256 |
+
" <td>63.4615</td>\n",
|
257 |
+
" <td>5</td>\n",
|
258 |
+
" <td>...</td>\n",
|
259 |
+
" <td>NX.01.06.03.100</td>\n",
|
260 |
+
" <td>2104</td>\n",
|
261 |
+
" <td>4.0</td>\n",
|
262 |
+
" <td>119.0</td>\n",
|
263 |
+
" <td>202107</td>\n",
|
264 |
+
" <td>0</td>\n",
|
265 |
+
" <td>0</td>\n",
|
266 |
+
" <td>0</td>\n",
|
267 |
+
" <td>46379</td>\n",
|
268 |
+
" <td>0</td>\n",
|
269 |
+
" </tr>\n",
|
270 |
+
" <tr>\n",
|
271 |
+
" <th>39141</th>\n",
|
272 |
+
" <td>1.3134</td>\n",
|
273 |
+
" <td>0.8997</td>\n",
|
274 |
+
" <td>0.8586</td>\n",
|
275 |
+
" <td>0.3226</td>\n",
|
276 |
+
" <td>0.3333</td>\n",
|
277 |
+
" <td>0.7042</td>\n",
|
278 |
+
" <td>64.1935</td>\n",
|
279 |
+
" <td>62.5000</td>\n",
|
280 |
+
" <td>63.8833</td>\n",
|
281 |
+
" <td>14</td>\n",
|
282 |
+
" <td>...</td>\n",
|
283 |
+
" <td>HB.TS.13.01.G1</td>\n",
|
284 |
+
" <td>NaN</td>\n",
|
285 |
+
" <td>4.0</td>\n",
|
286 |
+
" <td>163.0</td>\n",
|
287 |
+
" <td>202111</td>\n",
|
288 |
+
" <td>0</td>\n",
|
289 |
+
" <td>0</td>\n",
|
290 |
+
" <td>0</td>\n",
|
291 |
+
" <td>12670</td>\n",
|
292 |
+
" <td>0</td>\n",
|
293 |
+
" </tr>\n",
|
294 |
+
" <tr>\n",
|
295 |
+
" <th>39142</th>\n",
|
296 |
+
" <td>3.2597</td>\n",
|
297 |
+
" <td>5.8913</td>\n",
|
298 |
+
" <td>5.7781</td>\n",
|
299 |
+
" <td>7.1429</td>\n",
|
300 |
+
" <td>4.4444</td>\n",
|
301 |
+
" <td>6.3559</td>\n",
|
302 |
+
" <td>43.8776</td>\n",
|
303 |
+
" <td>37.7778</td>\n",
|
304 |
+
" <td>35.5932</td>\n",
|
305 |
+
" <td>8</td>\n",
|
306 |
+
" <td>...</td>\n",
|
307 |
+
" <td>10191125</td>\n",
|
308 |
+
" <td>2103</td>\n",
|
309 |
+
" <td>99.0</td>\n",
|
310 |
+
" <td>250.0</td>\n",
|
311 |
+
" <td>202111</td>\n",
|
312 |
+
" <td>1</td>\n",
|
313 |
+
" <td>0</td>\n",
|
314 |
+
" <td>0</td>\n",
|
315 |
+
" <td>43570</td>\n",
|
316 |
+
" <td>0</td>\n",
|
317 |
+
" </tr>\n",
|
318 |
+
" </tbody>\n",
|
319 |
+
"</table>\n",
|
320 |
+
"<p>39143 rows × 85 columns</p>\n",
|
321 |
+
"</div>"
|
322 |
+
],
|
323 |
+
"text/plain": [
|
324 |
+
" night_call_dura_rate l3m_night_call_dura_rate \\\n",
|
325 |
+
"0 1.2726 0.5082 \n",
|
326 |
+
"1 8.4315 3.6997 \n",
|
327 |
+
"2 5.0105 4.7252 \n",
|
328 |
+
"3 1.4925 0.6083 \n",
|
329 |
+
"4 0.7424 0.6146 \n",
|
330 |
+
"... ... ... \n",
|
331 |
+
"39138 0.6517 1.4560 \n",
|
332 |
+
"39139 0.3208 0.2805 \n",
|
333 |
+
"39140 1.3945 4.3936 \n",
|
334 |
+
"39141 1.3134 0.8997 \n",
|
335 |
+
"39142 3.2597 5.8913 \n",
|
336 |
+
"\n",
|
337 |
+
" l6m_night_call_dura_rate night_call_cnt_rate l3m_night_call_cnt_rate \\\n",
|
338 |
+
"0 5.5138 3.1250 2.1277 \n",
|
339 |
+
"1 2.0436 6.9767 2.0305 \n",
|
340 |
+
"2 3.5456 7.6923 7.3684 \n",
|
341 |
+
"3 2.8386 3.8462 2.2222 \n",
|
342 |
+
"4 0.9135 0.6472 0.4854 \n",
|
343 |
+
"... ... ... ... \n",
|
344 |
+
"39138 2.2093 2.5510 3.0505 \n",
|
345 |
+
"39139 0.5318 0.7299 0.7317 \n",
|
346 |
+
"39140 3.6663 1.8519 2.1277 \n",
|
347 |
+
"39141 0.8586 0.3226 0.3333 \n",
|
348 |
+
"39142 5.7781 7.1429 4.4444 \n",
|
349 |
+
"\n",
|
350 |
+
" l6m_night_call_cnt_rate called_cnt_rate l3m_called_cnt_rate \\\n",
|
351 |
+
"0 4.6512 87.5000 88.2979 \n",
|
352 |
+
"1 1.3298 76.7442 72.0812 \n",
|
353 |
+
"2 5.4526 49.0385 55.5263 \n",
|
354 |
+
"3 5.6604 19.2308 46.6667 \n",
|
355 |
+
"4 0.3784 37.5405 38.4709 \n",
|
356 |
+
"... ... ... ... \n",
|
357 |
+
"39138 4.3779 44.6429 47.2831 \n",
|
358 |
+
"39139 0.9901 27.7372 30.4878 \n",
|
359 |
+
"39140 2.4476 68.5185 64.7754 \n",
|
360 |
+
"39141 0.7042 64.1935 62.5000 \n",
|
361 |
+
"39142 6.3559 43.8776 37.7778 \n",
|
362 |
+
"\n",
|
363 |
+
" l6m_called_cnt_rate contact_ratio ... rcn_chnl_id rcn_chnl_typ \\\n",
|
364 |
+
"0 84.3023 1 ... 30507 3 \n",
|
365 |
+
"1 67.8191 3 ... GZ_GZPY0612038 NaN \n",
|
366 |
+
"2 56.4885 7 ... 218568 NaN \n",
|
367 |
+
"3 52.8302 0 ... 2.25E+18 NaN \n",
|
368 |
+
"4 40.6486 15 ... BASS1_ST 9999 \n",
|
369 |
+
"... ... ... ... ... ... \n",
|
370 |
+
"39138 49.9078 20 ... 112000259 3 \n",
|
371 |
+
"39139 30.5831 9 ... 27031001 1002 \n",
|
372 |
+
"39140 63.4615 5 ... NX.01.06.03.100 2104 \n",
|
373 |
+
"39141 63.8833 14 ... HB.TS.13.01.G1 NaN \n",
|
374 |
+
"39142 35.5932 8 ... 10191125 2103 \n",
|
375 |
+
"\n",
|
376 |
+
" rcn_mode user_star_val star_evalu_tm is_fam_v_ntw is_camp_user \\\n",
|
377 |
+
"0 4.0 198.0 202110 0 0 \n",
|
378 |
+
"1 4.0 91.0 202207 0 0 \n",
|
379 |
+
"2 4.0 NaN -3 1 1 \n",
|
380 |
+
"3 4.0 133.0 202112 1 1 \n",
|
381 |
+
"4 99.0 NaN -3 0 0 \n",
|
382 |
+
"... ... ... ... ... ... \n",
|
383 |
+
"39138 99.0 311.0 202202 0 0 \n",
|
384 |
+
"39139 4.0 203.0 202110 0 0 \n",
|
385 |
+
"39140 4.0 119.0 202107 0 0 \n",
|
386 |
+
"39141 4.0 163.0 202111 0 0 \n",
|
387 |
+
"39142 99.0 250.0 202111 1 0 \n",
|
388 |
+
"\n",
|
389 |
+
" is_camp_area_user row_num label \n",
|
390 |
+
"0 0 29833 0 \n",
|
391 |
+
"1 0 18121 0 \n",
|
392 |
+
"2 0 8372 0 \n",
|
393 |
+
"3 0 32780 0 \n",
|
394 |
+
"4 0 3509 0 \n",
|
395 |
+
"... ... ... ... \n",
|
396 |
+
"39138 0 3193 0 \n",
|
397 |
+
"39139 0 46717 0 \n",
|
398 |
+
"39140 0 46379 0 \n",
|
399 |
+
"39141 0 12670 0 \n",
|
400 |
+
"39142 0 43570 0 \n",
|
401 |
+
"\n",
|
402 |
+
"[39143 rows x 85 columns]"
|
403 |
+
]
|
404 |
+
},
|
405 |
+
"execution_count": 1,
|
406 |
+
"metadata": {},
|
407 |
+
"output_type": "execute_result"
|
408 |
+
}
|
409 |
+
],
|
410 |
+
"source": [
|
411 |
+
"import numpy as np\n",
|
412 |
+
"import pandas as pd\n",
|
413 |
+
"import os\n",
|
414 |
+
"import warnings\n",
|
415 |
+
"warnings.filterwarnings('ignore')\n",
|
416 |
+
"\n",
|
417 |
+
"data1=pd.read_csv('csvdata/train_a_label.csv', encoding='gbk')\n",
|
418 |
+
"data2=pd.read_csv('csvdata/train_b.csv')\n",
|
419 |
+
"data3=pd.read_csv('csvdata/test_a.csv', encoding='gbk')\n",
|
420 |
+
"data4=pd.read_csv('csvdata/test_b.csv')\n",
|
421 |
+
"data1"
|
422 |
+
]
|
423 |
+
},
|
424 |
+
{
|
425 |
+
"cell_type": "code",
|
426 |
+
"execution_count": 2,
|
427 |
+
"id": "deadly-torture",
|
428 |
+
"metadata": {
|
429 |
+
"scrolled": true
|
430 |
+
},
|
431 |
+
"outputs": [],
|
432 |
+
"source": [
|
433 |
+
"#补0\n",
|
434 |
+
"data1=data1.fillna(-1)\n",
|
435 |
+
"data2=data2.fillna(-1)\n",
|
436 |
+
"data3=data3.fillna(-1)\n",
|
437 |
+
"data4=data4.fillna(-1)\n",
|
438 |
+
"\n",
|
439 |
+
"data1=data1[['row_num'] + data1.drop(labels=['row_num'],axis=1).columns.tolist() ] \n",
|
440 |
+
"data2=data2[['row_num'] + data2.drop(labels=['row_num'],axis=1).columns.tolist() ] \n",
|
441 |
+
"data3=data3[['row_num'] + data3.drop(labels=['row_num'],axis=1).columns.tolist() ] \n",
|
442 |
+
"data4=data4[['row_num'] + data4.drop(labels=['row_num'],axis=1).columns.tolist() ] \n"
|
443 |
+
]
|
444 |
+
},
|
445 |
+
{
|
446 |
+
"cell_type": "code",
|
447 |
+
"execution_count": 3,
|
448 |
+
"id": "narrow-feedback",
|
449 |
+
"metadata": {},
|
450 |
+
"outputs": [
|
451 |
+
{
|
452 |
+
"data": {
|
453 |
+
"text/html": [
|
454 |
+
"<div>\n",
|
455 |
+
"<style scoped>\n",
|
456 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
457 |
+
" vertical-align: middle;\n",
|
458 |
+
" }\n",
|
459 |
+
"\n",
|
460 |
+
" .dataframe tbody tr th {\n",
|
461 |
+
" vertical-align: top;\n",
|
462 |
+
" }\n",
|
463 |
+
"\n",
|
464 |
+
" .dataframe thead th {\n",
|
465 |
+
" text-align: right;\n",
|
466 |
+
" }\n",
|
467 |
+
"</style>\n",
|
468 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
469 |
+
" <thead>\n",
|
470 |
+
" <tr style=\"text-align: right;\">\n",
|
471 |
+
" <th></th>\n",
|
472 |
+
" <th>row_num</th>\n",
|
473 |
+
" <th>label</th>\n",
|
474 |
+
" <th>user_star_val</th>\n",
|
475 |
+
" <th>night_call_dura_rate</th>\n",
|
476 |
+
" <th>night_call_cnt_rate</th>\n",
|
477 |
+
" <th>age</th>\n",
|
478 |
+
" <th>cust_star</th>\n",
|
479 |
+
" <th>opp_belo_cnt</th>\n",
|
480 |
+
" <th>rcn_mode</th>\n",
|
481 |
+
" <th>l6m_night_call_cnt_rate</th>\n",
|
482 |
+
" <th>night_percent_six</th>\n",
|
483 |
+
" <th>brand_id</th>\n",
|
484 |
+
" </tr>\n",
|
485 |
+
" </thead>\n",
|
486 |
+
" <tbody>\n",
|
487 |
+
" <tr>\n",
|
488 |
+
" <th>0</th>\n",
|
489 |
+
" <td>29833</td>\n",
|
490 |
+
" <td>0</td>\n",
|
491 |
+
" <td>198.0</td>\n",
|
492 |
+
" <td>1.2726</td>\n",
|
493 |
+
" <td>3.1250</td>\n",
|
494 |
+
" <td>2</td>\n",
|
495 |
+
" <td>4.0</td>\n",
|
496 |
+
" <td>5</td>\n",
|
497 |
+
" <td>4.0</td>\n",
|
498 |
+
" <td>4.6512</td>\n",
|
499 |
+
" <td>5.11</td>\n",
|
500 |
+
" <td>2</td>\n",
|
501 |
+
" </tr>\n",
|
502 |
+
" <tr>\n",
|
503 |
+
" <th>1</th>\n",
|
504 |
+
" <td>18121</td>\n",
|
505 |
+
" <td>0</td>\n",
|
506 |
+
" <td>91.0</td>\n",
|
507 |
+
" <td>8.4315</td>\n",
|
508 |
+
" <td>6.9767</td>\n",
|
509 |
+
" <td>1</td>\n",
|
510 |
+
" <td>6.0</td>\n",
|
511 |
+
" <td>3</td>\n",
|
512 |
+
" <td>4.0</td>\n",
|
513 |
+
" <td>1.3298</td>\n",
|
514 |
+
" <td>17.64</td>\n",
|
515 |
+
" <td>2</td>\n",
|
516 |
+
" </tr>\n",
|
517 |
+
" <tr>\n",
|
518 |
+
" <th>2</th>\n",
|
519 |
+
" <td>8372</td>\n",
|
520 |
+
" <td>0</td>\n",
|
521 |
+
" <td>-1.0</td>\n",
|
522 |
+
" <td>5.0105</td>\n",
|
523 |
+
" <td>7.6923</td>\n",
|
524 |
+
" <td>4</td>\n",
|
525 |
+
" <td>-1.0</td>\n",
|
526 |
+
" <td>3</td>\n",
|
527 |
+
" <td>4.0</td>\n",
|
528 |
+
" <td>5.4526</td>\n",
|
529 |
+
" <td>12.70</td>\n",
|
530 |
+
" <td>2</td>\n",
|
531 |
+
" </tr>\n",
|
532 |
+
" <tr>\n",
|
533 |
+
" <th>3</th>\n",
|
534 |
+
" <td>32780</td>\n",
|
535 |
+
" <td>0</td>\n",
|
536 |
+
" <td>133.0</td>\n",
|
537 |
+
" <td>1.4925</td>\n",
|
538 |
+
" <td>3.8462</td>\n",
|
539 |
+
" <td>2</td>\n",
|
540 |
+
" <td>7.0</td>\n",
|
541 |
+
" <td>3</td>\n",
|
542 |
+
" <td>4.0</td>\n",
|
543 |
+
" <td>5.6604</td>\n",
|
544 |
+
" <td>2.83</td>\n",
|
545 |
+
" <td>1</td>\n",
|
546 |
+
" </tr>\n",
|
547 |
+
" <tr>\n",
|
548 |
+
" <th>4</th>\n",
|
549 |
+
" <td>3509</td>\n",
|
550 |
+
" <td>0</td>\n",
|
551 |
+
" <td>-1.0</td>\n",
|
552 |
+
" <td>0.7424</td>\n",
|
553 |
+
" <td>0.6472</td>\n",
|
554 |
+
" <td>6</td>\n",
|
555 |
+
" <td>-1.0</td>\n",
|
556 |
+
" <td>3</td>\n",
|
557 |
+
" <td>99.0</td>\n",
|
558 |
+
" <td>0.3784</td>\n",
|
559 |
+
" <td>6.18</td>\n",
|
560 |
+
" <td>1</td>\n",
|
561 |
+
" </tr>\n",
|
562 |
+
" <tr>\n",
|
563 |
+
" <th>...</th>\n",
|
564 |
+
" <td>...</td>\n",
|
565 |
+
" <td>...</td>\n",
|
566 |
+
" <td>...</td>\n",
|
567 |
+
" <td>...</td>\n",
|
568 |
+
" <td>...</td>\n",
|
569 |
+
" <td>...</td>\n",
|
570 |
+
" <td>...</td>\n",
|
571 |
+
" <td>...</td>\n",
|
572 |
+
" <td>...</td>\n",
|
573 |
+
" <td>...</td>\n",
|
574 |
+
" <td>...</td>\n",
|
575 |
+
" <td>...</td>\n",
|
576 |
+
" </tr>\n",
|
577 |
+
" <tr>\n",
|
578 |
+
" <th>39138</th>\n",
|
579 |
+
" <td>3193</td>\n",
|
580 |
+
" <td>0</td>\n",
|
581 |
+
" <td>311.0</td>\n",
|
582 |
+
" <td>0.6517</td>\n",
|
583 |
+
" <td>2.5510</td>\n",
|
584 |
+
" <td>5</td>\n",
|
585 |
+
" <td>4.0</td>\n",
|
586 |
+
" <td>3</td>\n",
|
587 |
+
" <td>99.0</td>\n",
|
588 |
+
" <td>4.3779</td>\n",
|
589 |
+
" <td>11.52</td>\n",
|
590 |
+
" <td>2</td>\n",
|
591 |
+
" </tr>\n",
|
592 |
+
" <tr>\n",
|
593 |
+
" <th>39139</th>\n",
|
594 |
+
" <td>46717</td>\n",
|
595 |
+
" <td>0</td>\n",
|
596 |
+
" <td>203.0</td>\n",
|
597 |
+
" <td>0.3208</td>\n",
|
598 |
+
" <td>0.7299</td>\n",
|
599 |
+
" <td>3</td>\n",
|
600 |
+
" <td>5.0</td>\n",
|
601 |
+
" <td>4</td>\n",
|
602 |
+
" <td>4.0</td>\n",
|
603 |
+
" <td>0.9901</td>\n",
|
604 |
+
" <td>11.19</td>\n",
|
605 |
+
" <td>1</td>\n",
|
606 |
+
" </tr>\n",
|
607 |
+
" <tr>\n",
|
608 |
+
" <th>39140</th>\n",
|
609 |
+
" <td>46379</td>\n",
|
610 |
+
" <td>0</td>\n",
|
611 |
+
" <td>119.0</td>\n",
|
612 |
+
" <td>1.3945</td>\n",
|
613 |
+
" <td>1.8519</td>\n",
|
614 |
+
" <td>3</td>\n",
|
615 |
+
" <td>5.0</td>\n",
|
616 |
+
" <td>4</td>\n",
|
617 |
+
" <td>4.0</td>\n",
|
618 |
+
" <td>2.4476</td>\n",
|
619 |
+
" <td>30.93</td>\n",
|
620 |
+
" <td>1</td>\n",
|
621 |
+
" </tr>\n",
|
622 |
+
" <tr>\n",
|
623 |
+
" <th>39141</th>\n",
|
624 |
+
" <td>12670</td>\n",
|
625 |
+
" <td>0</td>\n",
|
626 |
+
" <td>163.0</td>\n",
|
627 |
+
" <td>1.3134</td>\n",
|
628 |
+
" <td>0.3226</td>\n",
|
629 |
+
" <td>6</td>\n",
|
630 |
+
" <td>5.0</td>\n",
|
631 |
+
" <td>2</td>\n",
|
632 |
+
" <td>4.0</td>\n",
|
633 |
+
" <td>0.7042</td>\n",
|
634 |
+
" <td>36.48</td>\n",
|
635 |
+
" <td>1</td>\n",
|
636 |
+
" </tr>\n",
|
637 |
+
" <tr>\n",
|
638 |
+
" <th>39142</th>\n",
|
639 |
+
" <td>43570</td>\n",
|
640 |
+
" <td>0</td>\n",
|
641 |
+
" <td>250.0</td>\n",
|
642 |
+
" <td>3.2597</td>\n",
|
643 |
+
" <td>7.1429</td>\n",
|
644 |
+
" <td>4</td>\n",
|
645 |
+
" <td>5.0</td>\n",
|
646 |
+
" <td>5</td>\n",
|
647 |
+
" <td>99.0</td>\n",
|
648 |
+
" <td>6.3559</td>\n",
|
649 |
+
" <td>24.18</td>\n",
|
650 |
+
" <td>1</td>\n",
|
651 |
+
" </tr>\n",
|
652 |
+
" </tbody>\n",
|
653 |
+
"</table>\n",
|
654 |
+
"<p>39143 rows × 12 columns</p>\n",
|
655 |
+
"</div>"
|
656 |
+
],
|
657 |
+
"text/plain": [
|
658 |
+
" row_num label user_star_val night_call_dura_rate \\\n",
|
659 |
+
"0 29833 0 198.0 1.2726 \n",
|
660 |
+
"1 18121 0 91.0 8.4315 \n",
|
661 |
+
"2 8372 0 -1.0 5.0105 \n",
|
662 |
+
"3 32780 0 133.0 1.4925 \n",
|
663 |
+
"4 3509 0 -1.0 0.7424 \n",
|
664 |
+
"... ... ... ... ... \n",
|
665 |
+
"39138 3193 0 311.0 0.6517 \n",
|
666 |
+
"39139 46717 0 203.0 0.3208 \n",
|
667 |
+
"39140 46379 0 119.0 1.3945 \n",
|
668 |
+
"39141 12670 0 163.0 1.3134 \n",
|
669 |
+
"39142 43570 0 250.0 3.2597 \n",
|
670 |
+
"\n",
|
671 |
+
" night_call_cnt_rate age cust_star opp_belo_cnt rcn_mode \\\n",
|
672 |
+
"0 3.1250 2 4.0 5 4.0 \n",
|
673 |
+
"1 6.9767 1 6.0 3 4.0 \n",
|
674 |
+
"2 7.6923 4 -1.0 3 4.0 \n",
|
675 |
+
"3 3.8462 2 7.0 3 4.0 \n",
|
676 |
+
"4 0.6472 6 -1.0 3 99.0 \n",
|
677 |
+
"... ... ... ... ... ... \n",
|
678 |
+
"39138 2.5510 5 4.0 3 99.0 \n",
|
679 |
+
"39139 0.7299 3 5.0 4 4.0 \n",
|
680 |
+
"39140 1.8519 3 5.0 4 4.0 \n",
|
681 |
+
"39141 0.3226 6 5.0 2 4.0 \n",
|
682 |
+
"39142 7.1429 4 5.0 5 99.0 \n",
|
683 |
+
"\n",
|
684 |
+
" l6m_night_call_cnt_rate night_percent_six brand_id \n",
|
685 |
+
"0 4.6512 5.11 2 \n",
|
686 |
+
"1 1.3298 17.64 2 \n",
|
687 |
+
"2 5.4526 12.70 2 \n",
|
688 |
+
"3 5.6604 2.83 1 \n",
|
689 |
+
"4 0.3784 6.18 1 \n",
|
690 |
+
"... ... ... ... \n",
|
691 |
+
"39138 4.3779 11.52 2 \n",
|
692 |
+
"39139 0.9901 11.19 1 \n",
|
693 |
+
"39140 2.4476 30.93 1 \n",
|
694 |
+
"39141 0.7042 36.48 1 \n",
|
695 |
+
"39142 6.3559 24.18 1 \n",
|
696 |
+
"\n",
|
697 |
+
"[39143 rows x 12 columns]"
|
698 |
+
]
|
699 |
+
},
|
700 |
+
"execution_count": 3,
|
701 |
+
"metadata": {},
|
702 |
+
"output_type": "execute_result"
|
703 |
+
}
|
704 |
+
],
|
705 |
+
"source": [
|
706 |
+
"#data1=data1.drop(labels=['pretty_num_typ','rcn_chnl_id','rcn_chnl_typ','star_evalu_tm','star_evalu_tm', 'top5_call_dura_rate', 'l6m_once_numbers_rate', 'once_numbers_rate', 'l6m_contact_ratio', 'l3m_top10_call_cnt_rate', 'l3m_top5_call_cnt_rate', 'l6m_top10_call_dura_rate', 'l3m_is_same_imei_msisdn_cnt_gtr2', 'top10_call_dura_rate', 'ocpn_code', 'top5_call_cnt_rate', 'top10_opp_belo_cnt', 'educat_degree_code', 'l6m_top10_opp_belo_cnt', 'l3m_once_numbers_rate', 'l3m_top10_opp_belo_cnt', 'l3m_contact_ratio', 'l6m_top5_call_dura_rate', 'pre3m_top10_diff_num', 'age_lvl', 'top10_diff_num', 'same_idcard_msisdn_cnt', 'pre3m_top5_diff_num', 'l3m_id_cnt', 'l3m_top10_call_dura_rate', 'pre2m_top10_diff_num', 'top10_call_cnt_rate', 'contact_ratio', 'top5_opp_belo_cnt', 'is_pretty_num', 'l3m_top5_opp_belo_cnt', 'pre2m_top5_diff_num', 'l1m_is_same_imei_msisdn_cnt_gtr2', 'sex', 'same_imei_msisdn_hr_cnt', 'l6m_top5_opp_belo_cnt', 'is_fam_v_ntw', 'top5_diff_num', 'is_camp_user', 'idty_typ', 'zuche_six_total_dur', 'vip_lvl'],axis=1)\n",
|
707 |
+
"data1=data1[['row_num','label','user_star_val','night_call_dura_rate', 'night_call_cnt_rate', 'age', 'cust_star', 'opp_belo_cnt', 'rcn_mode', 'l6m_night_call_cnt_rate', 'night_percent_six', 'brand_id']]\n",
|
708 |
+
"#, 'star_evalu_tm', 'l3m_called_cnt_rate', 'night_percent_current', 'l6m_called_cnt_rate', 'l3m_night_call_dura_rate'\n",
|
709 |
+
"data1['age']=data1['age']//10\n",
|
710 |
+
"data1.to_csv(path_or_buf='csvclear/train_a_label.csv', index=None) \n",
|
711 |
+
"\n",
|
712 |
+
"\n",
|
713 |
+
"#data3=data3.drop(labels=['pretty_num_typ','rcn_chnl_id','rcn_chnl_typ','star_evalu_tm', 'top5_call_dura_rate', 'l6m_once_numbers_rate', 'once_numbers_rate', 'l6m_contact_ratio', 'l3m_top10_call_cnt_rate', 'l3m_top5_call_cnt_rate', 'l6m_top10_call_dura_rate', 'l3m_is_same_imei_msisdn_cnt_gtr2', 'top10_call_dura_rate', 'ocpn_code', 'top5_call_cnt_rate', 'top10_opp_belo_cnt', 'educat_degree_code', 'l6m_top10_opp_belo_cnt', 'l3m_once_numbers_rate', 'l3m_top10_opp_belo_cnt', 'l3m_contact_ratio', 'l6m_top5_call_dura_rate', 'pre3m_top10_diff_num', 'age_lvl', 'top10_diff_num', 'same_idcard_msisdn_cnt', 'pre3m_top5_diff_num', 'l3m_id_cnt', 'l3m_top10_call_dura_rate', 'pre2m_top10_diff_num', 'top10_call_cnt_rate', 'contact_ratio', 'top5_opp_belo_cnt', 'is_pretty_num', 'l3m_top5_opp_belo_cnt', 'pre2m_top5_diff_num', 'l1m_is_same_imei_msisdn_cnt_gtr2', 'sex', 'same_imei_msisdn_hr_cnt', 'l6m_top5_opp_belo_cnt', 'is_fam_v_ntw', 'top5_diff_num', 'is_camp_user', 'idty_typ', 'zuche_six_total_dur', 'vip_lvl'],axis=1)\n",
|
714 |
+
"data3=data3[['row_num','user_star_val', 'star_evalu_tm','night_call_dura_rate', 'night_call_cnt_rate', 'age', 'cust_star', 'opp_belo_cnt', 'rcn_mode', 'l6m_night_call_cnt_rate', 'night_percent_six', 'brand_id']]\n",
|
715 |
+
"#data3=data3[['row_num'] + data3.drop(labels=['row_num'],axis=1).columns.tolist() ] \n",
|
716 |
+
"data3['age']=data3['age']//10\n",
|
717 |
+
"\n",
|
718 |
+
"data3.to_csv(path_or_buf='csvclear/test_a.csv', index=None) \n",
|
719 |
+
"data1"
|
720 |
+
]
|
721 |
+
},
|
722 |
+
{
|
723 |
+
"cell_type": "code",
|
724 |
+
"execution_count": 4,
|
725 |
+
"id": "supposed-composer",
|
726 |
+
"metadata": {},
|
727 |
+
"outputs": [
|
728 |
+
{
|
729 |
+
"data": {
|
730 |
+
"text/html": [
|
731 |
+
"<div>\n",
|
732 |
+
"<style scoped>\n",
|
733 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
734 |
+
" vertical-align: middle;\n",
|
735 |
+
" }\n",
|
736 |
+
"\n",
|
737 |
+
" .dataframe tbody tr th {\n",
|
738 |
+
" vertical-align: top;\n",
|
739 |
+
" }\n",
|
740 |
+
"\n",
|
741 |
+
" .dataframe thead th {\n",
|
742 |
+
" text-align: right;\n",
|
743 |
+
" }\n",
|
744 |
+
"</style>\n",
|
745 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
746 |
+
" <thead>\n",
|
747 |
+
" <tr style=\"text-align: right;\">\n",
|
748 |
+
" <th></th>\n",
|
749 |
+
" <th>row_num</th>\n",
|
750 |
+
" <th>label</th>\n",
|
751 |
+
" <th>user_star_val</th>\n",
|
752 |
+
" <th>night_call_dura_rate</th>\n",
|
753 |
+
" <th>night_call_cnt_rate</th>\n",
|
754 |
+
" <th>age</th>\n",
|
755 |
+
" <th>cust_star</th>\n",
|
756 |
+
" <th>opp_belo_cnt</th>\n",
|
757 |
+
" <th>rcn_mode</th>\n",
|
758 |
+
" <th>l6m_night_call_cnt_rate</th>\n",
|
759 |
+
" <th>night_percent_six</th>\n",
|
760 |
+
" <th>brand_id</th>\n",
|
761 |
+
" </tr>\n",
|
762 |
+
" </thead>\n",
|
763 |
+
" <tbody>\n",
|
764 |
+
" <tr>\n",
|
765 |
+
" <th>0</th>\n",
|
766 |
+
" <td>29833</td>\n",
|
767 |
+
" <td>0</td>\n",
|
768 |
+
" <td>198.0</td>\n",
|
769 |
+
" <td>1.2726</td>\n",
|
770 |
+
" <td>3.1250</td>\n",
|
771 |
+
" <td>2</td>\n",
|
772 |
+
" <td>4.0</td>\n",
|
773 |
+
" <td>5</td>\n",
|
774 |
+
" <td>4.0</td>\n",
|
775 |
+
" <td>4.6512</td>\n",
|
776 |
+
" <td>5.11</td>\n",
|
777 |
+
" <td>2</td>\n",
|
778 |
+
" </tr>\n",
|
779 |
+
" <tr>\n",
|
780 |
+
" <th>1</th>\n",
|
781 |
+
" <td>18121</td>\n",
|
782 |
+
" <td>0</td>\n",
|
783 |
+
" <td>91.0</td>\n",
|
784 |
+
" <td>8.4315</td>\n",
|
785 |
+
" <td>6.9767</td>\n",
|
786 |
+
" <td>1</td>\n",
|
787 |
+
" <td>6.0</td>\n",
|
788 |
+
" <td>3</td>\n",
|
789 |
+
" <td>4.0</td>\n",
|
790 |
+
" <td>1.3298</td>\n",
|
791 |
+
" <td>17.64</td>\n",
|
792 |
+
" <td>2</td>\n",
|
793 |
+
" </tr>\n",
|
794 |
+
" <tr>\n",
|
795 |
+
" <th>2</th>\n",
|
796 |
+
" <td>8372</td>\n",
|
797 |
+
" <td>0</td>\n",
|
798 |
+
" <td>-1.0</td>\n",
|
799 |
+
" <td>5.0105</td>\n",
|
800 |
+
" <td>7.6923</td>\n",
|
801 |
+
" <td>4</td>\n",
|
802 |
+
" <td>-1.0</td>\n",
|
803 |
+
" <td>3</td>\n",
|
804 |
+
" <td>4.0</td>\n",
|
805 |
+
" <td>5.4526</td>\n",
|
806 |
+
" <td>12.70</td>\n",
|
807 |
+
" <td>2</td>\n",
|
808 |
+
" </tr>\n",
|
809 |
+
" <tr>\n",
|
810 |
+
" <th>3</th>\n",
|
811 |
+
" <td>32780</td>\n",
|
812 |
+
" <td>0</td>\n",
|
813 |
+
" <td>133.0</td>\n",
|
814 |
+
" <td>1.4925</td>\n",
|
815 |
+
" <td>3.8462</td>\n",
|
816 |
+
" <td>2</td>\n",
|
817 |
+
" <td>7.0</td>\n",
|
818 |
+
" <td>3</td>\n",
|
819 |
+
" <td>4.0</td>\n",
|
820 |
+
" <td>5.6604</td>\n",
|
821 |
+
" <td>2.83</td>\n",
|
822 |
+
" <td>1</td>\n",
|
823 |
+
" </tr>\n",
|
824 |
+
" <tr>\n",
|
825 |
+
" <th>4</th>\n",
|
826 |
+
" <td>3509</td>\n",
|
827 |
+
" <td>0</td>\n",
|
828 |
+
" <td>-1.0</td>\n",
|
829 |
+
" <td>0.7424</td>\n",
|
830 |
+
" <td>0.6472</td>\n",
|
831 |
+
" <td>6</td>\n",
|
832 |
+
" <td>-1.0</td>\n",
|
833 |
+
" <td>3</td>\n",
|
834 |
+
" <td>99.0</td>\n",
|
835 |
+
" <td>0.3784</td>\n",
|
836 |
+
" <td>6.18</td>\n",
|
837 |
+
" <td>1</td>\n",
|
838 |
+
" </tr>\n",
|
839 |
+
" <tr>\n",
|
840 |
+
" <th>...</th>\n",
|
841 |
+
" <td>...</td>\n",
|
842 |
+
" <td>...</td>\n",
|
843 |
+
" <td>...</td>\n",
|
844 |
+
" <td>...</td>\n",
|
845 |
+
" <td>...</td>\n",
|
846 |
+
" <td>...</td>\n",
|
847 |
+
" <td>...</td>\n",
|
848 |
+
" <td>...</td>\n",
|
849 |
+
" <td>...</td>\n",
|
850 |
+
" <td>...</td>\n",
|
851 |
+
" <td>...</td>\n",
|
852 |
+
" <td>...</td>\n",
|
853 |
+
" </tr>\n",
|
854 |
+
" <tr>\n",
|
855 |
+
" <th>39138</th>\n",
|
856 |
+
" <td>3193</td>\n",
|
857 |
+
" <td>0</td>\n",
|
858 |
+
" <td>311.0</td>\n",
|
859 |
+
" <td>0.6517</td>\n",
|
860 |
+
" <td>2.5510</td>\n",
|
861 |
+
" <td>5</td>\n",
|
862 |
+
" <td>4.0</td>\n",
|
863 |
+
" <td>3</td>\n",
|
864 |
+
" <td>99.0</td>\n",
|
865 |
+
" <td>4.3779</td>\n",
|
866 |
+
" <td>11.52</td>\n",
|
867 |
+
" <td>2</td>\n",
|
868 |
+
" </tr>\n",
|
869 |
+
" <tr>\n",
|
870 |
+
" <th>39139</th>\n",
|
871 |
+
" <td>46717</td>\n",
|
872 |
+
" <td>0</td>\n",
|
873 |
+
" <td>203.0</td>\n",
|
874 |
+
" <td>0.3208</td>\n",
|
875 |
+
" <td>0.7299</td>\n",
|
876 |
+
" <td>3</td>\n",
|
877 |
+
" <td>5.0</td>\n",
|
878 |
+
" <td>4</td>\n",
|
879 |
+
" <td>4.0</td>\n",
|
880 |
+
" <td>0.9901</td>\n",
|
881 |
+
" <td>11.19</td>\n",
|
882 |
+
" <td>1</td>\n",
|
883 |
+
" </tr>\n",
|
884 |
+
" <tr>\n",
|
885 |
+
" <th>39140</th>\n",
|
886 |
+
" <td>46379</td>\n",
|
887 |
+
" <td>0</td>\n",
|
888 |
+
" <td>119.0</td>\n",
|
889 |
+
" <td>1.3945</td>\n",
|
890 |
+
" <td>1.8519</td>\n",
|
891 |
+
" <td>3</td>\n",
|
892 |
+
" <td>5.0</td>\n",
|
893 |
+
" <td>4</td>\n",
|
894 |
+
" <td>4.0</td>\n",
|
895 |
+
" <td>2.4476</td>\n",
|
896 |
+
" <td>30.93</td>\n",
|
897 |
+
" <td>1</td>\n",
|
898 |
+
" </tr>\n",
|
899 |
+
" <tr>\n",
|
900 |
+
" <th>39141</th>\n",
|
901 |
+
" <td>12670</td>\n",
|
902 |
+
" <td>0</td>\n",
|
903 |
+
" <td>163.0</td>\n",
|
904 |
+
" <td>1.3134</td>\n",
|
905 |
+
" <td>0.3226</td>\n",
|
906 |
+
" <td>6</td>\n",
|
907 |
+
" <td>5.0</td>\n",
|
908 |
+
" <td>2</td>\n",
|
909 |
+
" <td>4.0</td>\n",
|
910 |
+
" <td>0.7042</td>\n",
|
911 |
+
" <td>36.48</td>\n",
|
912 |
+
" <td>1</td>\n",
|
913 |
+
" </tr>\n",
|
914 |
+
" <tr>\n",
|
915 |
+
" <th>39142</th>\n",
|
916 |
+
" <td>43570</td>\n",
|
917 |
+
" <td>0</td>\n",
|
918 |
+
" <td>250.0</td>\n",
|
919 |
+
" <td>3.2597</td>\n",
|
920 |
+
" <td>7.1429</td>\n",
|
921 |
+
" <td>4</td>\n",
|
922 |
+
" <td>5.0</td>\n",
|
923 |
+
" <td>5</td>\n",
|
924 |
+
" <td>99.0</td>\n",
|
925 |
+
" <td>6.3559</td>\n",
|
926 |
+
" <td>24.18</td>\n",
|
927 |
+
" <td>1</td>\n",
|
928 |
+
" </tr>\n",
|
929 |
+
" </tbody>\n",
|
930 |
+
"</table>\n",
|
931 |
+
"<p>39143 rows × 12 columns</p>\n",
|
932 |
+
"</div>"
|
933 |
+
],
|
934 |
+
"text/plain": [
|
935 |
+
" row_num label user_star_val night_call_dura_rate \\\n",
|
936 |
+
"0 29833 0 198.0 1.2726 \n",
|
937 |
+
"1 18121 0 91.0 8.4315 \n",
|
938 |
+
"2 8372 0 -1.0 5.0105 \n",
|
939 |
+
"3 32780 0 133.0 1.4925 \n",
|
940 |
+
"4 3509 0 -1.0 0.7424 \n",
|
941 |
+
"... ... ... ... ... \n",
|
942 |
+
"39138 3193 0 311.0 0.6517 \n",
|
943 |
+
"39139 46717 0 203.0 0.3208 \n",
|
944 |
+
"39140 46379 0 119.0 1.3945 \n",
|
945 |
+
"39141 12670 0 163.0 1.3134 \n",
|
946 |
+
"39142 43570 0 250.0 3.2597 \n",
|
947 |
+
"\n",
|
948 |
+
" night_call_cnt_rate age cust_star opp_belo_cnt rcn_mode \\\n",
|
949 |
+
"0 3.1250 2 4.0 5 4.0 \n",
|
950 |
+
"1 6.9767 1 6.0 3 4.0 \n",
|
951 |
+
"2 7.6923 4 -1.0 3 4.0 \n",
|
952 |
+
"3 3.8462 2 7.0 3 4.0 \n",
|
953 |
+
"4 0.6472 6 -1.0 3 99.0 \n",
|
954 |
+
"... ... ... ... ... ... \n",
|
955 |
+
"39138 2.5510 5 4.0 3 99.0 \n",
|
956 |
+
"39139 0.7299 3 5.0 4 4.0 \n",
|
957 |
+
"39140 1.8519 3 5.0 4 4.0 \n",
|
958 |
+
"39141 0.3226 6 5.0 2 4.0 \n",
|
959 |
+
"39142 7.1429 4 5.0 5 99.0 \n",
|
960 |
+
"\n",
|
961 |
+
" l6m_night_call_cnt_rate night_percent_six brand_id \n",
|
962 |
+
"0 4.6512 5.11 2 \n",
|
963 |
+
"1 1.3298 17.64 2 \n",
|
964 |
+
"2 5.4526 12.70 2 \n",
|
965 |
+
"3 5.6604 2.83 1 \n",
|
966 |
+
"4 0.3784 6.18 1 \n",
|
967 |
+
"... ... ... ... \n",
|
968 |
+
"39138 4.3779 11.52 2 \n",
|
969 |
+
"39139 0.9901 11.19 1 \n",
|
970 |
+
"39140 2.4476 30.93 1 \n",
|
971 |
+
"39141 0.7042 36.48 1 \n",
|
972 |
+
"39142 6.3559 24.18 1 \n",
|
973 |
+
"\n",
|
974 |
+
"[39143 rows x 12 columns]"
|
975 |
+
]
|
976 |
+
},
|
977 |
+
"execution_count": 4,
|
978 |
+
"metadata": {},
|
979 |
+
"output_type": "execute_result"
|
980 |
+
}
|
981 |
+
],
|
982 |
+
"source": [
|
983 |
+
"data1"
|
984 |
+
]
|
985 |
+
},
|
986 |
+
{
|
987 |
+
"cell_type": "code",
|
988 |
+
"execution_count": 5,
|
989 |
+
"id": "handy-custom",
|
990 |
+
"metadata": {},
|
991 |
+
"outputs": [],
|
992 |
+
"source": [
|
993 |
+
"def fun_flux(x):\n",
|
994 |
+
" x=x/1024\n",
|
995 |
+
" if x <= 100:\n",
|
996 |
+
" return 1\n",
|
997 |
+
" if x <= 500:\n",
|
998 |
+
" return 2\n",
|
999 |
+
" if x <= 1024:\n",
|
1000 |
+
" return 3\n",
|
1001 |
+
" if x <= 2048:\n",
|
1002 |
+
" return 4\n",
|
1003 |
+
" else:\n",
|
1004 |
+
" return 5"
|
1005 |
+
]
|
1006 |
+
},
|
1007 |
+
{
|
1008 |
+
"cell_type": "code",
|
1009 |
+
"execution_count": 6,
|
1010 |
+
"id": "linear-divorce",
|
1011 |
+
"metadata": {},
|
1012 |
+
"outputs": [],
|
1013 |
+
"source": [
|
1014 |
+
"df2 = data2[['row_num','innet_dura','basic_package_prc','package_flux','in_set_voice_minu','pri_package_lvl','cur_eff_sale_cmpn_cnt','mon_stp_cnt','gsm_user_lvl','is_join_busi_typ_contr','user_status']]\n",
|
1015 |
+
"#,'become_group_user_memb_tm','term_os','mage_status','user_area_belo','group_indus_typ_code'\n",
|
1016 |
+
"#df2 = data2.drop(labels=['belo_camp_id','become_group_user_memb_tm', 'belo_group_cust_id', 'term_brand', 'term_mdl', 'charge_package_unify_code', 'befo_pri_package_code', 'basic_package_id', 'basic_package_eff_date', 'package_stp_date','is_exempt_prest_open_inter_roam ','is_hnet_bind','camp_lvl','cm_nadd_mkcase_cnt','pretty_num_typ_code','term_typ','is_mkcase_user','is_warnt_boot','is_fuse_brd','year_nadd_id','is_group_user','exit_typ','is_main_card_user','is_cm_ord_nolimit_and_eff','is_give_card','this_is_replace_package','is_join_term_contr','memb_typ','is_use_backup_sim_svc','owe_stp_days','become_group_user_memb_tm','mon_stp_cnt','gsm_user_lvl','is_join_busi_typ_contr','user_status','term_os','mage_status','user_area_belo','group_indus_typ_code','nation','ord_4g_package_user_id','stp_dura','last_one_stp_tm','is_ord_nolimit','brd_bdwth','msisdn_owe_stp_freq','innet_dura_lvl_code','is_urgent_boot','is_gsm_user','is_ass_card','in_set_sms_cnt','package_typ','ass_card_cnt','gsm_user_src','unique_flag','is_indv_cust_posb','is_fnet_bind','is_group_v_ntw_bind','is_bind_pay','cancl_date'],axis=1)\n",
|
1017 |
+
"#df2['pretty_num_typ_name'] = df2['pretty_num_typ_name'].str.replace('非靓号', '0')\n",
|
1018 |
+
"#if df2['pretty_num_typ_name'].str != '0':\n",
|
1019 |
+
"# df2['pretty_num_typ_name']='1'\n",
|
1020 |
+
" \n",
|
1021 |
+
"#df2['pretty_num_typ_name']=df2['pretty_num_typ_name'].astype(int) \n",
|
1022 |
+
"#if df2['stp_typ'].str != '9999':\n",
|
1023 |
+
"# df2['stp_typ']='0' \n",
|
1024 |
+
"#df2['stp_typ']=df2['stp_typ'].astype(int) \n",
|
1025 |
+
"#df2['cm_nadd_mkcase_cnt'] = df2['cm_nadd_mkcase_cnt'].str.replace(r'\\\\N','-1')\n",
|
1026 |
+
"#df2['cm_nadd_mkcase_cnt']=df2['cm_nadd_mkcase_cnt'].astype(int)\n",
|
1027 |
+
"df2['cur_eff_sale_cmpn_cnt'] = df2['cur_eff_sale_cmpn_cnt'].str.replace(r'\\\\N','-1')\n",
|
1028 |
+
"df2['cur_eff_sale_cmpn_cnt']=df2['cur_eff_sale_cmpn_cnt'].astype(int) \n",
|
1029 |
+
"df2['basic_package_prc'] = df2['basic_package_prc'].str.replace(r'\\\\N','-1')\n",
|
1030 |
+
"df2['basic_package_prc']=df2['basic_package_prc'].astype(int)\n",
|
1031 |
+
"\n",
|
1032 |
+
"#df2['user_status']=df2['user_status']-1000\n",
|
1033 |
+
"#df2['package_flux'] = df2['package_flux'].apply(lambda x: fun_flux(x))\n",
|
1034 |
+
"\n",
|
1035 |
+
"df2.to_csv(path_or_buf='csvclear/train_b.csv', index=None) \n"
|
1036 |
+
]
|
1037 |
+
},
|
1038 |
+
{
|
1039 |
+
"cell_type": "code",
|
1040 |
+
"execution_count": 7,
|
1041 |
+
"id": "detected-teddy",
|
1042 |
+
"metadata": {},
|
1043 |
+
"outputs": [],
|
1044 |
+
"source": [
|
1045 |
+
"df4 = data4[['row_num','innet_dura','basic_package_prc','package_flux','in_set_voice_minu','pri_package_lvl','cur_eff_sale_cmpn_cnt','mon_stp_cnt','gsm_user_lvl','is_join_busi_typ_contr','user_status']]\n",
|
1046 |
+
"\n",
|
1047 |
+
"#df4 = data4.drop(labels=['belo_camp_id','become_group_user_memb_tm', 'belo_group_cust_id', 'term_brand', 'term_mdl', 'charge_package_unify_code', 'befo_pri_package_code', 'basic_package_id', 'basic_package_eff_date', 'package_stp_date','is_exempt_prest_open_inter_roam ','is_hnet_bind','camp_lvl','cm_nadd_mkcase_cnt','pretty_num_typ_code','term_typ','is_mkcase_user','is_warnt_boot','is_fuse_brd','year_nadd_id','is_group_user','exit_typ','is_main_card_user','is_cm_ord_nolimit_and_eff','is_give_card','this_is_replace_package','is_join_term_contr','memb_typ','is_use_backup_sim_svc','owe_stp_days','become_group_user_memb_tm','mon_stp_cnt','gsm_user_lvl','is_join_busi_typ_contr','user_status','term_os','mage_status','user_area_belo','group_indus_typ_code','nation','ord_4g_package_user_id','stp_dura','last_one_stp_tm','is_ord_nolimit','brd_bdwth','msisdn_owe_stp_freq','innet_dura_lvl_code','is_urgent_boot','is_gsm_user','is_ass_card','in_set_sms_cnt','package_typ','ass_card_cnt','gsm_user_src','unique_flag','is_indv_cust_posb','is_fnet_bind','is_group_v_ntw_bind','is_bind_pay','cancl_date'],axis=1)\n",
|
1048 |
+
"#df4['pretty_num_typ_name'] = df4['pretty_num_typ_name'].str.replace('非靓号', '0')\n",
|
1049 |
+
"#if df4['pretty_num_typ_name'].str != '0':\n",
|
1050 |
+
"# df4['pretty_num_typ_name']='1'\n",
|
1051 |
+
" \n",
|
1052 |
+
"#df4['pretty_num_typ_name']=df4['pretty_num_typ_name'].astype(int) \n",
|
1053 |
+
"#if df4['stp_typ'].str != '9999':\n",
|
1054 |
+
"# df4['stp_typ']='0' \n",
|
1055 |
+
"#df4['stp_typ']=df2['stp_typ'].astype(int) \n",
|
1056 |
+
"#df4['cm_nadd_mkcase_cnt'] = df4['cm_nadd_mkcase_cnt'].str.replace(r'\\\\N','-1')\n",
|
1057 |
+
"#df4['cm_nadd_mkcase_cnt']=df4['cm_nadd_mkcase_cnt'].astype(int)\n",
|
1058 |
+
"df4['cur_eff_sale_cmpn_cnt'] = df4['cur_eff_sale_cmpn_cnt'].str.replace(r'\\\\N','-1')\n",
|
1059 |
+
"df4['cur_eff_sale_cmpn_cnt']=df4['cur_eff_sale_cmpn_cnt'].astype(int) \n",
|
1060 |
+
"df4['basic_package_prc'] = df4['basic_package_prc'].str.replace(r'\\\\N','-1')\n",
|
1061 |
+
"df4['basic_package_prc']=df4['basic_package_prc'].astype(int)\n",
|
1062 |
+
"\n",
|
1063 |
+
"#df4['user_status']=df4['user_status']-1000\n",
|
1064 |
+
"#df4['package_flux'] = df4['package_flux'].apply(lambda x: fun_flux(x))\n",
|
1065 |
+
"\n",
|
1066 |
+
"df4.to_csv(path_or_buf='csvclear/test_b.csv', index=None)\n"
|
1067 |
+
]
|
1068 |
+
},
|
1069 |
+
{
|
1070 |
+
"cell_type": "code",
|
1071 |
+
"execution_count": 8,
|
1072 |
+
"id": "chronic-cisco",
|
1073 |
+
"metadata": {},
|
1074 |
+
"outputs": [
|
1075 |
+
{
|
1076 |
+
"data": {
|
1077 |
+
"text/html": [
|
1078 |
+
"<div>\n",
|
1079 |
+
"<style scoped>\n",
|
1080 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
1081 |
+
" vertical-align: middle;\n",
|
1082 |
+
" }\n",
|
1083 |
+
"\n",
|
1084 |
+
" .dataframe tbody tr th {\n",
|
1085 |
+
" vertical-align: top;\n",
|
1086 |
+
" }\n",
|
1087 |
+
"\n",
|
1088 |
+
" .dataframe thead th {\n",
|
1089 |
+
" text-align: right;\n",
|
1090 |
+
" }\n",
|
1091 |
+
"</style>\n",
|
1092 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
1093 |
+
" <thead>\n",
|
1094 |
+
" <tr style=\"text-align: right;\">\n",
|
1095 |
+
" <th></th>\n",
|
1096 |
+
" <th>row_num</th>\n",
|
1097 |
+
" <th>innet_dura</th>\n",
|
1098 |
+
" <th>basic_package_prc</th>\n",
|
1099 |
+
" <th>package_flux</th>\n",
|
1100 |
+
" <th>in_set_voice_minu</th>\n",
|
1101 |
+
" <th>pri_package_lvl</th>\n",
|
1102 |
+
" <th>cur_eff_sale_cmpn_cnt</th>\n",
|
1103 |
+
" <th>mon_stp_cnt</th>\n",
|
1104 |
+
" <th>gsm_user_lvl</th>\n",
|
1105 |
+
" <th>is_join_busi_typ_contr</th>\n",
|
1106 |
+
" <th>user_status</th>\n",
|
1107 |
+
" </tr>\n",
|
1108 |
+
" </thead>\n",
|
1109 |
+
" <tbody>\n",
|
1110 |
+
" <tr>\n",
|
1111 |
+
" <th>0</th>\n",
|
1112 |
+
" <td>5239</td>\n",
|
1113 |
+
" <td>7</td>\n",
|
1114 |
+
" <td>-1</td>\n",
|
1115 |
+
" <td>0</td>\n",
|
1116 |
+
" <td>0</td>\n",
|
1117 |
+
" <td>0.0</td>\n",
|
1118 |
+
" <td>-1</td>\n",
|
1119 |
+
" <td>0</td>\n",
|
1120 |
+
" <td>-1.0</td>\n",
|
1121 |
+
" <td>0</td>\n",
|
1122 |
+
" <td>9000</td>\n",
|
1123 |
+
" </tr>\n",
|
1124 |
+
" <tr>\n",
|
1125 |
+
" <th>1</th>\n",
|
1126 |
+
" <td>5220</td>\n",
|
1127 |
+
" <td>53</td>\n",
|
1128 |
+
" <td>99</td>\n",
|
1129 |
+
" <td>66560</td>\n",
|
1130 |
+
" <td>1300</td>\n",
|
1131 |
+
" <td>6.0</td>\n",
|
1132 |
+
" <td>1</td>\n",
|
1133 |
+
" <td>1</td>\n",
|
1134 |
+
" <td>7.0</td>\n",
|
1135 |
+
" <td>0</td>\n",
|
1136 |
+
" <td>1010</td>\n",
|
1137 |
+
" </tr>\n",
|
1138 |
+
" <tr>\n",
|
1139 |
+
" <th>2</th>\n",
|
1140 |
+
" <td>37261</td>\n",
|
1141 |
+
" <td>36</td>\n",
|
1142 |
+
" <td>128</td>\n",
|
1143 |
+
" <td>40960</td>\n",
|
1144 |
+
" <td>200</td>\n",
|
1145 |
+
" <td>0.0</td>\n",
|
1146 |
+
" <td>4</td>\n",
|
1147 |
+
" <td>0</td>\n",
|
1148 |
+
" <td>-1.0</td>\n",
|
1149 |
+
" <td>0</td>\n",
|
1150 |
+
" <td>1010</td>\n",
|
1151 |
+
" </tr>\n",
|
1152 |
+
" <tr>\n",
|
1153 |
+
" <th>3</th>\n",
|
1154 |
+
" <td>32634</td>\n",
|
1155 |
+
" <td>257</td>\n",
|
1156 |
+
" <td>98</td>\n",
|
1157 |
+
" <td>20480</td>\n",
|
1158 |
+
" <td>500</td>\n",
|
1159 |
+
" <td>0.0</td>\n",
|
1160 |
+
" <td>-1</td>\n",
|
1161 |
+
" <td>1</td>\n",
|
1162 |
+
" <td>1.0</td>\n",
|
1163 |
+
" <td>0</td>\n",
|
1164 |
+
" <td>1010</td>\n",
|
1165 |
+
" </tr>\n",
|
1166 |
+
" <tr>\n",
|
1167 |
+
" <th>4</th>\n",
|
1168 |
+
" <td>39782</td>\n",
|
1169 |
+
" <td>215</td>\n",
|
1170 |
+
" <td>0</td>\n",
|
1171 |
+
" <td>0</td>\n",
|
1172 |
+
" <td>0</td>\n",
|
1173 |
+
" <td>0.0</td>\n",
|
1174 |
+
" <td>20</td>\n",
|
1175 |
+
" <td>0</td>\n",
|
1176 |
+
" <td>7.0</td>\n",
|
1177 |
+
" <td>1</td>\n",
|
1178 |
+
" <td>1010</td>\n",
|
1179 |
+
" </tr>\n",
|
1180 |
+
" <tr>\n",
|
1181 |
+
" <th>...</th>\n",
|
1182 |
+
" <td>...</td>\n",
|
1183 |
+
" <td>...</td>\n",
|
1184 |
+
" <td>...</td>\n",
|
1185 |
+
" <td>...</td>\n",
|
1186 |
+
" <td>...</td>\n",
|
1187 |
+
" <td>...</td>\n",
|
1188 |
+
" <td>...</td>\n",
|
1189 |
+
" <td>...</td>\n",
|
1190 |
+
" <td>...</td>\n",
|
1191 |
+
" <td>...</td>\n",
|
1192 |
+
" <td>...</td>\n",
|
1193 |
+
" </tr>\n",
|
1194 |
+
" <tr>\n",
|
1195 |
+
" <th>9781</th>\n",
|
1196 |
+
" <td>9304</td>\n",
|
1197 |
+
" <td>69</td>\n",
|
1198 |
+
" <td>0</td>\n",
|
1199 |
+
" <td>0</td>\n",
|
1200 |
+
" <td>0</td>\n",
|
1201 |
+
" <td>0.0</td>\n",
|
1202 |
+
" <td>4</td>\n",
|
1203 |
+
" <td>0</td>\n",
|
1204 |
+
" <td>-1.0</td>\n",
|
1205 |
+
" <td>0</td>\n",
|
1206 |
+
" <td>1010</td>\n",
|
1207 |
+
" </tr>\n",
|
1208 |
+
" <tr>\n",
|
1209 |
+
" <th>9782</th>\n",
|
1210 |
+
" <td>38713</td>\n",
|
1211 |
+
" <td>48</td>\n",
|
1212 |
+
" <td>128</td>\n",
|
1213 |
+
" <td>30720</td>\n",
|
1214 |
+
" <td>500</td>\n",
|
1215 |
+
" <td>0.0</td>\n",
|
1216 |
+
" <td>1</td>\n",
|
1217 |
+
" <td>1</td>\n",
|
1218 |
+
" <td>6.0</td>\n",
|
1219 |
+
" <td>0</td>\n",
|
1220 |
+
" <td>1010</td>\n",
|
1221 |
+
" </tr>\n",
|
1222 |
+
" <tr>\n",
|
1223 |
+
" <th>9783</th>\n",
|
1224 |
+
" <td>41809</td>\n",
|
1225 |
+
" <td>215</td>\n",
|
1226 |
+
" <td>28</td>\n",
|
1227 |
+
" <td>5120</td>\n",
|
1228 |
+
" <td>80</td>\n",
|
1229 |
+
" <td>0.0</td>\n",
|
1230 |
+
" <td>8</td>\n",
|
1231 |
+
" <td>0</td>\n",
|
1232 |
+
" <td>-1.0</td>\n",
|
1233 |
+
" <td>0</td>\n",
|
1234 |
+
" <td>1010</td>\n",
|
1235 |
+
" </tr>\n",
|
1236 |
+
" <tr>\n",
|
1237 |
+
" <th>9784</th>\n",
|
1238 |
+
" <td>2165</td>\n",
|
1239 |
+
" <td>97</td>\n",
|
1240 |
+
" <td>8</td>\n",
|
1241 |
+
" <td>100</td>\n",
|
1242 |
+
" <td>0</td>\n",
|
1243 |
+
" <td>0.0</td>\n",
|
1244 |
+
" <td>2</td>\n",
|
1245 |
+
" <td>0</td>\n",
|
1246 |
+
" <td>6.0</td>\n",
|
1247 |
+
" <td>0</td>\n",
|
1248 |
+
" <td>1010</td>\n",
|
1249 |
+
" </tr>\n",
|
1250 |
+
" <tr>\n",
|
1251 |
+
" <th>9785</th>\n",
|
1252 |
+
" <td>48929</td>\n",
|
1253 |
+
" <td>225</td>\n",
|
1254 |
+
" <td>18</td>\n",
|
1255 |
+
" <td>1024</td>\n",
|
1256 |
+
" <td>100</td>\n",
|
1257 |
+
" <td>0.0</td>\n",
|
1258 |
+
" <td>-1</td>\n",
|
1259 |
+
" <td>0</td>\n",
|
1260 |
+
" <td>1.0</td>\n",
|
1261 |
+
" <td>0</td>\n",
|
1262 |
+
" <td>1010</td>\n",
|
1263 |
+
" </tr>\n",
|
1264 |
+
" </tbody>\n",
|
1265 |
+
"</table>\n",
|
1266 |
+
"<p>9786 rows × 11 columns</p>\n",
|
1267 |
+
"</div>"
|
1268 |
+
],
|
1269 |
+
"text/plain": [
|
1270 |
+
" row_num innet_dura basic_package_prc package_flux in_set_voice_minu \\\n",
|
1271 |
+
"0 5239 7 -1 0 0 \n",
|
1272 |
+
"1 5220 53 99 66560 1300 \n",
|
1273 |
+
"2 37261 36 128 40960 200 \n",
|
1274 |
+
"3 32634 257 98 20480 500 \n",
|
1275 |
+
"4 39782 215 0 0 0 \n",
|
1276 |
+
"... ... ... ... ... ... \n",
|
1277 |
+
"9781 9304 69 0 0 0 \n",
|
1278 |
+
"9782 38713 48 128 30720 500 \n",
|
1279 |
+
"9783 41809 215 28 5120 80 \n",
|
1280 |
+
"9784 2165 97 8 100 0 \n",
|
1281 |
+
"9785 48929 225 18 1024 100 \n",
|
1282 |
+
"\n",
|
1283 |
+
" pri_package_lvl cur_eff_sale_cmpn_cnt mon_stp_cnt gsm_user_lvl \\\n",
|
1284 |
+
"0 0.0 -1 0 -1.0 \n",
|
1285 |
+
"1 6.0 1 1 7.0 \n",
|
1286 |
+
"2 0.0 4 0 -1.0 \n",
|
1287 |
+
"3 0.0 -1 1 1.0 \n",
|
1288 |
+
"4 0.0 20 0 7.0 \n",
|
1289 |
+
"... ... ... ... ... \n",
|
1290 |
+
"9781 0.0 4 0 -1.0 \n",
|
1291 |
+
"9782 0.0 1 1 6.0 \n",
|
1292 |
+
"9783 0.0 8 0 -1.0 \n",
|
1293 |
+
"9784 0.0 2 0 6.0 \n",
|
1294 |
+
"9785 0.0 -1 0 1.0 \n",
|
1295 |
+
"\n",
|
1296 |
+
" is_join_busi_typ_contr user_status \n",
|
1297 |
+
"0 0 9000 \n",
|
1298 |
+
"1 0 1010 \n",
|
1299 |
+
"2 0 1010 \n",
|
1300 |
+
"3 0 1010 \n",
|
1301 |
+
"4 1 1010 \n",
|
1302 |
+
"... ... ... \n",
|
1303 |
+
"9781 0 1010 \n",
|
1304 |
+
"9782 0 1010 \n",
|
1305 |
+
"9783 0 1010 \n",
|
1306 |
+
"9784 0 1010 \n",
|
1307 |
+
"9785 0 1010 \n",
|
1308 |
+
"\n",
|
1309 |
+
"[9786 rows x 11 columns]"
|
1310 |
+
]
|
1311 |
+
},
|
1312 |
+
"execution_count": 8,
|
1313 |
+
"metadata": {},
|
1314 |
+
"output_type": "execute_result"
|
1315 |
+
}
|
1316 |
+
],
|
1317 |
+
"source": [
|
1318 |
+
"df4"
|
1319 |
+
]
|
1320 |
+
},
|
1321 |
+
{
|
1322 |
+
"cell_type": "code",
|
1323 |
+
"execution_count": 9,
|
1324 |
+
"id": "invalid-parameter",
|
1325 |
+
"metadata": {},
|
1326 |
+
"outputs": [
|
1327 |
+
{
|
1328 |
+
"name": "stdout",
|
1329 |
+
"output_type": "stream",
|
1330 |
+
"text": [
|
1331 |
+
"数据清洗完成\n"
|
1332 |
+
]
|
1333 |
+
}
|
1334 |
+
],
|
1335 |
+
"source": [
|
1336 |
+
"print('数据清洗完成')"
|
1337 |
+
]
|
1338 |
+
},
|
1339 |
+
{
|
1340 |
+
"cell_type": "code",
|
1341 |
+
"execution_count": 10,
|
1342 |
+
"id": "timely-judges",
|
1343 |
+
"metadata": {},
|
1344 |
+
"outputs": [
|
1345 |
+
{
|
1346 |
+
"ename": "SyntaxError",
|
1347 |
+
"evalue": "Missing parentheses in call to 'print'. Did you mean print(cccc)? (<ipython-input-10-541b57d62b0e>, line 1)",
|
1348 |
+
"output_type": "error",
|
1349 |
+
"traceback": [
|
1350 |
+
"\u001b[0;36m File \u001b[0;32m\"<ipython-input-10-541b57d62b0e>\"\u001b[0;36m, line \u001b[0;32m1\u001b[0m\n\u001b[0;31m print cccc\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m Missing parentheses in call to 'print'. Did you mean print(cccc)?\n"
|
1351 |
+
]
|
1352 |
+
}
|
1353 |
+
],
|
1354 |
+
"source": [
|
1355 |
+
"print cccc"
|
1356 |
+
]
|
1357 |
+
},
|
1358 |
+
{
|
1359 |
+
"cell_type": "code",
|
1360 |
+
"execution_count": null,
|
1361 |
+
"id": "broadband-pitch",
|
1362 |
+
"metadata": {},
|
1363 |
+
"outputs": [],
|
1364 |
+
"source": []
|
1365 |
+
},
|
1366 |
+
{
|
1367 |
+
"cell_type": "code",
|
1368 |
+
"execution_count": 11,
|
1369 |
+
"id": "cordless-intelligence",
|
1370 |
+
"metadata": {},
|
1371 |
+
"outputs": [
|
1372 |
+
{
|
1373 |
+
"name": "stdout",
|
1374 |
+
"output_type": "stream",
|
1375 |
+
"text": [
|
1376 |
+
"{\r\n",
|
1377 |
+
" \"retcode\": 0,\r\n",
|
1378 |
+
" \"retmsg\": \"Fate Flow CLI has been initialized successfully.\"\r\n",
|
1379 |
+
"}\r\n",
|
1380 |
+
"\r\n"
|
1381 |
+
]
|
1382 |
+
}
|
1383 |
+
],
|
1384 |
+
"source": [
|
1385 |
+
"!flow init --ip 10.43.159.182 --port 9380"
|
1386 |
+
]
|
1387 |
+
},
|
1388 |
+
{
|
1389 |
+
"cell_type": "code",
|
1390 |
+
"execution_count": 12,
|
1391 |
+
"id": "dffd4c06",
|
1392 |
+
"metadata": {},
|
1393 |
+
"outputs": [
|
1394 |
+
{
|
1395 |
+
"name": "stdout",
|
1396 |
+
"output_type": "stream",
|
1397 |
+
"text": [
|
1398 |
+
"{\r\n",
|
1399 |
+
" \"data\": {\r\n",
|
1400 |
+
" \"board_url\": \"http://board:8080/index.html#/dashboard?job_id=20230424161428388177448&role=local&party_id=0\",\r\n",
|
1401 |
+
" \"job_dsl_path\": \"/data/projects/fate/jobs/20230424161428388177448/job_dsl.json\",\r\n",
|
1402 |
+
" \"job_id\": \"20230424161428388177448\",\r\n",
|
1403 |
+
" \"job_runtime_conf_on_party_path\": \"/data/projects/fate/jobs/20230424161428388177448/local/job_runtime_on_party_conf.json\",\r\n",
|
1404 |
+
" \"job_runtime_conf_path\": \"/data/projects/fate/jobs/20230424161428388177448/job_runtime_conf.json\",\r\n",
|
1405 |
+
" \"logs_directory\": \"/data/projects/fate/logs/20230424161428388177448\",\r\n",
|
1406 |
+
" \"model_info\": {\r\n",
|
1407 |
+
" \"model_id\": \"local-0#model\",\r\n",
|
1408 |
+
" \"model_version\": \"20230424161428388177448\"\r\n",
|
1409 |
+
" },\r\n",
|
1410 |
+
" \"namespace\": \"experiment\",\r\n",
|
1411 |
+
" \"pipeline_dsl_path\": \"/data/projects/fate/jobs/20230424161428388177448/pipeline_dsl.json\",\r\n",
|
1412 |
+
" \"table_name\": \"train_a_label\",\r\n",
|
1413 |
+
" \"train_runtime_conf_path\": \"/data/projects/fate/jobs/20230424161428388177448/train_runtime_conf.json\"\r\n",
|
1414 |
+
" },\r\n",
|
1415 |
+
" \"jobId\": \"20230424161428388177448\",\r\n",
|
1416 |
+
" \"retcode\": 0,\r\n",
|
1417 |
+
" \"retmsg\": \"success\"\r\n",
|
1418 |
+
"}\r\n",
|
1419 |
+
"\r\n"
|
1420 |
+
]
|
1421 |
+
}
|
1422 |
+
],
|
1423 |
+
"source": [
|
1424 |
+
"!flow data upload -c /Examples/csvclear/upload_conf.json --drop"
|
1425 |
+
]
|
1426 |
+
},
|
1427 |
+
{
|
1428 |
+
"cell_type": "code",
|
1429 |
+
"execution_count": 13,
|
1430 |
+
"id": "34470baf",
|
1431 |
+
"metadata": {},
|
1432 |
+
"outputs": [
|
1433 |
+
{
|
1434 |
+
"name": "stdout",
|
1435 |
+
"output_type": "stream",
|
1436 |
+
"text": [
|
1437 |
+
"{\r\n",
|
1438 |
+
" \"data\": {\r\n",
|
1439 |
+
" \"board_url\": \"http://board:8080/index.html#/dashboard?job_id=20230424161429367145449&role=local&party_id=0\",\r\n",
|
1440 |
+
" \"job_dsl_path\": \"/data/projects/fate/jobs/20230424161429367145449/job_dsl.json\",\r\n",
|
1441 |
+
" \"job_id\": \"20230424161429367145449\",\r\n",
|
1442 |
+
" \"job_runtime_conf_on_party_path\": \"/data/projects/fate/jobs/20230424161429367145449/local/job_runtime_on_party_conf.json\",\r\n",
|
1443 |
+
" \"job_runtime_conf_path\": \"/data/projects/fate/jobs/20230424161429367145449/job_runtime_conf.json\",\r\n",
|
1444 |
+
" \"logs_directory\": \"/data/projects/fate/logs/20230424161429367145449\",\r\n",
|
1445 |
+
" \"model_info\": {\r\n",
|
1446 |
+
" \"model_id\": \"local-0#model\",\r\n",
|
1447 |
+
" \"model_version\": \"20230424161429367145449\"\r\n",
|
1448 |
+
" },\r\n",
|
1449 |
+
" \"namespace\": \"experiment\",\r\n",
|
1450 |
+
" \"pipeline_dsl_path\": \"/data/projects/fate/jobs/20230424161429367145449/pipeline_dsl.json\",\r\n",
|
1451 |
+
" \"table_name\": \"train_b\",\r\n",
|
1452 |
+
" \"train_runtime_conf_path\": \"/data/projects/fate/jobs/20230424161429367145449/train_runtime_conf.json\"\r\n",
|
1453 |
+
" },\r\n",
|
1454 |
+
" \"jobId\": \"20230424161429367145449\",\r\n",
|
1455 |
+
" \"retcode\": 0,\r\n",
|
1456 |
+
" \"retmsg\": \"success\"\r\n",
|
1457 |
+
"}\r\n",
|
1458 |
+
"\r\n"
|
1459 |
+
]
|
1460 |
+
}
|
1461 |
+
],
|
1462 |
+
"source": [
|
1463 |
+
"!flow data upload -c /Examples/csvclear/upload_conf_host.json --drop"
|
1464 |
+
]
|
1465 |
+
},
|
1466 |
+
{
|
1467 |
+
"cell_type": "code",
|
1468 |
+
"execution_count": 14,
|
1469 |
+
"id": "filled-princess",
|
1470 |
+
"metadata": {},
|
1471 |
+
"outputs": [
|
1472 |
+
{
|
1473 |
+
"name": "stdout",
|
1474 |
+
"output_type": "stream",
|
1475 |
+
"text": [
|
1476 |
+
"{\r\n",
|
1477 |
+
" \"data\": {\r\n",
|
1478 |
+
" \"count\": 39143,\r\n",
|
1479 |
+
" \"exist\": 1,\r\n",
|
1480 |
+
" \"namespace\": \"experiment\",\r\n",
|
1481 |
+
" \"partition\": 4,\r\n",
|
1482 |
+
" \"schema\": {\r\n",
|
1483 |
+
" \"header\": \"label,user_star_val,night_call_dura_rate,night_call_cnt_rate,age,cust_star,opp_belo_cnt,rcn_mode,l6m_night_call_cnt_rate,night_percent_six,brand_id\",\r\n",
|
1484 |
+
" \"sid\": \"row_num\"\r\n",
|
1485 |
+
" },\r\n",
|
1486 |
+
" \"table_name\": \"train_a_label\"\r\n",
|
1487 |
+
" },\r\n",
|
1488 |
+
" \"retcode\": 0,\r\n",
|
1489 |
+
" \"retmsg\": \"success\"\r\n",
|
1490 |
+
"}\r\n",
|
1491 |
+
"\r\n"
|
1492 |
+
]
|
1493 |
+
}
|
1494 |
+
],
|
1495 |
+
"source": [
|
1496 |
+
"#查看表信息\n",
|
1497 |
+
"!flow table info -t train_a_label -n experiment\n",
|
1498 |
+
"#!flow table info -t train_a_label -n experiment"
|
1499 |
+
]
|
1500 |
+
},
|
1501 |
+
{
|
1502 |
+
"cell_type": "code",
|
1503 |
+
"execution_count": 15,
|
1504 |
+
"id": "mighty-health",
|
1505 |
+
"metadata": {},
|
1506 |
+
"outputs": [
|
1507 |
+
{
|
1508 |
+
"name": "stdout",
|
1509 |
+
"output_type": "stream",
|
1510 |
+
"text": [
|
1511 |
+
"{\r\n",
|
1512 |
+
" \"data\": {\r\n",
|
1513 |
+
" \"board_url\": \"http://board:8080/index.html#/dashboard?job_id=20230424161430596799450&role=local&party_id=0\",\r\n",
|
1514 |
+
" \"job_dsl_path\": \"/data/projects/fate/jobs/20230424161430596799450/job_dsl.json\",\r\n",
|
1515 |
+
" \"job_id\": \"20230424161430596799450\",\r\n",
|
1516 |
+
" \"job_runtime_conf_on_party_path\": \"/data/projects/fate/jobs/20230424161430596799450/local/job_runtime_on_party_conf.json\",\r\n",
|
1517 |
+
" \"job_runtime_conf_path\": \"/data/projects/fate/jobs/20230424161430596799450/job_runtime_conf.json\",\r\n",
|
1518 |
+
" \"logs_directory\": \"/data/projects/fate/logs/20230424161430596799450\",\r\n",
|
1519 |
+
" \"model_info\": {\r\n",
|
1520 |
+
" \"model_id\": \"local-0#model\",\r\n",
|
1521 |
+
" \"model_version\": \"20230424161430596799450\"\r\n",
|
1522 |
+
" },\r\n",
|
1523 |
+
" \"namespace\": \"experiment\",\r\n",
|
1524 |
+
" \"pipeline_dsl_path\": \"/data/projects/fate/jobs/20230424161430596799450/pipeline_dsl.json\",\r\n",
|
1525 |
+
" \"table_name\": \"test_a\",\r\n",
|
1526 |
+
" \"train_runtime_conf_path\": \"/data/projects/fate/jobs/20230424161430596799450/train_runtime_conf.json\"\r\n",
|
1527 |
+
" },\r\n",
|
1528 |
+
" \"jobId\": \"20230424161430596799450\",\r\n",
|
1529 |
+
" \"retcode\": 0,\r\n",
|
1530 |
+
" \"retmsg\": \"success\"\r\n",
|
1531 |
+
"}\r\n",
|
1532 |
+
"\r\n"
|
1533 |
+
]
|
1534 |
+
}
|
1535 |
+
],
|
1536 |
+
"source": [
|
1537 |
+
"#上传预测数据\n",
|
1538 |
+
"!flow data upload -c /Examples/csvclear/upload_testa_conf.json --drop"
|
1539 |
+
]
|
1540 |
+
},
|
1541 |
+
{
|
1542 |
+
"cell_type": "code",
|
1543 |
+
"execution_count": 16,
|
1544 |
+
"id": "similar-teaching",
|
1545 |
+
"metadata": {},
|
1546 |
+
"outputs": [
|
1547 |
+
{
|
1548 |
+
"name": "stdout",
|
1549 |
+
"output_type": "stream",
|
1550 |
+
"text": [
|
1551 |
+
"{\r\n",
|
1552 |
+
" \"data\": {\r\n",
|
1553 |
+
" \"board_url\": \"http://board:8080/index.html#/dashboard?job_id=20230424161431222943451&role=local&party_id=0\",\r\n",
|
1554 |
+
" \"job_dsl_path\": \"/data/projects/fate/jobs/20230424161431222943451/job_dsl.json\",\r\n",
|
1555 |
+
" \"job_id\": \"20230424161431222943451\",\r\n",
|
1556 |
+
" \"job_runtime_conf_on_party_path\": \"/data/projects/fate/jobs/20230424161431222943451/local/job_runtime_on_party_conf.json\",\r\n",
|
1557 |
+
" \"job_runtime_conf_path\": \"/data/projects/fate/jobs/20230424161431222943451/job_runtime_conf.json\",\r\n",
|
1558 |
+
" \"logs_directory\": \"/data/projects/fate/logs/20230424161431222943451\",\r\n",
|
1559 |
+
" \"model_info\": {\r\n",
|
1560 |
+
" \"model_id\": \"local-0#model\",\r\n",
|
1561 |
+
" \"model_version\": \"20230424161431222943451\"\r\n",
|
1562 |
+
" },\r\n",
|
1563 |
+
" \"namespace\": \"experiment\",\r\n",
|
1564 |
+
" \"pipeline_dsl_path\": \"/data/projects/fate/jobs/20230424161431222943451/pipeline_dsl.json\",\r\n",
|
1565 |
+
" \"table_name\": \"test_b\",\r\n",
|
1566 |
+
" \"train_runtime_conf_path\": \"/data/projects/fate/jobs/20230424161431222943451/train_runtime_conf.json\"\r\n",
|
1567 |
+
" },\r\n",
|
1568 |
+
" \"jobId\": \"20230424161431222943451\",\r\n",
|
1569 |
+
" \"retcode\": 0,\r\n",
|
1570 |
+
" \"retmsg\": \"success\"\r\n",
|
1571 |
+
"}\r\n",
|
1572 |
+
"\r\n"
|
1573 |
+
]
|
1574 |
+
}
|
1575 |
+
],
|
1576 |
+
"source": [
|
1577 |
+
"!flow data upload -c /Examples/csvclear/upload_testb_conf.json --drop"
|
1578 |
+
]
|
1579 |
+
},
|
1580 |
+
{
|
1581 |
+
"cell_type": "code",
|
1582 |
+
"execution_count": 17,
|
1583 |
+
"id": "yellow-luxury",
|
1584 |
+
"metadata": {},
|
1585 |
+
"outputs": [
|
1586 |
+
{
|
1587 |
+
"name": "stdout",
|
1588 |
+
"output_type": "stream",
|
1589 |
+
"text": [
|
1590 |
+
"{\r\n",
|
1591 |
+
" \"data\": {\r\n",
|
1592 |
+
" \"count\": 9786,\r\n",
|
1593 |
+
" \"exist\": 1,\r\n",
|
1594 |
+
" \"namespace\": \"experiment\",\r\n",
|
1595 |
+
" \"partition\": 4,\r\n",
|
1596 |
+
" \"schema\": {\r\n",
|
1597 |
+
" \"header\": \"user_star_val,star_evalu_tm,night_call_dura_rate,night_call_cnt_rate,age,cust_star,opp_belo_cnt,rcn_mode,l6m_night_call_cnt_rate,night_percent_six,brand_id\",\r\n",
|
1598 |
+
" \"sid\": \"row_num\"\r\n",
|
1599 |
+
" },\r\n",
|
1600 |
+
" \"table_name\": \"test_a\"\r\n",
|
1601 |
+
" },\r\n",
|
1602 |
+
" \"retcode\": 0,\r\n",
|
1603 |
+
" \"retmsg\": \"success\"\r\n",
|
1604 |
+
"}\r\n",
|
1605 |
+
"\r\n"
|
1606 |
+
]
|
1607 |
+
}
|
1608 |
+
],
|
1609 |
+
"source": [
|
1610 |
+
"#查看表信息\n",
|
1611 |
+
"!flow table info -t test_a -n experiment\n",
|
1612 |
+
"#!flow table info -t train_a_label -n experiment"
|
1613 |
+
]
|
1614 |
+
},
|
1615 |
+
{
|
1616 |
+
"cell_type": "code",
|
1617 |
+
"execution_count": 18,
|
1618 |
+
"id": "artistic-drilling",
|
1619 |
+
"metadata": {},
|
1620 |
+
"outputs": [],
|
1621 |
+
"source": [
|
1622 |
+
"!"
|
1623 |
+
]
|
1624 |
+
},
|
1625 |
+
{
|
1626 |
+
"cell_type": "code",
|
1627 |
+
"execution_count": 29,
|
1628 |
+
"id": "hungry-eagle",
|
1629 |
+
"metadata": {},
|
1630 |
+
"outputs": [],
|
1631 |
+
"source": [
|
1632 |
+
"train_conf = {\n",
|
1633 |
+
" \"dsl_version\": 2,\n",
|
1634 |
+
" \"initiator\": {\n",
|
1635 |
+
" \"role\": \"guest\",\n",
|
1636 |
+
" \"party_id\": 9999\n",
|
1637 |
+
" },\n",
|
1638 |
+
" \"job_parameters\": {\n",
|
1639 |
+
" \"common\": {\n",
|
1640 |
+
" \"work_mode\": 0 \n",
|
1641 |
+
" }\n",
|
1642 |
+
"},\n",
|
1643 |
+
" \"role\": {\n",
|
1644 |
+
" \"host\": [10000],\n",
|
1645 |
+
" \"guest\": [9999]\n",
|
1646 |
+
" },\n",
|
1647 |
+
" \"component_parameters\": {\n",
|
1648 |
+
" \"common\": {\n",
|
1649 |
+
" \"hetero_secure_boost_0\": {\n",
|
1650 |
+
" \"task_type\": \"classification\",\n",
|
1651 |
+
" \"objective_param\": {\n",
|
1652 |
+
" \"objective\": \"cross_entropy\"\n",
|
1653 |
+
" },\n",
|
1654 |
+
" \"num_trees\": 1,\n",
|
1655 |
+
" \"validation_freqs\": 1,\n",
|
1656 |
+
" \"encrypt_param\": {\n",
|
1657 |
+
" \"method\": \"Paillier\"\n",
|
1658 |
+
" },\n",
|
1659 |
+
" \"tree_param\": {\n",
|
1660 |
+
" \"max_depth\": 8\n",
|
1661 |
+
" },\n",
|
1662 |
+
" \"use_missing\": True\n",
|
1663 |
+
" },\n",
|
1664 |
+
" \"evaluation_0\": {\n",
|
1665 |
+
" \"eval_type\": \"binary\"\n",
|
1666 |
+
" }\n",
|
1667 |
+
" },\n",
|
1668 |
+
" \"role\": {\n",
|
1669 |
+
" \"guest\": {\n",
|
1670 |
+
" \"0\": {\n",
|
1671 |
+
" \n",
|
1672 |
+
" \"data_transform_0\": {\n",
|
1673 |
+
" \"with_label\": True,\n",
|
1674 |
+
" \"label_name\": \"label\",\n",
|
1675 |
+
" \"label_type\": \"int\",\n",
|
1676 |
+
" \"output_format\": \"dense\"\n",
|
1677 |
+
" },\n",
|
1678 |
+
" \"reader_0\": {\n",
|
1679 |
+
" \"table\": {\n",
|
1680 |
+
" \"name\": \"train_a_label\",\n",
|
1681 |
+
" \"namespace\": \"experiment\"\n",
|
1682 |
+
" }\n",
|
1683 |
+
" }\n",
|
1684 |
+
" }\n",
|
1685 |
+
" },\n",
|
1686 |
+
" \"host\": {\n",
|
1687 |
+
" \"0\": {\n",
|
1688 |
+
" \"data_transform_0\": {\n",
|
1689 |
+
" \"with_label\": False\n",
|
1690 |
+
" },\n",
|
1691 |
+
" \"reader_0\": {\n",
|
1692 |
+
" \"table\": {\n",
|
1693 |
+
" \"name\": \"train_b\",\n",
|
1694 |
+
" \"namespace\": \"experiment\"\n",
|
1695 |
+
" }\n",
|
1696 |
+
" }\n",
|
1697 |
+
" }\n",
|
1698 |
+
" }\n",
|
1699 |
+
" }\n",
|
1700 |
+
" }\n",
|
1701 |
+
"}"
|
1702 |
+
]
|
1703 |
+
},
|
1704 |
+
{
|
1705 |
+
"cell_type": "code",
|
1706 |
+
"execution_count": 30,
|
1707 |
+
"id": "loaded-ferry",
|
1708 |
+
"metadata": {},
|
1709 |
+
"outputs": [],
|
1710 |
+
"source": [
|
1711 |
+
"train_dsl = {\n",
|
1712 |
+
" \"components\": {\n",
|
1713 |
+
" \"reader_0\": {\n",
|
1714 |
+
" \"module\": \"Reader\",\n",
|
1715 |
+
" \"output\": {\n",
|
1716 |
+
" \"data\": [\"data\"]\n",
|
1717 |
+
" }\n",
|
1718 |
+
" },\n",
|
1719 |
+
" \"data_transform_0\": {\n",
|
1720 |
+
" \"module\": \"DataTransform\",\n",
|
1721 |
+
" \"input\": {\n",
|
1722 |
+
" \"data\": {\n",
|
1723 |
+
" \"data\": [\"reader_0.data\"]\n",
|
1724 |
+
" }\n",
|
1725 |
+
" },\n",
|
1726 |
+
" \"output\": {\n",
|
1727 |
+
" \"data\": [\"data\"],\n",
|
1728 |
+
" \"model\": [\"model\"]\n",
|
1729 |
+
" }\n",
|
1730 |
+
" },\n",
|
1731 |
+
" \"intersection_0\": {\n",
|
1732 |
+
" \"module\": \"Intersection\",\n",
|
1733 |
+
" \"input\": {\n",
|
1734 |
+
" \"data\": {\n",
|
1735 |
+
" \"data\": [\"data_transform_0.data\"]\n",
|
1736 |
+
" }\n",
|
1737 |
+
" },\n",
|
1738 |
+
" \"output\": {\n",
|
1739 |
+
" \"data\": [\"data\"]\n",
|
1740 |
+
" }\n",
|
1741 |
+
" }, \n",
|
1742 |
+
" \"hetero_secure_boost_0\": {\n",
|
1743 |
+
" \"module\": \"HeteroSecureBoost\",\n",
|
1744 |
+
" \"input\": {\n",
|
1745 |
+
" \"data\": {\n",
|
1746 |
+
" \"train_data\": [\"intersection_0.data\"]\n",
|
1747 |
+
" }\n",
|
1748 |
+
" },\n",
|
1749 |
+
" \"output\": {\n",
|
1750 |
+
" \"data\": [\"data\"],\n",
|
1751 |
+
" \"model\": [\"model\"]\n",
|
1752 |
+
" }\n",
|
1753 |
+
" },\n",
|
1754 |
+
" \"evaluation_0\": {\n",
|
1755 |
+
" \"module\": \"Evaluation\",\n",
|
1756 |
+
" \"input\": {\n",
|
1757 |
+
" \"data\": {\n",
|
1758 |
+
" \"data\": [\"hetero_secure_boost_0.data\"]\n",
|
1759 |
+
" }\n",
|
1760 |
+
" },\n",
|
1761 |
+
" \"output\": {\n",
|
1762 |
+
" \"data\": [\"data\"]\n",
|
1763 |
+
" }\n",
|
1764 |
+
" }\n",
|
1765 |
+
" }\n",
|
1766 |
+
"}"
|
1767 |
+
]
|
1768 |
+
},
|
1769 |
+
{
|
1770 |
+
"cell_type": "code",
|
1771 |
+
"execution_count": 31,
|
1772 |
+
"id": "blind-bachelor",
|
1773 |
+
"metadata": {
|
1774 |
+
"scrolled": true
|
1775 |
+
},
|
1776 |
+
"outputs": [
|
1777 |
+
{
|
1778 |
+
"name": "stdout",
|
1779 |
+
"output_type": "stream",
|
1780 |
+
"text": [
|
1781 |
+
"{'data': {'board_url': 'http://board:8080/index.html#/dashboard?job_id=20230424164733674031455&role=guest&party_id=9999', 'job_dsl_path': '/data/projects/fate/jobs/20230424164733674031455/job_dsl.json', 'job_id': '20230424164733674031455', 'job_runtime_conf_on_party_path': '/data/projects/fate/jobs/20230424164733674031455/guest/job_runtime_on_party_conf.json', 'job_runtime_conf_path': '/data/projects/fate/jobs/20230424164733674031455/job_runtime_conf.json', 'logs_directory': '/data/projects/fate/logs/20230424164733674031455', 'model_info': {'model_id': 'guest-9999#host-10000#model', 'model_version': '20230424164733674031455'}, 'pipeline_dsl_path': '/data/projects/fate/jobs/20230424164733674031455/pipeline_dsl.json', 'train_runtime_conf_path': '/data/projects/fate/jobs/20230424164733674031455/train_runtime_conf.json'}, 'jobId': '20230424164733674031455', 'retcode': 0, 'retmsg': 'success'}\n"
|
1782 |
+
]
|
1783 |
+
}
|
1784 |
+
],
|
1785 |
+
"source": [
|
1786 |
+
"#开始训练\n",
|
1787 |
+
"import requests\n",
|
1788 |
+
"post_data = {'job_dsl': train_dsl, 'job_runtime_conf': train_conf}\n",
|
1789 |
+
"response = requests.post(\"http://10.43.159.182:9380/v1/job/submit\", json=post_data)\n",
|
1790 |
+
"print(response.json())"
|
1791 |
+
]
|
1792 |
+
},
|
1793 |
+
{
|
1794 |
+
"cell_type": "code",
|
1795 |
+
"execution_count": null,
|
1796 |
+
"id": "apparent-treasure",
|
1797 |
+
"metadata": {},
|
1798 |
+
"outputs": [],
|
1799 |
+
"source": [
|
1800 |
+
"#登录board_url查看模型训练结果"
|
1801 |
+
]
|
1802 |
+
},
|
1803 |
+
{
|
1804 |
+
"cell_type": "code",
|
1805 |
+
"execution_count": null,
|
1806 |
+
"id": "divine-smith",
|
1807 |
+
"metadata": {},
|
1808 |
+
"outputs": [],
|
1809 |
+
"source": [
|
1810 |
+
"#模型部署\n",
|
1811 |
+
"import requests\n",
|
1812 |
+
"config_data = {\n",
|
1813 |
+
" \"job_parameters\": {\n",
|
1814 |
+
" \"model_id\": \"guest-9999#host-10000#model\",\n",
|
1815 |
+
" \"model_version\": \"20230424085041481989420\"\n",
|
1816 |
+
" }\n",
|
1817 |
+
" }\n",
|
1818 |
+
"response = requests.post(\"http://10.43.159.182:9380/v1/model/deploy\", json=config_data)\n",
|
1819 |
+
"\n",
|
1820 |
+
"print(response.json())\n"
|
1821 |
+
]
|
1822 |
+
},
|
1823 |
+
{
|
1824 |
+
"cell_type": "code",
|
1825 |
+
"execution_count": null,
|
1826 |
+
"id": "global-navigation",
|
1827 |
+
"metadata": {},
|
1828 |
+
"outputs": [],
|
1829 |
+
"source": [
|
1830 |
+
"predict_conf = {\n",
|
1831 |
+
" \"dsl_version\": 2,\n",
|
1832 |
+
" \"initiator\": {\n",
|
1833 |
+
" \"role\": \"guest\",\n",
|
1834 |
+
" \"party_id\": 9999\n",
|
1835 |
+
" },\n",
|
1836 |
+
" \"role\": {\n",
|
1837 |
+
" \"host\": [10000],\n",
|
1838 |
+
" \"guest\": [9999]\n",
|
1839 |
+
" },\n",
|
1840 |
+
" \"job_parameters\": {\n",
|
1841 |
+
" \"common\": {\n",
|
1842 |
+
" \"work_mode\": 0, \n",
|
1843 |
+
" \"job_type\": \"predict\",\n",
|
1844 |
+
" \"model_id\": \"guest-9999#host-10000#model\",\n",
|
1845 |
+
" \"model_version\": \"20230424085832841569421\"\n",
|
1846 |
+
" }\n",
|
1847 |
+
" },\n",
|
1848 |
+
" \"component_parameters\": {\n",
|
1849 |
+
" \"role\": {\n",
|
1850 |
+
" \"guest\": {\n",
|
1851 |
+
" \"0\": {\n",
|
1852 |
+
" \"reader_0\": {\n",
|
1853 |
+
" \"table\": {\n",
|
1854 |
+
" \"name\": \"test_a\",\n",
|
1855 |
+
" \"namespace\": \"experiment\"\n",
|
1856 |
+
" }\n",
|
1857 |
+
" }\n",
|
1858 |
+
" }\n",
|
1859 |
+
" },\n",
|
1860 |
+
" \"host\": {\n",
|
1861 |
+
" \"0\": {\n",
|
1862 |
+
" \"reader_0\": {\n",
|
1863 |
+
" \"table\": {\n",
|
1864 |
+
" \"name\": \"test_b\",\n",
|
1865 |
+
" \"namespace\": \"experiment\"\n",
|
1866 |
+
" }\n",
|
1867 |
+
" }\n",
|
1868 |
+
" }\n",
|
1869 |
+
" }\n",
|
1870 |
+
" }\n",
|
1871 |
+
" }\n",
|
1872 |
+
"}"
|
1873 |
+
]
|
1874 |
+
},
|
1875 |
+
{
|
1876 |
+
"cell_type": "code",
|
1877 |
+
"execution_count": null,
|
1878 |
+
"id": "affecting-accordance",
|
1879 |
+
"metadata": {},
|
1880 |
+
"outputs": [],
|
1881 |
+
"source": [
|
1882 |
+
"#预测数据\n",
|
1883 |
+
"post_data = {'job_runtime_conf': predict_conf}\n",
|
1884 |
+
"response = requests.post(\"http://10.43.159.182:9380/v1/job/submit\", json=post_data)\n",
|
1885 |
+
"print(response.json())"
|
1886 |
+
]
|
1887 |
+
},
|
1888 |
+
{
|
1889 |
+
"cell_type": "code",
|
1890 |
+
"execution_count": null,
|
1891 |
+
"id": "thermal-guatemala",
|
1892 |
+
"metadata": {},
|
1893 |
+
"outputs": [],
|
1894 |
+
"source": [
|
1895 |
+
"#登录board_url查看模型预测结果"
|
1896 |
+
]
|
1897 |
+
},
|
1898 |
+
{
|
1899 |
+
"cell_type": "code",
|
1900 |
+
"execution_count": null,
|
1901 |
+
"id": "fatal-palestine",
|
1902 |
+
"metadata": {},
|
1903 |
+
"outputs": [],
|
1904 |
+
"source": [
|
1905 |
+
"!flow component output-data -j 20230424085846677853422 -r guest -p 9999 -cpn hetero_secure_boost_0 --output-path ./"
|
1906 |
+
]
|
1907 |
+
},
|
1908 |
+
{
|
1909 |
+
"cell_type": "code",
|
1910 |
+
"execution_count": null,
|
1911 |
+
"id": "dental-million",
|
1912 |
+
"metadata": {},
|
1913 |
+
"outputs": [],
|
1914 |
+
"source": []
|
1915 |
+
},
|
1916 |
+
{
|
1917 |
+
"cell_type": "code",
|
1918 |
+
"execution_count": null,
|
1919 |
+
"id": "detected-adventure",
|
1920 |
+
"metadata": {},
|
1921 |
+
"outputs": [],
|
1922 |
+
"source": []
|
1923 |
+
}
|
1924 |
+
],
|
1925 |
+
"metadata": {
|
1926 |
+
"kernelspec": {
|
1927 |
+
"display_name": "Python 3",
|
1928 |
+
"language": "python",
|
1929 |
+
"name": "python3"
|
1930 |
+
},
|
1931 |
+
"language_info": {
|
1932 |
+
"codemirror_mode": {
|
1933 |
+
"name": "ipython",
|
1934 |
+
"version": 3
|
1935 |
+
},
|
1936 |
+
"file_extension": ".py",
|
1937 |
+
"mimetype": "text/x-python",
|
1938 |
+
"name": "python",
|
1939 |
+
"nbconvert_exporter": "python",
|
1940 |
+
"pygments_lexer": "ipython3",
|
1941 |
+
"version": "3.7.10"
|
1942 |
+
}
|
1943 |
+
},
|
1944 |
+
"nbformat": 4,
|
1945 |
+
"nbformat_minor": 5
|
1946 |
+
}
|