Skip to content

Commit a4e8cdf

Browse files
gustavocidornelaswhoseoyster
authored andcommitted
Completes UNB-2628 - pip install unboxapi on the tutorial notebooks
1 parent a06b24e commit a4e8cdf

File tree

2 files changed

+203
-10
lines changed

2 files changed

+203
-10
lines changed

examples/tabular-classification/documentation-tutorial/tabular-tutorial-part-1.ipynb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,17 @@
455455
"validation_set = pd.concat([X_val, y_val], axis=1)"
456456
]
457457
},
458+
{
459+
"cell_type": "code",
460+
"execution_count": null,
461+
"id": "945e2619",
462+
"metadata": {},
463+
"outputs": [],
464+
"source": [
465+
"# installing the Unbox Python API\n",
466+
"!pip install unboxapi"
467+
]
468+
},
458469
{
459470
"cell_type": "code",
460471
"execution_count": null,

examples/tabular-classification/documentation-tutorial/tabular-tutorial-part-2.ipynb

Lines changed: 192 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
},
5656
{
5757
"cell_type": "code",
58-
"execution_count": null,
58+
"execution_count": 2,
5959
"id": "e633540e",
6060
"metadata": {},
6161
"outputs": [],
@@ -72,7 +72,7 @@
7272
},
7373
{
7474
"cell_type": "code",
75-
"execution_count": null,
75+
"execution_count": 3,
7676
"id": "775b2b8f",
7777
"metadata": {},
7878
"outputs": [],
@@ -83,7 +83,7 @@
8383
},
8484
{
8585
"cell_type": "code",
86-
"execution_count": null,
86+
"execution_count": 4,
8787
"id": "50e97690",
8888
"metadata": {},
8989
"outputs": [],
@@ -104,10 +104,26 @@
104104
},
105105
{
106106
"cell_type": "code",
107-
"execution_count": null,
107+
"execution_count": 5,
108108
"id": "8ffae7d8",
109109
"metadata": {},
110-
"outputs": [],
110+
"outputs": [
111+
{
112+
"data": {
113+
"text/plain": [
114+
"Gender Exited\n",
115+
"Female 0 20\n",
116+
" 1 80\n",
117+
"Male 0 3346\n",
118+
" 1 654\n",
119+
"Name: Exited, dtype: int64"
120+
]
121+
},
122+
"execution_count": 5,
123+
"metadata": {},
124+
"output_type": "execute_result"
125+
}
126+
],
111127
"source": [
112128
"training_set.groupby([\"Gender\", \"Exited\"])[\"Exited\"].count()"
113129
]
@@ -132,7 +148,7 @@
132148
},
133149
{
134150
"cell_type": "code",
135-
"execution_count": null,
151+
"execution_count": 6,
136152
"id": "b562a655",
137153
"metadata": {},
138154
"outputs": [],
@@ -142,10 +158,165 @@
142158
},
143159
{
144160
"cell_type": "code",
145-
"execution_count": null,
161+
"execution_count": 7,
146162
"id": "080f075b",
147163
"metadata": {},
148-
"outputs": [],
164+
"outputs": [
165+
{
166+
"data": {
167+
"text/html": [
168+
"<div>\n",
169+
"<style scoped>\n",
170+
" .dataframe tbody tr th:only-of-type {\n",
171+
" vertical-align: middle;\n",
172+
" }\n",
173+
"\n",
174+
" .dataframe tbody tr th {\n",
175+
" vertical-align: top;\n",
176+
" }\n",
177+
"\n",
178+
" .dataframe thead th {\n",
179+
" text-align: right;\n",
180+
" }\n",
181+
"</style>\n",
182+
"<table border=\"1\" class=\"dataframe\">\n",
183+
" <thead>\n",
184+
" <tr style=\"text-align: right;\">\n",
185+
" <th></th>\n",
186+
" <th>RowNumber</th>\n",
187+
" <th>CustomerId</th>\n",
188+
" <th>Surname</th>\n",
189+
" <th>CreditScore</th>\n",
190+
" <th>Geography</th>\n",
191+
" <th>Gender</th>\n",
192+
" <th>Age</th>\n",
193+
" <th>Tenure</th>\n",
194+
" <th>Balance</th>\n",
195+
" <th>NumOfProducts</th>\n",
196+
" <th>HasCrCard</th>\n",
197+
" <th>IsActiveMember</th>\n",
198+
" <th>EstimatedSalary</th>\n",
199+
" <th>Exited</th>\n",
200+
" </tr>\n",
201+
" </thead>\n",
202+
" <tbody>\n",
203+
" <tr>\n",
204+
" <th>0</th>\n",
205+
" <td>8274</td>\n",
206+
" <td>15709643</td>\n",
207+
" <td>Gray</td>\n",
208+
" <td>675</td>\n",
209+
" <td>France</td>\n",
210+
" <td>Male</td>\n",
211+
" <td>32</td>\n",
212+
" <td>1</td>\n",
213+
" <td>0.00</td>\n",
214+
" <td>3</td>\n",
215+
" <td>1</td>\n",
216+
" <td>0</td>\n",
217+
" <td>85901.09</td>\n",
218+
" <td>0</td>\n",
219+
" </tr>\n",
220+
" <tr>\n",
221+
" <th>1</th>\n",
222+
" <td>8277</td>\n",
223+
" <td>15775131</td>\n",
224+
" <td>Bartlett</td>\n",
225+
" <td>580</td>\n",
226+
" <td>Spain</td>\n",
227+
" <td>Male</td>\n",
228+
" <td>32</td>\n",
229+
" <td>9</td>\n",
230+
" <td>142188.20</td>\n",
231+
" <td>2</td>\n",
232+
" <td>0</td>\n",
233+
" <td>1</td>\n",
234+
" <td>128028.60</td>\n",
235+
" <td>0</td>\n",
236+
" </tr>\n",
237+
" <tr>\n",
238+
" <th>2</th>\n",
239+
" <td>8281</td>\n",
240+
" <td>15745716</td>\n",
241+
" <td>McGregor</td>\n",
242+
" <td>706</td>\n",
243+
" <td>Spain</td>\n",
244+
" <td>Male</td>\n",
245+
" <td>53</td>\n",
246+
" <td>7</td>\n",
247+
" <td>0.00</td>\n",
248+
" <td>2</td>\n",
249+
" <td>0</td>\n",
250+
" <td>1</td>\n",
251+
" <td>117939.17</td>\n",
252+
" <td>0</td>\n",
253+
" </tr>\n",
254+
" <tr>\n",
255+
" <th>3</th>\n",
256+
" <td>8282</td>\n",
257+
" <td>15598485</td>\n",
258+
" <td>Pinto</td>\n",
259+
" <td>567</td>\n",
260+
" <td>Spain</td>\n",
261+
" <td>Male</td>\n",
262+
" <td>40</td>\n",
263+
" <td>8</td>\n",
264+
" <td>28649.64</td>\n",
265+
" <td>1</td>\n",
266+
" <td>1</td>\n",
267+
" <td>1</td>\n",
268+
" <td>95140.62</td>\n",
269+
" <td>0</td>\n",
270+
" </tr>\n",
271+
" <tr>\n",
272+
" <th>4</th>\n",
273+
" <td>8284</td>\n",
274+
" <td>15754569</td>\n",
275+
" <td>Pagnotto</td>\n",
276+
" <td>664</td>\n",
277+
" <td>France</td>\n",
278+
" <td>Male</td>\n",
279+
" <td>57</td>\n",
280+
" <td>1</td>\n",
281+
" <td>0.00</td>\n",
282+
" <td>2</td>\n",
283+
" <td>1</td>\n",
284+
" <td>1</td>\n",
285+
" <td>56562.57</td>\n",
286+
" <td>0</td>\n",
287+
" </tr>\n",
288+
" </tbody>\n",
289+
"</table>\n",
290+
"</div>"
291+
],
292+
"text/plain": [
293+
" RowNumber CustomerId Surname CreditScore Geography Gender Age Tenure \\\n",
294+
"0 8274 15709643 Gray 675 France Male 32 1 \n",
295+
"1 8277 15775131 Bartlett 580 Spain Male 32 9 \n",
296+
"2 8281 15745716 McGregor 706 Spain Male 53 7 \n",
297+
"3 8282 15598485 Pinto 567 Spain Male 40 8 \n",
298+
"4 8284 15754569 Pagnotto 664 France Male 57 1 \n",
299+
"\n",
300+
" Balance NumOfProducts HasCrCard IsActiveMember EstimatedSalary \\\n",
301+
"0 0.00 3 1 0 85901.09 \n",
302+
"1 142188.20 2 0 1 128028.60 \n",
303+
"2 0.00 2 0 1 117939.17 \n",
304+
"3 28649.64 1 1 1 95140.62 \n",
305+
"4 0.00 2 1 1 56562.57 \n",
306+
"\n",
307+
" Exited \n",
308+
"0 0 \n",
309+
"1 0 \n",
310+
"2 0 \n",
311+
"3 0 \n",
312+
"4 0 "
313+
]
314+
},
315+
"execution_count": 7,
316+
"metadata": {},
317+
"output_type": "execute_result"
318+
}
319+
],
149320
"source": [
150321
"new_prod_data = pd.read_csv(NEW_PROD_DATA_URL)\n",
151322
"new_prod_data.head()"
@@ -161,7 +332,7 @@
161332
},
162333
{
163334
"cell_type": "code",
164-
"execution_count": null,
335+
"execution_count": 8,
165336
"id": "e17d8121",
166337
"metadata": {},
167338
"outputs": [],
@@ -171,7 +342,7 @@
171342
},
172343
{
173344
"cell_type": "code",
174-
"execution_count": null,
345+
"execution_count": 9,
175346
"id": "8cfdb549",
176347
"metadata": {},
177348
"outputs": [],
@@ -322,6 +493,17 @@
322493
" return model.predict_proba(encoded_df.to_numpy())"
323494
]
324495
},
496+
{
497+
"cell_type": "code",
498+
"execution_count": null,
499+
"id": "c7739e4e",
500+
"metadata": {},
501+
"outputs": [],
502+
"source": [
503+
"# installing the Unbox Python API\n",
504+
"!pip install unboxapi"
505+
]
506+
},
325507
{
326508
"cell_type": "code",
327509
"execution_count": null,

0 commit comments

Comments
 (0)