|
a |
|
b/No-adjustment/R2-XB-U.ipynb |
|
|
1 |
{ |
|
|
2 |
"cells": [ |
|
|
3 |
{ |
|
|
4 |
"cell_type": "code", |
|
|
5 |
"execution_count": 1, |
|
|
6 |
"metadata": {}, |
|
|
7 |
"outputs": [ |
|
|
8 |
{ |
|
|
9 |
"data": { |
|
|
10 |
"text/html": [ |
|
|
11 |
" <script type=\"text/javascript\">\n", |
|
|
12 |
" window.PlotlyConfig = {MathJaxConfig: 'local'};\n", |
|
|
13 |
" if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}\n", |
|
|
14 |
" if (typeof require !== 'undefined') {\n", |
|
|
15 |
" require.undef(\"plotly\");\n", |
|
|
16 |
" requirejs.config({\n", |
|
|
17 |
" paths: {\n", |
|
|
18 |
" 'plotly': ['https://cdn.plot.ly/plotly-latest.min']\n", |
|
|
19 |
" }\n", |
|
|
20 |
" });\n", |
|
|
21 |
" require(['plotly'], function(Plotly) {\n", |
|
|
22 |
" window._Plotly = Plotly;\n", |
|
|
23 |
" });\n", |
|
|
24 |
" }\n", |
|
|
25 |
" </script>\n", |
|
|
26 |
" " |
|
|
27 |
] |
|
|
28 |
}, |
|
|
29 |
"metadata": {}, |
|
|
30 |
"output_type": "display_data" |
|
|
31 |
} |
|
|
32 |
], |
|
|
33 |
"source": [ |
|
|
34 |
"# Import libraries\n", |
|
|
35 |
"import numpy as np\n", |
|
|
36 |
"import pandas as pd\n", |
|
|
37 |
"import matplotlib.pyplot as plt\n", |
|
|
38 |
"import getpass\n", |
|
|
39 |
"import pdvega\n", |
|
|
40 |
"import plotly.graph_objs as go\n", |
|
|
41 |
"\n", |
|
|
42 |
"from plotly.offline import iplot, init_notebook_mode\n", |
|
|
43 |
"import plotly.io as pio\n", |
|
|
44 |
"from plotly.graph_objs import *\n", |
|
|
45 |
"\n", |
|
|
46 |
"# for configuring connection \n", |
|
|
47 |
"from configobj import ConfigObj\n", |
|
|
48 |
"import os\n", |
|
|
49 |
"\n", |
|
|
50 |
"%matplotlib inline\n", |
|
|
51 |
"\n", |
|
|
52 |
"\n", |
|
|
53 |
"import os\n", |
|
|
54 |
"\n", |
|
|
55 |
"\n", |
|
|
56 |
"from sklearn import linear_model\n", |
|
|
57 |
"from sklearn import metrics\n", |
|
|
58 |
"from sklearn.model_selection import train_test_split\n", |
|
|
59 |
"\n", |
|
|
60 |
"#configure the notebook for use in offline mode\n", |
|
|
61 |
"init_notebook_mode(connected=True)" |
|
|
62 |
] |
|
|
63 |
}, |
|
|
64 |
{ |
|
|
65 |
"cell_type": "code", |
|
|
66 |
"execution_count": 2, |
|
|
67 |
"metadata": {}, |
|
|
68 |
"outputs": [ |
|
|
69 |
{ |
|
|
70 |
"data": { |
|
|
71 |
"text/html": [ |
|
|
72 |
"<div>\n", |
|
|
73 |
"<style scoped>\n", |
|
|
74 |
" .dataframe tbody tr th:only-of-type {\n", |
|
|
75 |
" vertical-align: middle;\n", |
|
|
76 |
" }\n", |
|
|
77 |
"\n", |
|
|
78 |
" .dataframe tbody tr th {\n", |
|
|
79 |
" vertical-align: top;\n", |
|
|
80 |
" }\n", |
|
|
81 |
"\n", |
|
|
82 |
" .dataframe thead th {\n", |
|
|
83 |
" text-align: right;\n", |
|
|
84 |
" }\n", |
|
|
85 |
"</style>\n", |
|
|
86 |
"<table border=\"1\" class=\"dataframe\">\n", |
|
|
87 |
" <thead>\n", |
|
|
88 |
" <tr style=\"text-align: right;\">\n", |
|
|
89 |
" <th></th>\n", |
|
|
90 |
" <th>Unnamed: 0</th>\n", |
|
|
91 |
" <th>hospitalid</th>\n", |
|
|
92 |
" <th>sodium</th>\n", |
|
|
93 |
" <th>electivesurgery</th>\n", |
|
|
94 |
" <th>vent</th>\n", |
|
|
95 |
" <th>dialysis</th>\n", |
|
|
96 |
" <th>gcs</th>\n", |
|
|
97 |
" <th>urine</th>\n", |
|
|
98 |
" <th>wbc</th>\n", |
|
|
99 |
" <th>temperature</th>\n", |
|
|
100 |
" <th>...</th>\n", |
|
|
101 |
" <th>m11_True</th>\n", |
|
|
102 |
" <th>m12_True</th>\n", |
|
|
103 |
" <th>m13_True</th>\n", |
|
|
104 |
" <th>m14_True</th>\n", |
|
|
105 |
" <th>m15_True</th>\n", |
|
|
106 |
" <th>m16_True</th>\n", |
|
|
107 |
" <th>m17_True</th>\n", |
|
|
108 |
" <th>m18_True</th>\n", |
|
|
109 |
" <th>m19_True</th>\n", |
|
|
110 |
" <th>m20_True</th>\n", |
|
|
111 |
" </tr>\n", |
|
|
112 |
" </thead>\n", |
|
|
113 |
" <tbody>\n", |
|
|
114 |
" <tr>\n", |
|
|
115 |
" <th>0</th>\n", |
|
|
116 |
" <td>0</td>\n", |
|
|
117 |
" <td>59.0</td>\n", |
|
|
118 |
" <td>139.0</td>\n", |
|
|
119 |
" <td>-1.0</td>\n", |
|
|
120 |
" <td>0.0</td>\n", |
|
|
121 |
" <td>0.0</td>\n", |
|
|
122 |
" <td>15.0</td>\n", |
|
|
123 |
" <td>-1.0</td>\n", |
|
|
124 |
" <td>14.7</td>\n", |
|
|
125 |
" <td>36.1</td>\n", |
|
|
126 |
" <td>...</td>\n", |
|
|
127 |
" <td>1</td>\n", |
|
|
128 |
" <td>0</td>\n", |
|
|
129 |
" <td>0</td>\n", |
|
|
130 |
" <td>1</td>\n", |
|
|
131 |
" <td>1</td>\n", |
|
|
132 |
" <td>0</td>\n", |
|
|
133 |
" <td>0</td>\n", |
|
|
134 |
" <td>0</td>\n", |
|
|
135 |
" <td>1</td>\n", |
|
|
136 |
" <td>0</td>\n", |
|
|
137 |
" </tr>\n", |
|
|
138 |
" <tr>\n", |
|
|
139 |
" <th>1</th>\n", |
|
|
140 |
" <td>1</td>\n", |
|
|
141 |
" <td>73.0</td>\n", |
|
|
142 |
" <td>134.0</td>\n", |
|
|
143 |
" <td>-1.0</td>\n", |
|
|
144 |
" <td>0.0</td>\n", |
|
|
145 |
" <td>0.0</td>\n", |
|
|
146 |
" <td>13.0</td>\n", |
|
|
147 |
" <td>-1.0</td>\n", |
|
|
148 |
" <td>14.1</td>\n", |
|
|
149 |
" <td>39.3</td>\n", |
|
|
150 |
" <td>...</td>\n", |
|
|
151 |
" <td>1</td>\n", |
|
|
152 |
" <td>0</td>\n", |
|
|
153 |
" <td>0</td>\n", |
|
|
154 |
" <td>1</td>\n", |
|
|
155 |
" <td>1</td>\n", |
|
|
156 |
" <td>0</td>\n", |
|
|
157 |
" <td>0</td>\n", |
|
|
158 |
" <td>0</td>\n", |
|
|
159 |
" <td>1</td>\n", |
|
|
160 |
" <td>0</td>\n", |
|
|
161 |
" </tr>\n", |
|
|
162 |
" <tr>\n", |
|
|
163 |
" <th>2</th>\n", |
|
|
164 |
" <td>2</td>\n", |
|
|
165 |
" <td>73.0</td>\n", |
|
|
166 |
" <td>-1.0</td>\n", |
|
|
167 |
" <td>1.0</td>\n", |
|
|
168 |
" <td>1.0</td>\n", |
|
|
169 |
" <td>0.0</td>\n", |
|
|
170 |
" <td>15.0</td>\n", |
|
|
171 |
" <td>-1.0</td>\n", |
|
|
172 |
" <td>8.0</td>\n", |
|
|
173 |
" <td>34.8</td>\n", |
|
|
174 |
" <td>...</td>\n", |
|
|
175 |
" <td>0</td>\n", |
|
|
176 |
" <td>0</td>\n", |
|
|
177 |
" <td>1</td>\n", |
|
|
178 |
" <td>0</td>\n", |
|
|
179 |
" <td>0</td>\n", |
|
|
180 |
" <td>1</td>\n", |
|
|
181 |
" <td>0</td>\n", |
|
|
182 |
" <td>1</td>\n", |
|
|
183 |
" <td>0</td>\n", |
|
|
184 |
" <td>0</td>\n", |
|
|
185 |
" </tr>\n", |
|
|
186 |
" <tr>\n", |
|
|
187 |
" <th>3</th>\n", |
|
|
188 |
" <td>3</td>\n", |
|
|
189 |
" <td>63.0</td>\n", |
|
|
190 |
" <td>137.0</td>\n", |
|
|
191 |
" <td>-1.0</td>\n", |
|
|
192 |
" <td>0.0</td>\n", |
|
|
193 |
" <td>0.0</td>\n", |
|
|
194 |
" <td>15.0</td>\n", |
|
|
195 |
" <td>-1.0</td>\n", |
|
|
196 |
" <td>10.9</td>\n", |
|
|
197 |
" <td>36.6</td>\n", |
|
|
198 |
" <td>...</td>\n", |
|
|
199 |
" <td>1</td>\n", |
|
|
200 |
" <td>0</td>\n", |
|
|
201 |
" <td>1</td>\n", |
|
|
202 |
" <td>1</td>\n", |
|
|
203 |
" <td>1</td>\n", |
|
|
204 |
" <td>0</td>\n", |
|
|
205 |
" <td>0</td>\n", |
|
|
206 |
" <td>1</td>\n", |
|
|
207 |
" <td>1</td>\n", |
|
|
208 |
" <td>0</td>\n", |
|
|
209 |
" </tr>\n", |
|
|
210 |
" <tr>\n", |
|
|
211 |
" <th>4</th>\n", |
|
|
212 |
" <td>4</td>\n", |
|
|
213 |
" <td>63.0</td>\n", |
|
|
214 |
" <td>135.0</td>\n", |
|
|
215 |
" <td>-1.0</td>\n", |
|
|
216 |
" <td>0.0</td>\n", |
|
|
217 |
" <td>0.0</td>\n", |
|
|
218 |
" <td>15.0</td>\n", |
|
|
219 |
" <td>-1.0</td>\n", |
|
|
220 |
" <td>5.9</td>\n", |
|
|
221 |
" <td>35.0</td>\n", |
|
|
222 |
" <td>...</td>\n", |
|
|
223 |
" <td>0</td>\n", |
|
|
224 |
" <td>0</td>\n", |
|
|
225 |
" <td>1</td>\n", |
|
|
226 |
" <td>0</td>\n", |
|
|
227 |
" <td>0</td>\n", |
|
|
228 |
" <td>0</td>\n", |
|
|
229 |
" <td>0</td>\n", |
|
|
230 |
" <td>1</td>\n", |
|
|
231 |
" <td>0</td>\n", |
|
|
232 |
" <td>0</td>\n", |
|
|
233 |
" </tr>\n", |
|
|
234 |
" </tbody>\n", |
|
|
235 |
"</table>\n", |
|
|
236 |
"<p>5 rows × 85 columns</p>\n", |
|
|
237 |
"</div>" |
|
|
238 |
], |
|
|
239 |
"text/plain": [ |
|
|
240 |
" Unnamed: 0 hospitalid sodium electivesurgery vent dialysis gcs \\\n", |
|
|
241 |
"0 0 59.0 139.0 -1.0 0.0 0.0 15.0 \n", |
|
|
242 |
"1 1 73.0 134.0 -1.0 0.0 0.0 13.0 \n", |
|
|
243 |
"2 2 73.0 -1.0 1.0 1.0 0.0 15.0 \n", |
|
|
244 |
"3 3 63.0 137.0 -1.0 0.0 0.0 15.0 \n", |
|
|
245 |
"4 4 63.0 135.0 -1.0 0.0 0.0 15.0 \n", |
|
|
246 |
"\n", |
|
|
247 |
" urine wbc temperature ... m11_True m12_True m13_True m14_True \\\n", |
|
|
248 |
"0 -1.0 14.7 36.1 ... 1 0 0 1 \n", |
|
|
249 |
"1 -1.0 14.1 39.3 ... 1 0 0 1 \n", |
|
|
250 |
"2 -1.0 8.0 34.8 ... 0 0 1 0 \n", |
|
|
251 |
"3 -1.0 10.9 36.6 ... 1 0 1 1 \n", |
|
|
252 |
"4 -1.0 5.9 35.0 ... 0 0 1 0 \n", |
|
|
253 |
"\n", |
|
|
254 |
" m15_True m16_True m17_True m18_True m19_True m20_True \n", |
|
|
255 |
"0 1 0 0 0 1 0 \n", |
|
|
256 |
"1 1 0 0 0 1 0 \n", |
|
|
257 |
"2 0 1 0 1 0 0 \n", |
|
|
258 |
"3 1 0 0 1 1 0 \n", |
|
|
259 |
"4 0 0 0 1 0 0 \n", |
|
|
260 |
"\n", |
|
|
261 |
"[5 rows x 85 columns]" |
|
|
262 |
] |
|
|
263 |
}, |
|
|
264 |
"execution_count": 2, |
|
|
265 |
"metadata": {}, |
|
|
266 |
"output_type": "execute_result" |
|
|
267 |
} |
|
|
268 |
], |
|
|
269 |
"source": [ |
|
|
270 |
"df= pd.read_csv(\"analysis.csv\")\n", |
|
|
271 |
"df.head()" |
|
|
272 |
] |
|
|
273 |
}, |
|
|
274 |
{ |
|
|
275 |
"cell_type": "code", |
|
|
276 |
"execution_count": 3, |
|
|
277 |
"metadata": {}, |
|
|
278 |
"outputs": [ |
|
|
279 |
{ |
|
|
280 |
"data": { |
|
|
281 |
"text/plain": [ |
|
|
282 |
"(95148, 85)" |
|
|
283 |
] |
|
|
284 |
}, |
|
|
285 |
"execution_count": 3, |
|
|
286 |
"metadata": {}, |
|
|
287 |
"output_type": "execute_result" |
|
|
288 |
} |
|
|
289 |
], |
|
|
290 |
"source": [ |
|
|
291 |
"df.shape" |
|
|
292 |
] |
|
|
293 |
}, |
|
|
294 |
{ |
|
|
295 |
"cell_type": "code", |
|
|
296 |
"execution_count": 4, |
|
|
297 |
"metadata": {}, |
|
|
298 |
"outputs": [], |
|
|
299 |
"source": [ |
|
|
300 |
"del df['hospitalid']\n", |
|
|
301 |
"\n", |
|
|
302 |
"df = df.drop(df.columns[[0]], axis=1)\n", |
|
|
303 |
"df = df.drop(df.columns[[63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82]], axis=1)" |
|
|
304 |
] |
|
|
305 |
}, |
|
|
306 |
{ |
|
|
307 |
"cell_type": "code", |
|
|
308 |
"execution_count": 5, |
|
|
309 |
"metadata": {}, |
|
|
310 |
"outputs": [ |
|
|
311 |
{ |
|
|
312 |
"data": { |
|
|
313 |
"text/plain": [ |
|
|
314 |
"sodium 18244\n", |
|
|
315 |
"electivesurgery 74997\n", |
|
|
316 |
"vent 0\n", |
|
|
317 |
"dialysis 0\n", |
|
|
318 |
"gcs 1728\n", |
|
|
319 |
"urine 45829\n", |
|
|
320 |
"wbc 22141\n", |
|
|
321 |
"temperature 4139\n", |
|
|
322 |
"respiratoryrate 582\n", |
|
|
323 |
"heartrate 188\n", |
|
|
324 |
"meanbp 263\n", |
|
|
325 |
"creatinine 18332\n", |
|
|
326 |
"ph 73474\n", |
|
|
327 |
"hematocrit 20021\n", |
|
|
328 |
"albumin 58143\n", |
|
|
329 |
"pao2 73474\n", |
|
|
330 |
"pco2 73474\n", |
|
|
331 |
"bun 18774\n", |
|
|
332 |
"glucose 10909\n", |
|
|
333 |
"bilirubin 60797\n", |
|
|
334 |
"fio2 73474\n", |
|
|
335 |
"age 3356\n", |
|
|
336 |
"thrombolytics 0\n", |
|
|
337 |
"aids 0\n", |
|
|
338 |
"hepaticfailure 0\n", |
|
|
339 |
"lymphoma 0\n", |
|
|
340 |
"metastaticcancer 0\n", |
|
|
341 |
"leukemia 0\n", |
|
|
342 |
"immunosuppression 0\n", |
|
|
343 |
"cirrhosis 0\n", |
|
|
344 |
" ... \n", |
|
|
345 |
"admitsource_1.0 0\n", |
|
|
346 |
"admitsource_2.0 0\n", |
|
|
347 |
"admitsource_3.0 0\n", |
|
|
348 |
"admitsource_4.0 0\n", |
|
|
349 |
"admitsource_5.0 0\n", |
|
|
350 |
"admitsource_6.0 0\n", |
|
|
351 |
"admitsource_7.0 0\n", |
|
|
352 |
"admitsource_8.0 0\n", |
|
|
353 |
"diaggroup_ARF 0\n", |
|
|
354 |
"diaggroup_Asthma-Emphys 0\n", |
|
|
355 |
"diaggroup_CABG 0\n", |
|
|
356 |
"diaggroup_CHF 0\n", |
|
|
357 |
"diaggroup_CVA 0\n", |
|
|
358 |
"diaggroup_CVOther 0\n", |
|
|
359 |
"diaggroup_CardiacArrest 0\n", |
|
|
360 |
"diaggroup_ChestPainUnknown 0\n", |
|
|
361 |
"diaggroup_Coma 0\n", |
|
|
362 |
"diaggroup_DKA 0\n", |
|
|
363 |
"diaggroup_GIBleed 0\n", |
|
|
364 |
"diaggroup_GIObstruction 0\n", |
|
|
365 |
"diaggroup_Neuro 0\n", |
|
|
366 |
"diaggroup_Other 0\n", |
|
|
367 |
"diaggroup_Overdose 0\n", |
|
|
368 |
"diaggroup_PNA 0\n", |
|
|
369 |
"diaggroup_RespMedOther 0\n", |
|
|
370 |
"diaggroup_Sepsis 0\n", |
|
|
371 |
"diaggroup_Trauma 0\n", |
|
|
372 |
"diaggroup_ValveDz 0\n", |
|
|
373 |
"gender_Male 0\n", |
|
|
374 |
"gender_Other 0\n", |
|
|
375 |
"Length: 63, dtype: int64" |
|
|
376 |
] |
|
|
377 |
}, |
|
|
378 |
"execution_count": 5, |
|
|
379 |
"metadata": {}, |
|
|
380 |
"output_type": "execute_result" |
|
|
381 |
} |
|
|
382 |
], |
|
|
383 |
"source": [ |
|
|
384 |
"missing_values_count = df.isnull().sum()\n", |
|
|
385 |
"#df.replace('-1.0', np.nan)\n", |
|
|
386 |
"df = df.replace({-1.0:np.nan, -1.0:np.nan})\n", |
|
|
387 |
"df.head()\n", |
|
|
388 |
"missing_values_count = df.isnull().sum()\n", |
|
|
389 |
"missing_values_count" |
|
|
390 |
] |
|
|
391 |
}, |
|
|
392 |
{ |
|
|
393 |
"cell_type": "markdown", |
|
|
394 |
"metadata": {}, |
|
|
395 |
"source": [ |
|
|
396 |
"**We moved all the pre-processing including splitting>imputation>Standardization to the CV iterations**" |
|
|
397 |
] |
|
|
398 |
}, |
|
|
399 |
{ |
|
|
400 |
"cell_type": "code", |
|
|
401 |
"execution_count": 6, |
|
|
402 |
"metadata": {}, |
|
|
403 |
"outputs": [], |
|
|
404 |
"source": [ |
|
|
405 |
"cols_to_norm=['gcs', 'urine', 'wbc', 'sodium',\n", |
|
|
406 |
" 'temperature', 'respiratoryrate', 'heartrate', 'meanbp', 'creatinine',\n", |
|
|
407 |
" 'ph', 'hematocrit', 'albumin', 'pao2', 'pco2', 'bun', 'glucose',\n", |
|
|
408 |
" 'bilirubin', 'fio2', 'age', 'offset']\n", |
|
|
409 |
"\n", |
|
|
410 |
"X=df.drop('destcopy', 1)\n", |
|
|
411 |
"y=df['destcopy']\n", |
|
|
412 |
"df_cols = list(X) #fancy impute removes column names." |
|
|
413 |
] |
|
|
414 |
}, |
|
|
415 |
{ |
|
|
416 |
"cell_type": "code", |
|
|
417 |
"execution_count": 7, |
|
|
418 |
"metadata": {}, |
|
|
419 |
"outputs": [ |
|
|
420 |
{ |
|
|
421 |
"data": { |
|
|
422 |
"text/plain": [ |
|
|
423 |
"Index(['sodium', 'electivesurgery', 'vent', 'dialysis', 'gcs', 'urine', 'wbc',\n", |
|
|
424 |
" 'temperature', 'respiratoryrate', 'heartrate', 'meanbp', 'creatinine',\n", |
|
|
425 |
" 'ph', 'hematocrit', 'albumin', 'pao2', 'pco2', 'bun', 'glucose',\n", |
|
|
426 |
" 'bilirubin', 'fio2', 'age', 'thrombolytics', 'aids', 'hepaticfailure',\n", |
|
|
427 |
" 'lymphoma', 'metastaticcancer', 'leukemia', 'immunosuppression',\n", |
|
|
428 |
" 'cirrhosis', 'readmit', 'offset', 'destcopy', 'admitsource_1.0',\n", |
|
|
429 |
" 'admitsource_2.0', 'admitsource_3.0', 'admitsource_4.0',\n", |
|
|
430 |
" 'admitsource_5.0', 'admitsource_6.0', 'admitsource_7.0',\n", |
|
|
431 |
" 'admitsource_8.0', 'diaggroup_ARF', 'diaggroup_Asthma-Emphys',\n", |
|
|
432 |
" 'diaggroup_CABG', 'diaggroup_CHF', 'diaggroup_CVA', 'diaggroup_CVOther',\n", |
|
|
433 |
" 'diaggroup_CardiacArrest', 'diaggroup_ChestPainUnknown',\n", |
|
|
434 |
" 'diaggroup_Coma', 'diaggroup_DKA', 'diaggroup_GIBleed',\n", |
|
|
435 |
" 'diaggroup_GIObstruction', 'diaggroup_Neuro', 'diaggroup_Other',\n", |
|
|
436 |
" 'diaggroup_Overdose', 'diaggroup_PNA', 'diaggroup_RespMedOther',\n", |
|
|
437 |
" 'diaggroup_Sepsis', 'diaggroup_Trauma', 'diaggroup_ValveDz',\n", |
|
|
438 |
" 'gender_Male', 'gender_Other'],\n", |
|
|
439 |
" dtype='object')" |
|
|
440 |
] |
|
|
441 |
}, |
|
|
442 |
"execution_count": 7, |
|
|
443 |
"metadata": {}, |
|
|
444 |
"output_type": "execute_result" |
|
|
445 |
} |
|
|
446 |
], |
|
|
447 |
"source": [ |
|
|
448 |
"df.columns" |
|
|
449 |
] |
|
|
450 |
}, |
|
|
451 |
{ |
|
|
452 |
"cell_type": "markdown", |
|
|
453 |
"metadata": {}, |
|
|
454 |
"source": [ |
|
|
455 |
"**XGB**" |
|
|
456 |
] |
|
|
457 |
}, |
|
|
458 |
{ |
|
|
459 |
"cell_type": "code", |
|
|
460 |
"execution_count": null, |
|
|
461 |
"metadata": {}, |
|
|
462 |
"outputs": [ |
|
|
463 |
{ |
|
|
464 |
"name": "stderr", |
|
|
465 |
"output_type": "stream", |
|
|
466 |
"text": [ |
|
|
467 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:42: SettingWithCopyWarning:\n", |
|
|
468 |
"\n", |
|
|
469 |
"\n", |
|
|
470 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
471 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
472 |
"\n", |
|
|
473 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
474 |
"\n", |
|
|
475 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
476 |
"\n", |
|
|
477 |
"\n", |
|
|
478 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
479 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
480 |
"\n", |
|
|
481 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
482 |
"\n", |
|
|
483 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:43: SettingWithCopyWarning:\n", |
|
|
484 |
"\n", |
|
|
485 |
"\n", |
|
|
486 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
487 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
488 |
"\n", |
|
|
489 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
490 |
"\n", |
|
|
491 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
492 |
"\n", |
|
|
493 |
"\n", |
|
|
494 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
495 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
496 |
"\n", |
|
|
497 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
498 |
"\n" |
|
|
499 |
] |
|
|
500 |
}, |
|
|
501 |
{ |
|
|
502 |
"name": "stdout", |
|
|
503 |
"output_type": "stream", |
|
|
504 |
"text": [ |
|
|
505 |
"For fold 1:\n", |
|
|
506 |
"Accuracy: 0.7585916973200211\n", |
|
|
507 |
"f-score: 0.7585916973200211\n", |
|
|
508 |
" pre rec spe f1 geo iba sup\n", |
|
|
509 |
"\n", |
|
|
510 |
" 1 0.54 0.48 0.97 0.51 0.68 0.45 642\n", |
|
|
511 |
" 2 0.79 0.96 0.37 0.87 0.59 0.37 6776\n", |
|
|
512 |
" 3 0.58 0.24 0.96 0.34 0.48 0.21 1716\n", |
|
|
513 |
" 4 0.31 0.01 1.00 0.02 0.10 0.01 381\n", |
|
|
514 |
"\n", |
|
|
515 |
"avg / total 0.72 0.76 0.54 0.71 0.56 0.33 9515\n", |
|
|
516 |
"\n", |
|
|
517 |
"[[ 310 239 89 4]\n", |
|
|
518 |
" [ 102 6493 176 5]\n", |
|
|
519 |
" [ 137 1168 411 0]\n", |
|
|
520 |
" [ 21 325 31 4]]\n" |
|
|
521 |
] |
|
|
522 |
}, |
|
|
523 |
{ |
|
|
524 |
"name": "stderr", |
|
|
525 |
"output_type": "stream", |
|
|
526 |
"text": [ |
|
|
527 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:42: SettingWithCopyWarning:\n", |
|
|
528 |
"\n", |
|
|
529 |
"\n", |
|
|
530 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
531 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
532 |
"\n", |
|
|
533 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
534 |
"\n", |
|
|
535 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
536 |
"\n", |
|
|
537 |
"\n", |
|
|
538 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
539 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
540 |
"\n", |
|
|
541 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
542 |
"\n", |
|
|
543 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:43: SettingWithCopyWarning:\n", |
|
|
544 |
"\n", |
|
|
545 |
"\n", |
|
|
546 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
547 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
548 |
"\n", |
|
|
549 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
550 |
"\n", |
|
|
551 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
552 |
"\n", |
|
|
553 |
"\n", |
|
|
554 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
555 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
556 |
"\n", |
|
|
557 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
558 |
"\n" |
|
|
559 |
] |
|
|
560 |
}, |
|
|
561 |
{ |
|
|
562 |
"name": "stdout", |
|
|
563 |
"output_type": "stream", |
|
|
564 |
"text": [ |
|
|
565 |
"For fold 2:\n", |
|
|
566 |
"Accuracy: 0.7777193904361535\n", |
|
|
567 |
"f-score: 0.7777193904361535\n", |
|
|
568 |
" pre rec spe f1 geo iba sup\n", |
|
|
569 |
"\n", |
|
|
570 |
" 1 0.60 0.49 0.96 0.54 0.69 0.45 974\n", |
|
|
571 |
" 2 0.87 0.90 0.48 0.88 0.66 0.45 7520\n", |
|
|
572 |
" 3 0.20 0.27 0.92 0.23 0.49 0.23 697\n", |
|
|
573 |
" 4 0.09 0.01 1.00 0.01 0.08 0.01 324\n", |
|
|
574 |
"\n", |
|
|
575 |
"avg / total 0.76 0.78 0.58 0.77 0.63 0.42 9515\n", |
|
|
576 |
"\n", |
|
|
577 |
"[[ 477 347 149 1]\n", |
|
|
578 |
" [ 199 6735 567 19]\n", |
|
|
579 |
" [ 99 412 186 0]\n", |
|
|
580 |
" [ 17 272 33 2]]\n" |
|
|
581 |
] |
|
|
582 |
}, |
|
|
583 |
{ |
|
|
584 |
"name": "stderr", |
|
|
585 |
"output_type": "stream", |
|
|
586 |
"text": [ |
|
|
587 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:42: SettingWithCopyWarning:\n", |
|
|
588 |
"\n", |
|
|
589 |
"\n", |
|
|
590 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
591 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
592 |
"\n", |
|
|
593 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
594 |
"\n", |
|
|
595 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
596 |
"\n", |
|
|
597 |
"\n", |
|
|
598 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
599 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
600 |
"\n", |
|
|
601 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
602 |
"\n", |
|
|
603 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:43: SettingWithCopyWarning:\n", |
|
|
604 |
"\n", |
|
|
605 |
"\n", |
|
|
606 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
607 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
608 |
"\n", |
|
|
609 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
610 |
"\n", |
|
|
611 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
612 |
"\n", |
|
|
613 |
"\n", |
|
|
614 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
615 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
616 |
"\n", |
|
|
617 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
618 |
"\n" |
|
|
619 |
] |
|
|
620 |
}, |
|
|
621 |
{ |
|
|
622 |
"name": "stdout", |
|
|
623 |
"output_type": "stream", |
|
|
624 |
"text": [ |
|
|
625 |
"For fold 3:\n", |
|
|
626 |
"Accuracy: 0.7480819758276406\n", |
|
|
627 |
"f-score: 0.7480819758276406\n", |
|
|
628 |
" pre rec spe f1 geo iba sup\n", |
|
|
629 |
"\n", |
|
|
630 |
" 1 0.67 0.56 0.96 0.61 0.73 0.52 1247\n", |
|
|
631 |
" 2 0.80 0.92 0.49 0.86 0.67 0.47 6585\n", |
|
|
632 |
" 3 0.40 0.24 0.93 0.30 0.47 0.21 1462\n", |
|
|
633 |
" 4 0.08 0.00 1.00 0.01 0.07 0.00 221\n", |
|
|
634 |
"\n", |
|
|
635 |
"avg / total 0.70 0.75 0.63 0.72 0.63 0.42 9515\n", |
|
|
636 |
"\n", |
|
|
637 |
"[[ 701 380 162 4]\n", |
|
|
638 |
" [ 194 6066 317 8]\n", |
|
|
639 |
" [ 143 969 350 0]\n", |
|
|
640 |
" [ 16 158 46 1]]\n" |
|
|
641 |
] |
|
|
642 |
}, |
|
|
643 |
{ |
|
|
644 |
"name": "stderr", |
|
|
645 |
"output_type": "stream", |
|
|
646 |
"text": [ |
|
|
647 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:42: SettingWithCopyWarning:\n", |
|
|
648 |
"\n", |
|
|
649 |
"\n", |
|
|
650 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
651 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
652 |
"\n", |
|
|
653 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
654 |
"\n", |
|
|
655 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
656 |
"\n", |
|
|
657 |
"\n", |
|
|
658 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
659 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
660 |
"\n", |
|
|
661 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
662 |
"\n", |
|
|
663 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:43: SettingWithCopyWarning:\n", |
|
|
664 |
"\n", |
|
|
665 |
"\n", |
|
|
666 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
667 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
668 |
"\n", |
|
|
669 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
670 |
"\n", |
|
|
671 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
672 |
"\n", |
|
|
673 |
"\n", |
|
|
674 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
675 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
676 |
"\n", |
|
|
677 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
678 |
"\n" |
|
|
679 |
] |
|
|
680 |
}, |
|
|
681 |
{ |
|
|
682 |
"name": "stdout", |
|
|
683 |
"output_type": "stream", |
|
|
684 |
"text": [ |
|
|
685 |
"For fold 4:\n", |
|
|
686 |
"Accuracy: 0.7147661586967945\n", |
|
|
687 |
"f-score: 0.7147661586967945\n", |
|
|
688 |
" pre rec spe f1 geo iba sup\n", |
|
|
689 |
"\n", |
|
|
690 |
" 1 0.67 0.51 0.97 0.58 0.70 0.47 1129\n", |
|
|
691 |
" 2 0.74 0.95 0.35 0.83 0.57 0.35 6348\n", |
|
|
692 |
" 3 0.35 0.15 0.96 0.21 0.38 0.14 1285\n", |
|
|
693 |
" 4 0.36 0.01 1.00 0.01 0.07 0.00 753\n", |
|
|
694 |
"\n", |
|
|
695 |
"avg / total 0.65 0.71 0.56 0.66 0.52 0.31 9515\n", |
|
|
696 |
"\n", |
|
|
697 |
"[[ 573 433 122 1]\n", |
|
|
698 |
" [ 118 6026 202 2]\n", |
|
|
699 |
" [ 124 959 198 4]\n", |
|
|
700 |
" [ 38 672 39 4]]\n" |
|
|
701 |
] |
|
|
702 |
}, |
|
|
703 |
{ |
|
|
704 |
"name": "stderr", |
|
|
705 |
"output_type": "stream", |
|
|
706 |
"text": [ |
|
|
707 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:42: SettingWithCopyWarning:\n", |
|
|
708 |
"\n", |
|
|
709 |
"\n", |
|
|
710 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
711 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
712 |
"\n", |
|
|
713 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
714 |
"\n", |
|
|
715 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
716 |
"\n", |
|
|
717 |
"\n", |
|
|
718 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
719 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
720 |
"\n", |
|
|
721 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
722 |
"\n", |
|
|
723 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:43: SettingWithCopyWarning:\n", |
|
|
724 |
"\n", |
|
|
725 |
"\n", |
|
|
726 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
727 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
728 |
"\n", |
|
|
729 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
730 |
"\n", |
|
|
731 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
732 |
"\n", |
|
|
733 |
"\n", |
|
|
734 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
735 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
736 |
"\n", |
|
|
737 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
738 |
"\n" |
|
|
739 |
] |
|
|
740 |
}, |
|
|
741 |
{ |
|
|
742 |
"name": "stdout", |
|
|
743 |
"output_type": "stream", |
|
|
744 |
"text": [ |
|
|
745 |
"For fold 5:\n", |
|
|
746 |
"Accuracy: 0.7389385181292696\n", |
|
|
747 |
"f-score: 0.7389385181292696\n", |
|
|
748 |
" pre rec spe f1 geo iba sup\n", |
|
|
749 |
"\n", |
|
|
750 |
" 1 0.64 0.50 0.96 0.56 0.69 0.46 1085\n", |
|
|
751 |
" 2 0.77 0.95 0.41 0.85 0.63 0.41 6437\n", |
|
|
752 |
" 3 0.50 0.21 0.96 0.29 0.45 0.18 1657\n", |
|
|
753 |
" 4 0.14 0.01 1.00 0.02 0.09 0.01 336\n", |
|
|
754 |
"\n", |
|
|
755 |
"avg / total 0.69 0.74 0.59 0.69 0.58 0.36 9515\n", |
|
|
756 |
"\n", |
|
|
757 |
"[[ 538 391 148 8]\n", |
|
|
758 |
" [ 123 6145 164 5]\n", |
|
|
759 |
" [ 154 1152 345 6]\n", |
|
|
760 |
" [ 26 272 35 3]]\n" |
|
|
761 |
] |
|
|
762 |
}, |
|
|
763 |
{ |
|
|
764 |
"name": "stderr", |
|
|
765 |
"output_type": "stream", |
|
|
766 |
"text": [ |
|
|
767 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:42: SettingWithCopyWarning:\n", |
|
|
768 |
"\n", |
|
|
769 |
"\n", |
|
|
770 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
771 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
772 |
"\n", |
|
|
773 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
774 |
"\n", |
|
|
775 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
776 |
"\n", |
|
|
777 |
"\n", |
|
|
778 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
779 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
780 |
"\n", |
|
|
781 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
782 |
"\n", |
|
|
783 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:43: SettingWithCopyWarning:\n", |
|
|
784 |
"\n", |
|
|
785 |
"\n", |
|
|
786 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
787 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
788 |
"\n", |
|
|
789 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
790 |
"\n", |
|
|
791 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
792 |
"\n", |
|
|
793 |
"\n", |
|
|
794 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
795 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
796 |
"\n", |
|
|
797 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
798 |
"\n" |
|
|
799 |
] |
|
|
800 |
}, |
|
|
801 |
{ |
|
|
802 |
"name": "stdout", |
|
|
803 |
"output_type": "stream", |
|
|
804 |
"text": [ |
|
|
805 |
"For fold 6:\n", |
|
|
806 |
"Accuracy: 0.7128744088281661\n", |
|
|
807 |
"f-score: 0.7128744088281661\n", |
|
|
808 |
" pre rec spe f1 geo iba sup\n", |
|
|
809 |
"\n", |
|
|
810 |
" 1 0.56 0.50 0.96 0.53 0.70 0.46 785\n", |
|
|
811 |
" 2 0.74 0.96 0.36 0.84 0.59 0.37 6224\n", |
|
|
812 |
" 3 0.57 0.19 0.96 0.29 0.43 0.17 2026\n", |
|
|
813 |
" 4 0.26 0.02 1.00 0.03 0.13 0.01 480\n", |
|
|
814 |
"\n", |
|
|
815 |
"avg / total 0.66 0.71 0.57 0.65 0.54 0.32 9515\n", |
|
|
816 |
"\n", |
|
|
817 |
"[[ 395 284 100 6]\n", |
|
|
818 |
" [ 86 5994 137 7]\n", |
|
|
819 |
" [ 193 1437 386 10]\n", |
|
|
820 |
" [ 35 382 55 8]]\n" |
|
|
821 |
] |
|
|
822 |
}, |
|
|
823 |
{ |
|
|
824 |
"name": "stderr", |
|
|
825 |
"output_type": "stream", |
|
|
826 |
"text": [ |
|
|
827 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:42: SettingWithCopyWarning:\n", |
|
|
828 |
"\n", |
|
|
829 |
"\n", |
|
|
830 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
831 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
832 |
"\n", |
|
|
833 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
834 |
"\n", |
|
|
835 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
836 |
"\n", |
|
|
837 |
"\n", |
|
|
838 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
839 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
840 |
"\n", |
|
|
841 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
842 |
"\n", |
|
|
843 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:43: SettingWithCopyWarning:\n", |
|
|
844 |
"\n", |
|
|
845 |
"\n", |
|
|
846 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
847 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
848 |
"\n", |
|
|
849 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
850 |
"\n", |
|
|
851 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
852 |
"\n", |
|
|
853 |
"\n", |
|
|
854 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
855 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
856 |
"\n", |
|
|
857 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
858 |
"\n" |
|
|
859 |
] |
|
|
860 |
}, |
|
|
861 |
{ |
|
|
862 |
"name": "stdout", |
|
|
863 |
"output_type": "stream", |
|
|
864 |
"text": [ |
|
|
865 |
"For fold 7:\n", |
|
|
866 |
"Accuracy: 0.7487125591171834\n", |
|
|
867 |
"f-score: 0.7487125591171834\n", |
|
|
868 |
" pre rec spe f1 geo iba sup\n", |
|
|
869 |
"\n", |
|
|
870 |
" 1 0.63 0.45 0.97 0.53 0.67 0.42 853\n", |
|
|
871 |
" 2 0.79 0.95 0.42 0.86 0.63 0.42 6684\n", |
|
|
872 |
" 3 0.44 0.33 0.94 0.37 0.55 0.29 1209\n", |
|
|
873 |
" 4 0.64 0.01 1.00 0.02 0.10 0.01 769\n", |
|
|
874 |
"\n", |
|
|
875 |
"avg / total 0.72 0.75 0.58 0.70 0.58 0.37 9515\n", |
|
|
876 |
"\n", |
|
|
877 |
"[[ 388 305 159 1]\n", |
|
|
878 |
" [ 114 6336 231 3]\n", |
|
|
879 |
" [ 68 748 393 0]\n", |
|
|
880 |
" [ 45 600 117 7]]\n" |
|
|
881 |
] |
|
|
882 |
}, |
|
|
883 |
{ |
|
|
884 |
"name": "stderr", |
|
|
885 |
"output_type": "stream", |
|
|
886 |
"text": [ |
|
|
887 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:42: SettingWithCopyWarning:\n", |
|
|
888 |
"\n", |
|
|
889 |
"\n", |
|
|
890 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
891 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
892 |
"\n", |
|
|
893 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
894 |
"\n", |
|
|
895 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
896 |
"\n", |
|
|
897 |
"\n", |
|
|
898 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
899 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
900 |
"\n", |
|
|
901 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
902 |
"\n", |
|
|
903 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:43: SettingWithCopyWarning:\n", |
|
|
904 |
"\n", |
|
|
905 |
"\n", |
|
|
906 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
907 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
908 |
"\n", |
|
|
909 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
910 |
"\n", |
|
|
911 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
912 |
"\n", |
|
|
913 |
"\n", |
|
|
914 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
915 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
916 |
"\n", |
|
|
917 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
918 |
"\n" |
|
|
919 |
] |
|
|
920 |
}, |
|
|
921 |
{ |
|
|
922 |
"name": "stdout", |
|
|
923 |
"output_type": "stream", |
|
|
924 |
"text": [ |
|
|
925 |
"For fold 8:\n", |
|
|
926 |
"Accuracy: 0.7407251707829743\n", |
|
|
927 |
"f-score: 0.7407251707829743\n", |
|
|
928 |
" pre rec spe f1 geo iba sup\n", |
|
|
929 |
"\n", |
|
|
930 |
" 1 0.65 0.42 0.98 0.51 0.64 0.39 933\n", |
|
|
931 |
" 2 0.78 0.95 0.38 0.85 0.60 0.38 6645\n", |
|
|
932 |
" 3 0.46 0.22 0.94 0.30 0.46 0.19 1675\n", |
|
|
933 |
" 4 0.13 0.02 1.00 0.03 0.12 0.01 262\n", |
|
|
934 |
"\n", |
|
|
935 |
"avg / total 0.69 0.74 0.55 0.70 0.56 0.33 9515\n", |
|
|
936 |
"\n", |
|
|
937 |
"[[ 395 364 168 6]\n", |
|
|
938 |
" [ 107 6280 245 13]\n", |
|
|
939 |
" [ 91 1208 369 7]\n", |
|
|
940 |
" [ 12 219 27 4]]\n" |
|
|
941 |
] |
|
|
942 |
}, |
|
|
943 |
{ |
|
|
944 |
"name": "stderr", |
|
|
945 |
"output_type": "stream", |
|
|
946 |
"text": [ |
|
|
947 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:42: SettingWithCopyWarning:\n", |
|
|
948 |
"\n", |
|
|
949 |
"\n", |
|
|
950 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
951 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
952 |
"\n", |
|
|
953 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
954 |
"\n", |
|
|
955 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
956 |
"\n", |
|
|
957 |
"\n", |
|
|
958 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
959 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
960 |
"\n", |
|
|
961 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
962 |
"\n", |
|
|
963 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:43: SettingWithCopyWarning:\n", |
|
|
964 |
"\n", |
|
|
965 |
"\n", |
|
|
966 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
967 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
968 |
"\n", |
|
|
969 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
970 |
"\n", |
|
|
971 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
972 |
"\n", |
|
|
973 |
"\n", |
|
|
974 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
975 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
976 |
"\n", |
|
|
977 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
978 |
"\n" |
|
|
979 |
] |
|
|
980 |
}, |
|
|
981 |
{ |
|
|
982 |
"name": "stdout", |
|
|
983 |
"output_type": "stream", |
|
|
984 |
"text": [ |
|
|
985 |
"For fold 9:\n", |
|
|
986 |
"Accuracy: 0.7276644944292622\n", |
|
|
987 |
"f-score: 0.7276644944292622\n", |
|
|
988 |
" pre rec spe f1 geo iba sup\n", |
|
|
989 |
"\n", |
|
|
990 |
" 1 0.69 0.47 0.97 0.56 0.68 0.44 1031\n", |
|
|
991 |
" 2 0.76 0.96 0.36 0.85 0.59 0.37 6399\n", |
|
|
992 |
" 3 0.44 0.19 0.95 0.26 0.42 0.17 1495\n", |
|
|
993 |
" 4 0.18 0.01 1.00 0.01 0.08 0.01 589\n", |
|
|
994 |
"\n", |
|
|
995 |
"avg / total 0.66 0.73 0.56 0.67 0.54 0.32 9514\n", |
|
|
996 |
"\n", |
|
|
997 |
"[[ 489 388 150 4]\n", |
|
|
998 |
" [ 88 6150 156 5]\n", |
|
|
999 |
" [ 99 1107 280 9]\n", |
|
|
1000 |
" [ 31 497 57 4]]\n" |
|
|
1001 |
] |
|
|
1002 |
}, |
|
|
1003 |
{ |
|
|
1004 |
"name": "stderr", |
|
|
1005 |
"output_type": "stream", |
|
|
1006 |
"text": [ |
|
|
1007 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:42: SettingWithCopyWarning:\n", |
|
|
1008 |
"\n", |
|
|
1009 |
"\n", |
|
|
1010 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1011 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1012 |
"\n", |
|
|
1013 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1014 |
"\n", |
|
|
1015 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1016 |
"\n", |
|
|
1017 |
"\n", |
|
|
1018 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1019 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1020 |
"\n", |
|
|
1021 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1022 |
"\n", |
|
|
1023 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:43: SettingWithCopyWarning:\n", |
|
|
1024 |
"\n", |
|
|
1025 |
"\n", |
|
|
1026 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1027 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1028 |
"\n", |
|
|
1029 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1030 |
"\n", |
|
|
1031 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1032 |
"\n", |
|
|
1033 |
"\n", |
|
|
1034 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1035 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1036 |
"\n", |
|
|
1037 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1038 |
"\n" |
|
|
1039 |
] |
|
|
1040 |
}, |
|
|
1041 |
{ |
|
|
1042 |
"name": "stdout", |
|
|
1043 |
"output_type": "stream", |
|
|
1044 |
"text": [ |
|
|
1045 |
"For fold 10:\n", |
|
|
1046 |
"Accuracy: 0.7419592179945343\n", |
|
|
1047 |
"f-score: 0.7419592179945343\n", |
|
|
1048 |
" pre rec spe f1 geo iba sup\n", |
|
|
1049 |
"\n", |
|
|
1050 |
" 1 0.66 0.53 0.96 0.59 0.71 0.49 1157\n", |
|
|
1051 |
" 2 0.78 0.95 0.41 0.86 0.62 0.40 6600\n", |
|
|
1052 |
" 3 0.34 0.17 0.95 0.23 0.40 0.15 1156\n", |
|
|
1053 |
" 4 0.14 0.01 1.00 0.01 0.08 0.01 601\n", |
|
|
1054 |
"\n", |
|
|
1055 |
"avg / total 0.67 0.74 0.58 0.69 0.57 0.36 9514\n", |
|
|
1056 |
"\n", |
|
|
1057 |
"[[ 614 393 143 7]\n", |
|
|
1058 |
" [ 144 6245 198 13]\n", |
|
|
1059 |
" [ 125 831 196 4]\n", |
|
|
1060 |
" [ 45 509 43 4]]\n" |
|
|
1061 |
] |
|
|
1062 |
}, |
|
|
1063 |
{ |
|
|
1064 |
"name": "stderr", |
|
|
1065 |
"output_type": "stream", |
|
|
1066 |
"text": [ |
|
|
1067 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:42: SettingWithCopyWarning:\n", |
|
|
1068 |
"\n", |
|
|
1069 |
"\n", |
|
|
1070 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1071 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1072 |
"\n", |
|
|
1073 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1074 |
"\n", |
|
|
1075 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1076 |
"\n", |
|
|
1077 |
"\n", |
|
|
1078 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1079 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1080 |
"\n", |
|
|
1081 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1082 |
"\n", |
|
|
1083 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:43: SettingWithCopyWarning:\n", |
|
|
1084 |
"\n", |
|
|
1085 |
"\n", |
|
|
1086 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1087 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1088 |
"\n", |
|
|
1089 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1090 |
"\n", |
|
|
1091 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1092 |
"\n", |
|
|
1093 |
"\n", |
|
|
1094 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1095 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1096 |
"\n", |
|
|
1097 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1098 |
"\n" |
|
|
1099 |
] |
|
|
1100 |
}, |
|
|
1101 |
{ |
|
|
1102 |
"name": "stdout", |
|
|
1103 |
"output_type": "stream", |
|
|
1104 |
"text": [ |
|
|
1105 |
"For fold 1:\n", |
|
|
1106 |
"Accuracy: 0.7585916973200211\n", |
|
|
1107 |
"f-score: 0.7585916973200211\n", |
|
|
1108 |
" pre rec spe f1 geo iba sup\n", |
|
|
1109 |
"\n", |
|
|
1110 |
" 1 0.54 0.48 0.97 0.51 0.68 0.45 642\n", |
|
|
1111 |
" 2 0.79 0.96 0.37 0.87 0.59 0.37 6776\n", |
|
|
1112 |
" 3 0.58 0.24 0.96 0.34 0.48 0.21 1716\n", |
|
|
1113 |
" 4 0.31 0.01 1.00 0.02 0.10 0.01 381\n", |
|
|
1114 |
"\n", |
|
|
1115 |
"avg / total 0.72 0.76 0.54 0.71 0.56 0.33 9515\n", |
|
|
1116 |
"\n", |
|
|
1117 |
"[[ 310 239 89 4]\n", |
|
|
1118 |
" [ 102 6493 176 5]\n", |
|
|
1119 |
" [ 137 1168 411 0]\n", |
|
|
1120 |
" [ 21 325 31 4]]\n" |
|
|
1121 |
] |
|
|
1122 |
}, |
|
|
1123 |
{ |
|
|
1124 |
"name": "stderr", |
|
|
1125 |
"output_type": "stream", |
|
|
1126 |
"text": [ |
|
|
1127 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:42: SettingWithCopyWarning:\n", |
|
|
1128 |
"\n", |
|
|
1129 |
"\n", |
|
|
1130 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1131 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1132 |
"\n", |
|
|
1133 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1134 |
"\n", |
|
|
1135 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1136 |
"\n", |
|
|
1137 |
"\n", |
|
|
1138 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1139 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1140 |
"\n", |
|
|
1141 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1142 |
"\n", |
|
|
1143 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:43: SettingWithCopyWarning:\n", |
|
|
1144 |
"\n", |
|
|
1145 |
"\n", |
|
|
1146 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1147 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1148 |
"\n", |
|
|
1149 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1150 |
"\n", |
|
|
1151 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1152 |
"\n", |
|
|
1153 |
"\n", |
|
|
1154 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1155 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1156 |
"\n", |
|
|
1157 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1158 |
"\n" |
|
|
1159 |
] |
|
|
1160 |
}, |
|
|
1161 |
{ |
|
|
1162 |
"name": "stdout", |
|
|
1163 |
"output_type": "stream", |
|
|
1164 |
"text": [ |
|
|
1165 |
"For fold 2:\n", |
|
|
1166 |
"Accuracy: 0.7777193904361535\n", |
|
|
1167 |
"f-score: 0.7777193904361535\n", |
|
|
1168 |
" pre rec spe f1 geo iba sup\n", |
|
|
1169 |
"\n", |
|
|
1170 |
" 1 0.60 0.49 0.96 0.54 0.69 0.45 974\n", |
|
|
1171 |
" 2 0.87 0.90 0.48 0.88 0.66 0.45 7520\n", |
|
|
1172 |
" 3 0.20 0.27 0.92 0.23 0.49 0.23 697\n", |
|
|
1173 |
" 4 0.09 0.01 1.00 0.01 0.08 0.01 324\n", |
|
|
1174 |
"\n", |
|
|
1175 |
"avg / total 0.76 0.78 0.58 0.77 0.63 0.42 9515\n", |
|
|
1176 |
"\n", |
|
|
1177 |
"[[ 477 347 149 1]\n", |
|
|
1178 |
" [ 199 6735 567 19]\n", |
|
|
1179 |
" [ 99 412 186 0]\n", |
|
|
1180 |
" [ 17 272 33 2]]\n" |
|
|
1181 |
] |
|
|
1182 |
}, |
|
|
1183 |
{ |
|
|
1184 |
"name": "stderr", |
|
|
1185 |
"output_type": "stream", |
|
|
1186 |
"text": [ |
|
|
1187 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:42: SettingWithCopyWarning:\n", |
|
|
1188 |
"\n", |
|
|
1189 |
"\n", |
|
|
1190 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1191 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1192 |
"\n", |
|
|
1193 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1194 |
"\n", |
|
|
1195 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1196 |
"\n", |
|
|
1197 |
"\n", |
|
|
1198 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1199 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1200 |
"\n", |
|
|
1201 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1202 |
"\n", |
|
|
1203 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:43: SettingWithCopyWarning:\n", |
|
|
1204 |
"\n", |
|
|
1205 |
"\n", |
|
|
1206 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1207 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1208 |
"\n", |
|
|
1209 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1210 |
"\n", |
|
|
1211 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1212 |
"\n", |
|
|
1213 |
"\n", |
|
|
1214 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1215 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1216 |
"\n", |
|
|
1217 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1218 |
"\n" |
|
|
1219 |
] |
|
|
1220 |
}, |
|
|
1221 |
{ |
|
|
1222 |
"name": "stdout", |
|
|
1223 |
"output_type": "stream", |
|
|
1224 |
"text": [ |
|
|
1225 |
"For fold 3:\n", |
|
|
1226 |
"Accuracy: 0.7480819758276406\n", |
|
|
1227 |
"f-score: 0.7480819758276406\n", |
|
|
1228 |
" pre rec spe f1 geo iba sup\n", |
|
|
1229 |
"\n", |
|
|
1230 |
" 1 0.67 0.56 0.96 0.61 0.73 0.52 1247\n", |
|
|
1231 |
" 2 0.80 0.92 0.49 0.86 0.67 0.47 6585\n", |
|
|
1232 |
" 3 0.40 0.24 0.93 0.30 0.47 0.21 1462\n", |
|
|
1233 |
" 4 0.08 0.00 1.00 0.01 0.07 0.00 221\n", |
|
|
1234 |
"\n", |
|
|
1235 |
"avg / total 0.70 0.75 0.63 0.72 0.63 0.42 9515\n", |
|
|
1236 |
"\n", |
|
|
1237 |
"[[ 701 380 162 4]\n", |
|
|
1238 |
" [ 194 6066 317 8]\n", |
|
|
1239 |
" [ 143 969 350 0]\n", |
|
|
1240 |
" [ 16 158 46 1]]\n" |
|
|
1241 |
] |
|
|
1242 |
}, |
|
|
1243 |
{ |
|
|
1244 |
"name": "stderr", |
|
|
1245 |
"output_type": "stream", |
|
|
1246 |
"text": [ |
|
|
1247 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:42: SettingWithCopyWarning:\n", |
|
|
1248 |
"\n", |
|
|
1249 |
"\n", |
|
|
1250 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1251 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1252 |
"\n", |
|
|
1253 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1254 |
"\n", |
|
|
1255 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1256 |
"\n", |
|
|
1257 |
"\n", |
|
|
1258 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1259 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1260 |
"\n", |
|
|
1261 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1262 |
"\n", |
|
|
1263 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:43: SettingWithCopyWarning:\n", |
|
|
1264 |
"\n", |
|
|
1265 |
"\n", |
|
|
1266 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1267 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1268 |
"\n", |
|
|
1269 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1270 |
"\n", |
|
|
1271 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1272 |
"\n", |
|
|
1273 |
"\n", |
|
|
1274 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1275 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1276 |
"\n", |
|
|
1277 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1278 |
"\n" |
|
|
1279 |
] |
|
|
1280 |
}, |
|
|
1281 |
{ |
|
|
1282 |
"name": "stdout", |
|
|
1283 |
"output_type": "stream", |
|
|
1284 |
"text": [ |
|
|
1285 |
"For fold 4:\n", |
|
|
1286 |
"Accuracy: 0.7147661586967945\n", |
|
|
1287 |
"f-score: 0.7147661586967945\n", |
|
|
1288 |
" pre rec spe f1 geo iba sup\n", |
|
|
1289 |
"\n", |
|
|
1290 |
" 1 0.67 0.51 0.97 0.58 0.70 0.47 1129\n", |
|
|
1291 |
" 2 0.74 0.95 0.35 0.83 0.57 0.35 6348\n", |
|
|
1292 |
" 3 0.35 0.15 0.96 0.21 0.38 0.14 1285\n", |
|
|
1293 |
" 4 0.36 0.01 1.00 0.01 0.07 0.00 753\n", |
|
|
1294 |
"\n", |
|
|
1295 |
"avg / total 0.65 0.71 0.56 0.66 0.52 0.31 9515\n", |
|
|
1296 |
"\n", |
|
|
1297 |
"[[ 573 433 122 1]\n", |
|
|
1298 |
" [ 118 6026 202 2]\n", |
|
|
1299 |
" [ 124 959 198 4]\n", |
|
|
1300 |
" [ 38 672 39 4]]\n" |
|
|
1301 |
] |
|
|
1302 |
}, |
|
|
1303 |
{ |
|
|
1304 |
"name": "stderr", |
|
|
1305 |
"output_type": "stream", |
|
|
1306 |
"text": [ |
|
|
1307 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:42: SettingWithCopyWarning:\n", |
|
|
1308 |
"\n", |
|
|
1309 |
"\n", |
|
|
1310 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1311 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1312 |
"\n", |
|
|
1313 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1314 |
"\n", |
|
|
1315 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1316 |
"\n", |
|
|
1317 |
"\n", |
|
|
1318 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1319 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1320 |
"\n", |
|
|
1321 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1322 |
"\n", |
|
|
1323 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:43: SettingWithCopyWarning:\n", |
|
|
1324 |
"\n", |
|
|
1325 |
"\n", |
|
|
1326 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1327 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1328 |
"\n", |
|
|
1329 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1330 |
"\n", |
|
|
1331 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1332 |
"\n", |
|
|
1333 |
"\n", |
|
|
1334 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1335 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1336 |
"\n", |
|
|
1337 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1338 |
"\n" |
|
|
1339 |
] |
|
|
1340 |
}, |
|
|
1341 |
{ |
|
|
1342 |
"name": "stdout", |
|
|
1343 |
"output_type": "stream", |
|
|
1344 |
"text": [ |
|
|
1345 |
"For fold 5:\n", |
|
|
1346 |
"Accuracy: 0.7389385181292696\n", |
|
|
1347 |
"f-score: 0.7389385181292696\n", |
|
|
1348 |
" pre rec spe f1 geo iba sup\n", |
|
|
1349 |
"\n", |
|
|
1350 |
" 1 0.64 0.50 0.96 0.56 0.69 0.46 1085\n", |
|
|
1351 |
" 2 0.77 0.95 0.41 0.85 0.63 0.41 6437\n", |
|
|
1352 |
" 3 0.50 0.21 0.96 0.29 0.45 0.18 1657\n", |
|
|
1353 |
" 4 0.14 0.01 1.00 0.02 0.09 0.01 336\n", |
|
|
1354 |
"\n", |
|
|
1355 |
"avg / total 0.69 0.74 0.59 0.69 0.58 0.36 9515\n", |
|
|
1356 |
"\n", |
|
|
1357 |
"[[ 538 391 148 8]\n", |
|
|
1358 |
" [ 123 6145 164 5]\n", |
|
|
1359 |
" [ 154 1152 345 6]\n", |
|
|
1360 |
" [ 26 272 35 3]]\n" |
|
|
1361 |
] |
|
|
1362 |
}, |
|
|
1363 |
{ |
|
|
1364 |
"name": "stderr", |
|
|
1365 |
"output_type": "stream", |
|
|
1366 |
"text": [ |
|
|
1367 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:42: SettingWithCopyWarning:\n", |
|
|
1368 |
"\n", |
|
|
1369 |
"\n", |
|
|
1370 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1371 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1372 |
"\n", |
|
|
1373 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1374 |
"\n", |
|
|
1375 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1376 |
"\n", |
|
|
1377 |
"\n", |
|
|
1378 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1379 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1380 |
"\n", |
|
|
1381 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1382 |
"\n", |
|
|
1383 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:43: SettingWithCopyWarning:\n", |
|
|
1384 |
"\n", |
|
|
1385 |
"\n", |
|
|
1386 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1387 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1388 |
"\n", |
|
|
1389 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1390 |
"\n", |
|
|
1391 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1392 |
"\n", |
|
|
1393 |
"\n", |
|
|
1394 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1395 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1396 |
"\n", |
|
|
1397 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1398 |
"\n" |
|
|
1399 |
] |
|
|
1400 |
}, |
|
|
1401 |
{ |
|
|
1402 |
"name": "stdout", |
|
|
1403 |
"output_type": "stream", |
|
|
1404 |
"text": [ |
|
|
1405 |
"For fold 6:\n", |
|
|
1406 |
"Accuracy: 0.7128744088281661\n", |
|
|
1407 |
"f-score: 0.7128744088281661\n", |
|
|
1408 |
" pre rec spe f1 geo iba sup\n", |
|
|
1409 |
"\n", |
|
|
1410 |
" 1 0.56 0.50 0.96 0.53 0.70 0.46 785\n", |
|
|
1411 |
" 2 0.74 0.96 0.36 0.84 0.59 0.37 6224\n", |
|
|
1412 |
" 3 0.57 0.19 0.96 0.29 0.43 0.17 2026\n", |
|
|
1413 |
" 4 0.26 0.02 1.00 0.03 0.13 0.01 480\n", |
|
|
1414 |
"\n", |
|
|
1415 |
"avg / total 0.66 0.71 0.57 0.65 0.54 0.32 9515\n", |
|
|
1416 |
"\n", |
|
|
1417 |
"[[ 395 284 100 6]\n", |
|
|
1418 |
" [ 86 5994 137 7]\n", |
|
|
1419 |
" [ 193 1437 386 10]\n", |
|
|
1420 |
" [ 35 382 55 8]]\n" |
|
|
1421 |
] |
|
|
1422 |
}, |
|
|
1423 |
{ |
|
|
1424 |
"name": "stderr", |
|
|
1425 |
"output_type": "stream", |
|
|
1426 |
"text": [ |
|
|
1427 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:42: SettingWithCopyWarning:\n", |
|
|
1428 |
"\n", |
|
|
1429 |
"\n", |
|
|
1430 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1431 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1432 |
"\n", |
|
|
1433 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1434 |
"\n", |
|
|
1435 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1436 |
"\n", |
|
|
1437 |
"\n", |
|
|
1438 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1439 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1440 |
"\n", |
|
|
1441 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1442 |
"\n", |
|
|
1443 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:43: SettingWithCopyWarning:\n", |
|
|
1444 |
"\n", |
|
|
1445 |
"\n", |
|
|
1446 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1447 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1448 |
"\n", |
|
|
1449 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1450 |
"\n", |
|
|
1451 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1452 |
"\n", |
|
|
1453 |
"\n", |
|
|
1454 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1455 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1456 |
"\n", |
|
|
1457 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1458 |
"\n" |
|
|
1459 |
] |
|
|
1460 |
}, |
|
|
1461 |
{ |
|
|
1462 |
"name": "stdout", |
|
|
1463 |
"output_type": "stream", |
|
|
1464 |
"text": [ |
|
|
1465 |
"For fold 7:\n", |
|
|
1466 |
"Accuracy: 0.7487125591171834\n", |
|
|
1467 |
"f-score: 0.7487125591171834\n", |
|
|
1468 |
" pre rec spe f1 geo iba sup\n", |
|
|
1469 |
"\n", |
|
|
1470 |
" 1 0.63 0.45 0.97 0.53 0.67 0.42 853\n", |
|
|
1471 |
" 2 0.79 0.95 0.42 0.86 0.63 0.42 6684\n", |
|
|
1472 |
" 3 0.44 0.33 0.94 0.37 0.55 0.29 1209\n", |
|
|
1473 |
" 4 0.64 0.01 1.00 0.02 0.10 0.01 769\n", |
|
|
1474 |
"\n", |
|
|
1475 |
"avg / total 0.72 0.75 0.58 0.70 0.58 0.37 9515\n", |
|
|
1476 |
"\n", |
|
|
1477 |
"[[ 388 305 159 1]\n", |
|
|
1478 |
" [ 114 6336 231 3]\n", |
|
|
1479 |
" [ 68 748 393 0]\n", |
|
|
1480 |
" [ 45 600 117 7]]\n" |
|
|
1481 |
] |
|
|
1482 |
}, |
|
|
1483 |
{ |
|
|
1484 |
"name": "stderr", |
|
|
1485 |
"output_type": "stream", |
|
|
1486 |
"text": [ |
|
|
1487 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:42: SettingWithCopyWarning:\n", |
|
|
1488 |
"\n", |
|
|
1489 |
"\n", |
|
|
1490 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1491 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1492 |
"\n", |
|
|
1493 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1494 |
"\n", |
|
|
1495 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1496 |
"\n", |
|
|
1497 |
"\n", |
|
|
1498 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1499 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1500 |
"\n", |
|
|
1501 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1502 |
"\n", |
|
|
1503 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:43: SettingWithCopyWarning:\n", |
|
|
1504 |
"\n", |
|
|
1505 |
"\n", |
|
|
1506 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1507 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1508 |
"\n", |
|
|
1509 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1510 |
"\n", |
|
|
1511 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1512 |
"\n", |
|
|
1513 |
"\n", |
|
|
1514 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1515 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1516 |
"\n", |
|
|
1517 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1518 |
"\n" |
|
|
1519 |
] |
|
|
1520 |
}, |
|
|
1521 |
{ |
|
|
1522 |
"name": "stdout", |
|
|
1523 |
"output_type": "stream", |
|
|
1524 |
"text": [ |
|
|
1525 |
"For fold 8:\n", |
|
|
1526 |
"Accuracy: 0.7407251707829743\n", |
|
|
1527 |
"f-score: 0.7407251707829743\n", |
|
|
1528 |
" pre rec spe f1 geo iba sup\n", |
|
|
1529 |
"\n", |
|
|
1530 |
" 1 0.65 0.42 0.98 0.51 0.64 0.39 933\n", |
|
|
1531 |
" 2 0.78 0.95 0.38 0.85 0.60 0.38 6645\n", |
|
|
1532 |
" 3 0.46 0.22 0.94 0.30 0.46 0.19 1675\n", |
|
|
1533 |
" 4 0.13 0.02 1.00 0.03 0.12 0.01 262\n", |
|
|
1534 |
"\n", |
|
|
1535 |
"avg / total 0.69 0.74 0.55 0.70 0.56 0.33 9515\n", |
|
|
1536 |
"\n", |
|
|
1537 |
"[[ 395 364 168 6]\n", |
|
|
1538 |
" [ 107 6280 245 13]\n", |
|
|
1539 |
" [ 91 1208 369 7]\n", |
|
|
1540 |
" [ 12 219 27 4]]\n" |
|
|
1541 |
] |
|
|
1542 |
}, |
|
|
1543 |
{ |
|
|
1544 |
"name": "stderr", |
|
|
1545 |
"output_type": "stream", |
|
|
1546 |
"text": [ |
|
|
1547 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:42: SettingWithCopyWarning:\n", |
|
|
1548 |
"\n", |
|
|
1549 |
"\n", |
|
|
1550 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1551 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1552 |
"\n", |
|
|
1553 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1554 |
"\n", |
|
|
1555 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1556 |
"\n", |
|
|
1557 |
"\n", |
|
|
1558 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1559 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1560 |
"\n", |
|
|
1561 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1562 |
"\n", |
|
|
1563 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:43: SettingWithCopyWarning:\n", |
|
|
1564 |
"\n", |
|
|
1565 |
"\n", |
|
|
1566 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1567 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1568 |
"\n", |
|
|
1569 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1570 |
"\n", |
|
|
1571 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1572 |
"\n", |
|
|
1573 |
"\n", |
|
|
1574 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1575 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1576 |
"\n", |
|
|
1577 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1578 |
"\n" |
|
|
1579 |
] |
|
|
1580 |
}, |
|
|
1581 |
{ |
|
|
1582 |
"name": "stdout", |
|
|
1583 |
"output_type": "stream", |
|
|
1584 |
"text": [ |
|
|
1585 |
"For fold 9:\n", |
|
|
1586 |
"Accuracy: 0.7276644944292622\n", |
|
|
1587 |
"f-score: 0.7276644944292622\n", |
|
|
1588 |
" pre rec spe f1 geo iba sup\n", |
|
|
1589 |
"\n", |
|
|
1590 |
" 1 0.69 0.47 0.97 0.56 0.68 0.44 1031\n", |
|
|
1591 |
" 2 0.76 0.96 0.36 0.85 0.59 0.37 6399\n", |
|
|
1592 |
" 3 0.44 0.19 0.95 0.26 0.42 0.17 1495\n", |
|
|
1593 |
" 4 0.18 0.01 1.00 0.01 0.08 0.01 589\n", |
|
|
1594 |
"\n", |
|
|
1595 |
"avg / total 0.66 0.73 0.56 0.67 0.54 0.32 9514\n", |
|
|
1596 |
"\n", |
|
|
1597 |
"[[ 489 388 150 4]\n", |
|
|
1598 |
" [ 88 6150 156 5]\n", |
|
|
1599 |
" [ 99 1107 280 9]\n", |
|
|
1600 |
" [ 31 497 57 4]]\n" |
|
|
1601 |
] |
|
|
1602 |
}, |
|
|
1603 |
{ |
|
|
1604 |
"name": "stderr", |
|
|
1605 |
"output_type": "stream", |
|
|
1606 |
"text": [ |
|
|
1607 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:42: SettingWithCopyWarning:\n", |
|
|
1608 |
"\n", |
|
|
1609 |
"\n", |
|
|
1610 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1611 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1612 |
"\n", |
|
|
1613 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1614 |
"\n", |
|
|
1615 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1616 |
"\n", |
|
|
1617 |
"\n", |
|
|
1618 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1619 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1620 |
"\n", |
|
|
1621 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1622 |
"\n", |
|
|
1623 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:43: SettingWithCopyWarning:\n", |
|
|
1624 |
"\n", |
|
|
1625 |
"\n", |
|
|
1626 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1627 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1628 |
"\n", |
|
|
1629 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1630 |
"\n", |
|
|
1631 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1632 |
"\n", |
|
|
1633 |
"\n", |
|
|
1634 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1635 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1636 |
"\n", |
|
|
1637 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1638 |
"\n" |
|
|
1639 |
] |
|
|
1640 |
}, |
|
|
1641 |
{ |
|
|
1642 |
"name": "stdout", |
|
|
1643 |
"output_type": "stream", |
|
|
1644 |
"text": [ |
|
|
1645 |
"For fold 10:\n", |
|
|
1646 |
"Accuracy: 0.7419592179945343\n", |
|
|
1647 |
"f-score: 0.7419592179945343\n", |
|
|
1648 |
" pre rec spe f1 geo iba sup\n", |
|
|
1649 |
"\n", |
|
|
1650 |
" 1 0.66 0.53 0.96 0.59 0.71 0.49 1157\n", |
|
|
1651 |
" 2 0.78 0.95 0.41 0.86 0.62 0.40 6600\n", |
|
|
1652 |
" 3 0.34 0.17 0.95 0.23 0.40 0.15 1156\n", |
|
|
1653 |
" 4 0.14 0.01 1.00 0.01 0.08 0.01 601\n", |
|
|
1654 |
"\n", |
|
|
1655 |
"avg / total 0.67 0.74 0.58 0.69 0.57 0.36 9514\n", |
|
|
1656 |
"\n", |
|
|
1657 |
"[[ 614 393 143 7]\n", |
|
|
1658 |
" [ 144 6245 198 13]\n", |
|
|
1659 |
" [ 125 831 196 4]\n", |
|
|
1660 |
" [ 45 509 43 4]]\n" |
|
|
1661 |
] |
|
|
1662 |
}, |
|
|
1663 |
{ |
|
|
1664 |
"name": "stderr", |
|
|
1665 |
"output_type": "stream", |
|
|
1666 |
"text": [ |
|
|
1667 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:42: SettingWithCopyWarning:\n", |
|
|
1668 |
"\n", |
|
|
1669 |
"\n", |
|
|
1670 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1671 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1672 |
"\n", |
|
|
1673 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1674 |
"\n", |
|
|
1675 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1676 |
"\n", |
|
|
1677 |
"\n", |
|
|
1678 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1679 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1680 |
"\n", |
|
|
1681 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1682 |
"\n", |
|
|
1683 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:43: SettingWithCopyWarning:\n", |
|
|
1684 |
"\n", |
|
|
1685 |
"\n", |
|
|
1686 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1687 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1688 |
"\n", |
|
|
1689 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1690 |
"\n", |
|
|
1691 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1692 |
"\n", |
|
|
1693 |
"\n", |
|
|
1694 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1695 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1696 |
"\n", |
|
|
1697 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1698 |
"\n" |
|
|
1699 |
] |
|
|
1700 |
}, |
|
|
1701 |
{ |
|
|
1702 |
"name": "stdout", |
|
|
1703 |
"output_type": "stream", |
|
|
1704 |
"text": [ |
|
|
1705 |
"For fold 1:\n", |
|
|
1706 |
"Accuracy: 0.7585916973200211\n", |
|
|
1707 |
"f-score: 0.7585916973200211\n", |
|
|
1708 |
" pre rec spe f1 geo iba sup\n", |
|
|
1709 |
"\n", |
|
|
1710 |
" 1 0.54 0.48 0.97 0.51 0.68 0.45 642\n", |
|
|
1711 |
" 2 0.79 0.96 0.37 0.87 0.59 0.37 6776\n", |
|
|
1712 |
" 3 0.58 0.24 0.96 0.34 0.48 0.21 1716\n", |
|
|
1713 |
" 4 0.31 0.01 1.00 0.02 0.10 0.01 381\n", |
|
|
1714 |
"\n", |
|
|
1715 |
"avg / total 0.72 0.76 0.54 0.71 0.56 0.33 9515\n", |
|
|
1716 |
"\n", |
|
|
1717 |
"[[ 310 239 89 4]\n", |
|
|
1718 |
" [ 102 6493 176 5]\n", |
|
|
1719 |
" [ 137 1168 411 0]\n", |
|
|
1720 |
" [ 21 325 31 4]]\n" |
|
|
1721 |
] |
|
|
1722 |
}, |
|
|
1723 |
{ |
|
|
1724 |
"name": "stderr", |
|
|
1725 |
"output_type": "stream", |
|
|
1726 |
"text": [ |
|
|
1727 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:42: SettingWithCopyWarning:\n", |
|
|
1728 |
"\n", |
|
|
1729 |
"\n", |
|
|
1730 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1731 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1732 |
"\n", |
|
|
1733 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1734 |
"\n", |
|
|
1735 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1736 |
"\n", |
|
|
1737 |
"\n", |
|
|
1738 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1739 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1740 |
"\n", |
|
|
1741 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1742 |
"\n", |
|
|
1743 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:43: SettingWithCopyWarning:\n", |
|
|
1744 |
"\n", |
|
|
1745 |
"\n", |
|
|
1746 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1747 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1748 |
"\n", |
|
|
1749 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1750 |
"\n", |
|
|
1751 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1752 |
"\n", |
|
|
1753 |
"\n", |
|
|
1754 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1755 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1756 |
"\n", |
|
|
1757 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1758 |
"\n" |
|
|
1759 |
] |
|
|
1760 |
}, |
|
|
1761 |
{ |
|
|
1762 |
"name": "stdout", |
|
|
1763 |
"output_type": "stream", |
|
|
1764 |
"text": [ |
|
|
1765 |
"For fold 2:\n", |
|
|
1766 |
"Accuracy: 0.7777193904361535\n", |
|
|
1767 |
"f-score: 0.7777193904361535\n", |
|
|
1768 |
" pre rec spe f1 geo iba sup\n", |
|
|
1769 |
"\n", |
|
|
1770 |
" 1 0.60 0.49 0.96 0.54 0.69 0.45 974\n", |
|
|
1771 |
" 2 0.87 0.90 0.48 0.88 0.66 0.45 7520\n", |
|
|
1772 |
" 3 0.20 0.27 0.92 0.23 0.49 0.23 697\n", |
|
|
1773 |
" 4 0.09 0.01 1.00 0.01 0.08 0.01 324\n", |
|
|
1774 |
"\n", |
|
|
1775 |
"avg / total 0.76 0.78 0.58 0.77 0.63 0.42 9515\n", |
|
|
1776 |
"\n", |
|
|
1777 |
"[[ 477 347 149 1]\n", |
|
|
1778 |
" [ 199 6735 567 19]\n", |
|
|
1779 |
" [ 99 412 186 0]\n", |
|
|
1780 |
" [ 17 272 33 2]]\n" |
|
|
1781 |
] |
|
|
1782 |
}, |
|
|
1783 |
{ |
|
|
1784 |
"name": "stderr", |
|
|
1785 |
"output_type": "stream", |
|
|
1786 |
"text": [ |
|
|
1787 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:42: SettingWithCopyWarning:\n", |
|
|
1788 |
"\n", |
|
|
1789 |
"\n", |
|
|
1790 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1791 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1792 |
"\n", |
|
|
1793 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1794 |
"\n", |
|
|
1795 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1796 |
"\n", |
|
|
1797 |
"\n", |
|
|
1798 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1799 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1800 |
"\n", |
|
|
1801 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1802 |
"\n", |
|
|
1803 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:43: SettingWithCopyWarning:\n", |
|
|
1804 |
"\n", |
|
|
1805 |
"\n", |
|
|
1806 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1807 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1808 |
"\n", |
|
|
1809 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1810 |
"\n", |
|
|
1811 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1812 |
"\n", |
|
|
1813 |
"\n", |
|
|
1814 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1815 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1816 |
"\n", |
|
|
1817 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1818 |
"\n" |
|
|
1819 |
] |
|
|
1820 |
}, |
|
|
1821 |
{ |
|
|
1822 |
"name": "stdout", |
|
|
1823 |
"output_type": "stream", |
|
|
1824 |
"text": [ |
|
|
1825 |
"For fold 3:\n", |
|
|
1826 |
"Accuracy: 0.7480819758276406\n", |
|
|
1827 |
"f-score: 0.7480819758276406\n", |
|
|
1828 |
" pre rec spe f1 geo iba sup\n", |
|
|
1829 |
"\n", |
|
|
1830 |
" 1 0.67 0.56 0.96 0.61 0.73 0.52 1247\n", |
|
|
1831 |
" 2 0.80 0.92 0.49 0.86 0.67 0.47 6585\n", |
|
|
1832 |
" 3 0.40 0.24 0.93 0.30 0.47 0.21 1462\n", |
|
|
1833 |
" 4 0.08 0.00 1.00 0.01 0.07 0.00 221\n", |
|
|
1834 |
"\n", |
|
|
1835 |
"avg / total 0.70 0.75 0.63 0.72 0.63 0.42 9515\n", |
|
|
1836 |
"\n", |
|
|
1837 |
"[[ 701 380 162 4]\n", |
|
|
1838 |
" [ 194 6066 317 8]\n", |
|
|
1839 |
" [ 143 969 350 0]\n", |
|
|
1840 |
" [ 16 158 46 1]]\n" |
|
|
1841 |
] |
|
|
1842 |
}, |
|
|
1843 |
{ |
|
|
1844 |
"name": "stderr", |
|
|
1845 |
"output_type": "stream", |
|
|
1846 |
"text": [ |
|
|
1847 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:42: SettingWithCopyWarning:\n", |
|
|
1848 |
"\n", |
|
|
1849 |
"\n", |
|
|
1850 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1851 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1852 |
"\n", |
|
|
1853 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1854 |
"\n", |
|
|
1855 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1856 |
"\n", |
|
|
1857 |
"\n", |
|
|
1858 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1859 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1860 |
"\n", |
|
|
1861 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1862 |
"\n", |
|
|
1863 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:43: SettingWithCopyWarning:\n", |
|
|
1864 |
"\n", |
|
|
1865 |
"\n", |
|
|
1866 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1867 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1868 |
"\n", |
|
|
1869 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1870 |
"\n", |
|
|
1871 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1872 |
"\n", |
|
|
1873 |
"\n", |
|
|
1874 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1875 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1876 |
"\n", |
|
|
1877 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1878 |
"\n" |
|
|
1879 |
] |
|
|
1880 |
}, |
|
|
1881 |
{ |
|
|
1882 |
"name": "stdout", |
|
|
1883 |
"output_type": "stream", |
|
|
1884 |
"text": [ |
|
|
1885 |
"For fold 4:\n", |
|
|
1886 |
"Accuracy: 0.7147661586967945\n", |
|
|
1887 |
"f-score: 0.7147661586967945\n", |
|
|
1888 |
" pre rec spe f1 geo iba sup\n", |
|
|
1889 |
"\n", |
|
|
1890 |
" 1 0.67 0.51 0.97 0.58 0.70 0.47 1129\n", |
|
|
1891 |
" 2 0.74 0.95 0.35 0.83 0.57 0.35 6348\n", |
|
|
1892 |
" 3 0.35 0.15 0.96 0.21 0.38 0.14 1285\n", |
|
|
1893 |
" 4 0.36 0.01 1.00 0.01 0.07 0.00 753\n", |
|
|
1894 |
"\n", |
|
|
1895 |
"avg / total 0.65 0.71 0.56 0.66 0.52 0.31 9515\n", |
|
|
1896 |
"\n", |
|
|
1897 |
"[[ 573 433 122 1]\n", |
|
|
1898 |
" [ 118 6026 202 2]\n", |
|
|
1899 |
" [ 124 959 198 4]\n", |
|
|
1900 |
" [ 38 672 39 4]]\n" |
|
|
1901 |
] |
|
|
1902 |
}, |
|
|
1903 |
{ |
|
|
1904 |
"name": "stderr", |
|
|
1905 |
"output_type": "stream", |
|
|
1906 |
"text": [ |
|
|
1907 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:42: SettingWithCopyWarning:\n", |
|
|
1908 |
"\n", |
|
|
1909 |
"\n", |
|
|
1910 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1911 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1912 |
"\n", |
|
|
1913 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1914 |
"\n", |
|
|
1915 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1916 |
"\n", |
|
|
1917 |
"\n", |
|
|
1918 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1919 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1920 |
"\n", |
|
|
1921 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1922 |
"\n", |
|
|
1923 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:43: SettingWithCopyWarning:\n", |
|
|
1924 |
"\n", |
|
|
1925 |
"\n", |
|
|
1926 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1927 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1928 |
"\n", |
|
|
1929 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1930 |
"\n", |
|
|
1931 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1932 |
"\n", |
|
|
1933 |
"\n", |
|
|
1934 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1935 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1936 |
"\n", |
|
|
1937 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1938 |
"\n" |
|
|
1939 |
] |
|
|
1940 |
}, |
|
|
1941 |
{ |
|
|
1942 |
"name": "stdout", |
|
|
1943 |
"output_type": "stream", |
|
|
1944 |
"text": [ |
|
|
1945 |
"For fold 5:\n", |
|
|
1946 |
"Accuracy: 0.7389385181292696\n", |
|
|
1947 |
"f-score: 0.7389385181292696\n", |
|
|
1948 |
" pre rec spe f1 geo iba sup\n", |
|
|
1949 |
"\n", |
|
|
1950 |
" 1 0.64 0.50 0.96 0.56 0.69 0.46 1085\n", |
|
|
1951 |
" 2 0.77 0.95 0.41 0.85 0.63 0.41 6437\n", |
|
|
1952 |
" 3 0.50 0.21 0.96 0.29 0.45 0.18 1657\n", |
|
|
1953 |
" 4 0.14 0.01 1.00 0.02 0.09 0.01 336\n", |
|
|
1954 |
"\n", |
|
|
1955 |
"avg / total 0.69 0.74 0.59 0.69 0.58 0.36 9515\n", |
|
|
1956 |
"\n", |
|
|
1957 |
"[[ 538 391 148 8]\n", |
|
|
1958 |
" [ 123 6145 164 5]\n", |
|
|
1959 |
" [ 154 1152 345 6]\n", |
|
|
1960 |
" [ 26 272 35 3]]\n" |
|
|
1961 |
] |
|
|
1962 |
}, |
|
|
1963 |
{ |
|
|
1964 |
"name": "stderr", |
|
|
1965 |
"output_type": "stream", |
|
|
1966 |
"text": [ |
|
|
1967 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:42: SettingWithCopyWarning:\n", |
|
|
1968 |
"\n", |
|
|
1969 |
"\n", |
|
|
1970 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1971 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1972 |
"\n", |
|
|
1973 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1974 |
"\n", |
|
|
1975 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1976 |
"\n", |
|
|
1977 |
"\n", |
|
|
1978 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1979 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1980 |
"\n", |
|
|
1981 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1982 |
"\n", |
|
|
1983 |
"/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:43: SettingWithCopyWarning:\n", |
|
|
1984 |
"\n", |
|
|
1985 |
"\n", |
|
|
1986 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1987 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1988 |
"\n", |
|
|
1989 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1990 |
"\n", |
|
|
1991 |
"/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py:543: SettingWithCopyWarning:\n", |
|
|
1992 |
"\n", |
|
|
1993 |
"\n", |
|
|
1994 |
"A value is trying to be set on a copy of a slice from a DataFrame.\n", |
|
|
1995 |
"Try using .loc[row_indexer,col_indexer] = value instead\n", |
|
|
1996 |
"\n", |
|
|
1997 |
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", |
|
|
1998 |
"\n" |
|
|
1999 |
] |
|
|
2000 |
} |
|
|
2001 |
], |
|
|
2002 |
"source": [ |
|
|
2003 |
"%matplotlib inline\n", |
|
|
2004 |
"from sklearn.model_selection import KFold\n", |
|
|
2005 |
"from sklearn import preprocessing\n", |
|
|
2006 |
"from imblearn.over_sampling import SMOTE\n", |
|
|
2007 |
"from sklearn.metrics import f1_score\n", |
|
|
2008 |
"from imblearn.metrics import classification_report_imbalanced\n", |
|
|
2009 |
"# explicitly require this experimental feature\n", |
|
|
2010 |
"\n", |
|
|
2011 |
"from yellowbrick.classifier import ROCAUC\n", |
|
|
2012 |
"from sklearn.linear_model import LogisticRegression\n", |
|
|
2013 |
"from numpy import loadtxt\n", |
|
|
2014 |
"import os\n", |
|
|
2015 |
"os.environ['KMP_DUPLICATE_LIB_OK']='True'\n", |
|
|
2016 |
"from xgboost import XGBClassifier\n", |
|
|
2017 |
"from sklearn.model_selection import train_test_split\n", |
|
|
2018 |
"from sklearn.metrics import accuracy_score\n", |
|
|
2019 |
"import io \n", |
|
|
2020 |
"\n", |
|
|
2021 |
"\n", |
|
|
2022 |
"classes=['Death','Home','Nursing Home','Rehabilitation']\n", |
|
|
2023 |
"\n", |
|
|
2024 |
"\n", |
|
|
2025 |
"kf = KFold(n_splits=10)\n", |
|
|
2026 |
"\n", |
|
|
2027 |
"\n", |
|
|
2028 |
"for i in range (1,11):\n", |
|
|
2029 |
"\n", |
|
|
2030 |
" for fold, (train_index, test_index) in enumerate(kf.split(X), 1):\n", |
|
|
2031 |
" X_train = X.iloc[train_index]\n", |
|
|
2032 |
" y_train = y.iloc[train_index] # Based on your code, you might need a ravel call here, but I would look into how you're generating your y\n", |
|
|
2033 |
" X_test = X.iloc[test_index]\n", |
|
|
2034 |
" y_test = y.iloc[test_index] # See comment on ravel and y_train\n", |
|
|
2035 |
"\n", |
|
|
2036 |
"\n", |
|
|
2037 |
" #------------------------------IMPUTE Training Set------------------------------------\n", |
|
|
2038 |
"\n", |
|
|
2039 |
" \n", |
|
|
2040 |
"\n", |
|
|
2041 |
" #------------------------------Standardize Testing Set------------------------------------\n", |
|
|
2042 |
"\n", |
|
|
2043 |
" std_scale = preprocessing.StandardScaler().fit(X_train[cols_to_norm])\n", |
|
|
2044 |
" X_train[cols_to_norm] = std_scale.transform(X_train[cols_to_norm])\n", |
|
|
2045 |
" X_test[cols_to_norm] = std_scale.transform(X_test[cols_to_norm])\n", |
|
|
2046 |
" #------------------------------------------------------------------------------------------\n", |
|
|
2047 |
"\n", |
|
|
2048 |
" # Hyperparameters are optimized using hyperopt\n", |
|
|
2049 |
"\n", |
|
|
2050 |
" #sm = SMOTE()\n", |
|
|
2051 |
" #X_train_oversampled, y_train_oversampled = sm.fit_sample(X_train, y_train)\n", |
|
|
2052 |
" model = XGBClassifier(max_depth=8, gamma=0.063, colsample_bytree=0.71)\n", |
|
|
2053 |
" model.fit(X_train, y_train) \n", |
|
|
2054 |
" y_pred = model.predict(X_test)\n", |
|
|
2055 |
" visualizer = ROCAUC(model, classes=classes)\n", |
|
|
2056 |
" visualizer.fit(X_train, y_train) # Fit the training data to the visualizer\n", |
|
|
2057 |
" visualizer.score(X_test, y_test) # Evaluate the model on the test data\n", |
|
|
2058 |
" visualizer.poof(\"XGB_Unbalanced_{}_{}.pdf\".format(i, fold), clear_figure=True) \n", |
|
|
2059 |
" print(f'For fold {fold}:')\n", |
|
|
2060 |
" print(f'Accuracy: {model.score(X_test, y_test)}')\n", |
|
|
2061 |
" f1=f1_score(y_test, y_pred, average='micro')\n", |
|
|
2062 |
" print(f'f-score: {f1}')\n", |
|
|
2063 |
" print(classification_report_imbalanced(y_test, y_pred))\n", |
|
|
2064 |
" K= classification_report_imbalanced(y_test, y_pred)\n", |
|
|
2065 |
" df = pd.read_fwf(io.StringIO(K))\n", |
|
|
2066 |
" df.loc[\"1\":\"1\",\"pre\":\"sup\"].to_csv(\"XGB-U-D.csv\" , sep=',', encoding='utf-8', doublequote=False, index=False, mode=\"a\", header=False)\n", |
|
|
2067 |
" df.loc[\"2\":\"2\",\"pre\":\"sup\"].to_csv(\"XGB-U-H.csv\" , sep=',', encoding='utf-8', doublequote=False, index=False, mode=\"a\", header=False)\n", |
|
|
2068 |
" df.loc[\"3\":\"3\",\"pre\":\"sup\"].to_csv(\"XGB-U-N.csv\" , sep=',', encoding='utf-8', doublequote=False, index=False, mode=\"a\", header=False)\n", |
|
|
2069 |
" df.loc[\"4\":\"4\",\"pre\":\"sup\"].to_csv(\"XGB-U-R.csv\" , sep=',', encoding='utf-8', doublequote=False, index=False, mode=\"a\", header=False)\n", |
|
|
2070 |
" df.iloc[6:7,:].to_csv(\"XGB-U-avg.csv\" , sep=',', encoding='utf-8', doublequote=False, index=False, mode=\"a\", header=False)\n", |
|
|
2071 |
" from sklearn.metrics import confusion_matrix\n", |
|
|
2072 |
" print(confusion_matrix(y_test, y_pred))\n", |
|
|
2073 |
"\n", |
|
|
2074 |
" #\n", |
|
|
2075 |
"\n", |
|
|
2076 |
"\n" |
|
|
2077 |
] |
|
|
2078 |
}, |
|
|
2079 |
{ |
|
|
2080 |
"cell_type": "code", |
|
|
2081 |
"execution_count": null, |
|
|
2082 |
"metadata": {}, |
|
|
2083 |
"outputs": [], |
|
|
2084 |
"source": [] |
|
|
2085 |
}, |
|
|
2086 |
{ |
|
|
2087 |
"cell_type": "code", |
|
|
2088 |
"execution_count": null, |
|
|
2089 |
"metadata": {}, |
|
|
2090 |
"outputs": [], |
|
|
2091 |
"source": [] |
|
|
2092 |
} |
|
|
2093 |
], |
|
|
2094 |
"metadata": { |
|
|
2095 |
"kernelspec": { |
|
|
2096 |
"display_name": "Python 3", |
|
|
2097 |
"language": "python", |
|
|
2098 |
"name": "python3" |
|
|
2099 |
}, |
|
|
2100 |
"language_info": { |
|
|
2101 |
"codemirror_mode": { |
|
|
2102 |
"name": "ipython", |
|
|
2103 |
"version": 3 |
|
|
2104 |
}, |
|
|
2105 |
"file_extension": ".py", |
|
|
2106 |
"mimetype": "text/x-python", |
|
|
2107 |
"name": "python", |
|
|
2108 |
"nbconvert_exporter": "python", |
|
|
2109 |
"pygments_lexer": "ipython3", |
|
|
2110 |
"version": "3.8.3" |
|
|
2111 |
} |
|
|
2112 |
}, |
|
|
2113 |
"nbformat": 4, |
|
|
2114 |
"nbformat_minor": 4 |
|
|
2115 |
} |