AniaAri commited on
Commit
9e9d4f8
·
verified ·
1 Parent(s): 79d4451

Upload 4 files

Browse files
Files changed (4) hide show
  1. Pregunta05.ipynb +978 -0
  2. app.py +15 -0
  3. model (1).joblib +3 -0
  4. requirements (3).txt +488 -0
Pregunta05.ipynb ADDED
@@ -0,0 +1,978 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "nbformat": 4,
3
+ "nbformat_minor": 0,
4
+ "metadata": {
5
+ "colab": {
6
+ "provenance": []
7
+ },
8
+ "kernelspec": {
9
+ "name": "python3",
10
+ "display_name": "Python 3"
11
+ },
12
+ "language_info": {
13
+ "name": "python"
14
+ }
15
+ },
16
+ "cells": [
17
+ {
18
+ "cell_type": "code",
19
+ "execution_count": 1,
20
+ "metadata": {
21
+ "colab": {
22
+ "base_uri": "https://localhost:8080/",
23
+ "height": 206
24
+ },
25
+ "id": "NezcyI41oBTd",
26
+ "outputId": "13100a09-94dc-4e25-e39d-8bd8fe5aa7b2"
27
+ },
28
+ "outputs": [
29
+ {
30
+ "output_type": "execute_result",
31
+ "data": {
32
+ "text/plain": [
33
+ " Character Universe Strength Speed Intelligence SpecialAbilities \\\n",
34
+ "0 Wonder Woman Marvel 7 8 3 Telekinesis \n",
35
+ "1 Iron Man Marvel 4 7 9 Telekinesis \n",
36
+ "2 Iron Man DC Comics 8 7 5 Telekinesis \n",
37
+ "3 Spider-Man DC Comics 5 6 10 Telekinesis \n",
38
+ "4 Flash Marvel 7 6 2 Invisibility \n",
39
+ "\n",
40
+ " Weaknesses BattleOutcome \n",
41
+ "0 Kryptonite 0 \n",
42
+ "1 Kryptonite 0 \n",
43
+ "2 Magic 0 \n",
44
+ "3 Kryptonite 0 \n",
45
+ "4 Magic 0 "
46
+ ],
47
+ "text/html": [
48
+ "\n",
49
+ " <div id=\"df-b1ef9f7f-f0e5-4371-9575-ca528a66f5fa\" class=\"colab-df-container\">\n",
50
+ " <div>\n",
51
+ "<style scoped>\n",
52
+ " .dataframe tbody tr th:only-of-type {\n",
53
+ " vertical-align: middle;\n",
54
+ " }\n",
55
+ "\n",
56
+ " .dataframe tbody tr th {\n",
57
+ " vertical-align: top;\n",
58
+ " }\n",
59
+ "\n",
60
+ " .dataframe thead th {\n",
61
+ " text-align: right;\n",
62
+ " }\n",
63
+ "</style>\n",
64
+ "<table border=\"1\" class=\"dataframe\">\n",
65
+ " <thead>\n",
66
+ " <tr style=\"text-align: right;\">\n",
67
+ " <th></th>\n",
68
+ " <th>Character</th>\n",
69
+ " <th>Universe</th>\n",
70
+ " <th>Strength</th>\n",
71
+ " <th>Speed</th>\n",
72
+ " <th>Intelligence</th>\n",
73
+ " <th>SpecialAbilities</th>\n",
74
+ " <th>Weaknesses</th>\n",
75
+ " <th>BattleOutcome</th>\n",
76
+ " </tr>\n",
77
+ " </thead>\n",
78
+ " <tbody>\n",
79
+ " <tr>\n",
80
+ " <th>0</th>\n",
81
+ " <td>Wonder Woman</td>\n",
82
+ " <td>Marvel</td>\n",
83
+ " <td>7</td>\n",
84
+ " <td>8</td>\n",
85
+ " <td>3</td>\n",
86
+ " <td>Telekinesis</td>\n",
87
+ " <td>Kryptonite</td>\n",
88
+ " <td>0</td>\n",
89
+ " </tr>\n",
90
+ " <tr>\n",
91
+ " <th>1</th>\n",
92
+ " <td>Iron Man</td>\n",
93
+ " <td>Marvel</td>\n",
94
+ " <td>4</td>\n",
95
+ " <td>7</td>\n",
96
+ " <td>9</td>\n",
97
+ " <td>Telekinesis</td>\n",
98
+ " <td>Kryptonite</td>\n",
99
+ " <td>0</td>\n",
100
+ " </tr>\n",
101
+ " <tr>\n",
102
+ " <th>2</th>\n",
103
+ " <td>Iron Man</td>\n",
104
+ " <td>DC Comics</td>\n",
105
+ " <td>8</td>\n",
106
+ " <td>7</td>\n",
107
+ " <td>5</td>\n",
108
+ " <td>Telekinesis</td>\n",
109
+ " <td>Magic</td>\n",
110
+ " <td>0</td>\n",
111
+ " </tr>\n",
112
+ " <tr>\n",
113
+ " <th>3</th>\n",
114
+ " <td>Spider-Man</td>\n",
115
+ " <td>DC Comics</td>\n",
116
+ " <td>5</td>\n",
117
+ " <td>6</td>\n",
118
+ " <td>10</td>\n",
119
+ " <td>Telekinesis</td>\n",
120
+ " <td>Kryptonite</td>\n",
121
+ " <td>0</td>\n",
122
+ " </tr>\n",
123
+ " <tr>\n",
124
+ " <th>4</th>\n",
125
+ " <td>Flash</td>\n",
126
+ " <td>Marvel</td>\n",
127
+ " <td>7</td>\n",
128
+ " <td>6</td>\n",
129
+ " <td>2</td>\n",
130
+ " <td>Invisibility</td>\n",
131
+ " <td>Magic</td>\n",
132
+ " <td>0</td>\n",
133
+ " </tr>\n",
134
+ " </tbody>\n",
135
+ "</table>\n",
136
+ "</div>\n",
137
+ " <div class=\"colab-df-buttons\">\n",
138
+ "\n",
139
+ " <div class=\"colab-df-container\">\n",
140
+ " <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-b1ef9f7f-f0e5-4371-9575-ca528a66f5fa')\"\n",
141
+ " title=\"Convert this dataframe to an interactive table.\"\n",
142
+ " style=\"display:none;\">\n",
143
+ "\n",
144
+ " <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
145
+ " <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
146
+ " </svg>\n",
147
+ " </button>\n",
148
+ "\n",
149
+ " <style>\n",
150
+ " .colab-df-container {\n",
151
+ " display:flex;\n",
152
+ " gap: 12px;\n",
153
+ " }\n",
154
+ "\n",
155
+ " .colab-df-convert {\n",
156
+ " background-color: #E8F0FE;\n",
157
+ " border: none;\n",
158
+ " border-radius: 50%;\n",
159
+ " cursor: pointer;\n",
160
+ " display: none;\n",
161
+ " fill: #1967D2;\n",
162
+ " height: 32px;\n",
163
+ " padding: 0 0 0 0;\n",
164
+ " width: 32px;\n",
165
+ " }\n",
166
+ "\n",
167
+ " .colab-df-convert:hover {\n",
168
+ " background-color: #E2EBFA;\n",
169
+ " box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
170
+ " fill: #174EA6;\n",
171
+ " }\n",
172
+ "\n",
173
+ " .colab-df-buttons div {\n",
174
+ " margin-bottom: 4px;\n",
175
+ " }\n",
176
+ "\n",
177
+ " [theme=dark] .colab-df-convert {\n",
178
+ " background-color: #3B4455;\n",
179
+ " fill: #D2E3FC;\n",
180
+ " }\n",
181
+ "\n",
182
+ " [theme=dark] .colab-df-convert:hover {\n",
183
+ " background-color: #434B5C;\n",
184
+ " box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
185
+ " filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
186
+ " fill: #FFFFFF;\n",
187
+ " }\n",
188
+ " </style>\n",
189
+ "\n",
190
+ " <script>\n",
191
+ " const buttonEl =\n",
192
+ " document.querySelector('#df-b1ef9f7f-f0e5-4371-9575-ca528a66f5fa button.colab-df-convert');\n",
193
+ " buttonEl.style.display =\n",
194
+ " google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
195
+ "\n",
196
+ " async function convertToInteractive(key) {\n",
197
+ " const element = document.querySelector('#df-b1ef9f7f-f0e5-4371-9575-ca528a66f5fa');\n",
198
+ " const dataTable =\n",
199
+ " await google.colab.kernel.invokeFunction('convertToInteractive',\n",
200
+ " [key], {});\n",
201
+ " if (!dataTable) return;\n",
202
+ "\n",
203
+ " const docLinkHtml = 'Like what you see? Visit the ' +\n",
204
+ " '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
205
+ " + ' to learn more about interactive tables.';\n",
206
+ " element.innerHTML = '';\n",
207
+ " dataTable['output_type'] = 'display_data';\n",
208
+ " await google.colab.output.renderOutput(dataTable, element);\n",
209
+ " const docLink = document.createElement('div');\n",
210
+ " docLink.innerHTML = docLinkHtml;\n",
211
+ " element.appendChild(docLink);\n",
212
+ " }\n",
213
+ " </script>\n",
214
+ " </div>\n",
215
+ "\n",
216
+ "\n",
217
+ "<div id=\"df-0643eac9-aba1-4915-bb36-935cd9a062a5\">\n",
218
+ " <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-0643eac9-aba1-4915-bb36-935cd9a062a5')\"\n",
219
+ " title=\"Suggest charts\"\n",
220
+ " style=\"display:none;\">\n",
221
+ "\n",
222
+ "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
223
+ " width=\"24px\">\n",
224
+ " <g>\n",
225
+ " <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
226
+ " </g>\n",
227
+ "</svg>\n",
228
+ " </button>\n",
229
+ "\n",
230
+ "<style>\n",
231
+ " .colab-df-quickchart {\n",
232
+ " --bg-color: #E8F0FE;\n",
233
+ " --fill-color: #1967D2;\n",
234
+ " --hover-bg-color: #E2EBFA;\n",
235
+ " --hover-fill-color: #174EA6;\n",
236
+ " --disabled-fill-color: #AAA;\n",
237
+ " --disabled-bg-color: #DDD;\n",
238
+ " }\n",
239
+ "\n",
240
+ " [theme=dark] .colab-df-quickchart {\n",
241
+ " --bg-color: #3B4455;\n",
242
+ " --fill-color: #D2E3FC;\n",
243
+ " --hover-bg-color: #434B5C;\n",
244
+ " --hover-fill-color: #FFFFFF;\n",
245
+ " --disabled-bg-color: #3B4455;\n",
246
+ " --disabled-fill-color: #666;\n",
247
+ " }\n",
248
+ "\n",
249
+ " .colab-df-quickchart {\n",
250
+ " background-color: var(--bg-color);\n",
251
+ " border: none;\n",
252
+ " border-radius: 50%;\n",
253
+ " cursor: pointer;\n",
254
+ " display: none;\n",
255
+ " fill: var(--fill-color);\n",
256
+ " height: 32px;\n",
257
+ " padding: 0;\n",
258
+ " width: 32px;\n",
259
+ " }\n",
260
+ "\n",
261
+ " .colab-df-quickchart:hover {\n",
262
+ " background-color: var(--hover-bg-color);\n",
263
+ " box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
264
+ " fill: var(--button-hover-fill-color);\n",
265
+ " }\n",
266
+ "\n",
267
+ " .colab-df-quickchart-complete:disabled,\n",
268
+ " .colab-df-quickchart-complete:disabled:hover {\n",
269
+ " background-color: var(--disabled-bg-color);\n",
270
+ " fill: var(--disabled-fill-color);\n",
271
+ " box-shadow: none;\n",
272
+ " }\n",
273
+ "\n",
274
+ " .colab-df-spinner {\n",
275
+ " border: 2px solid var(--fill-color);\n",
276
+ " border-color: transparent;\n",
277
+ " border-bottom-color: var(--fill-color);\n",
278
+ " animation:\n",
279
+ " spin 1s steps(1) infinite;\n",
280
+ " }\n",
281
+ "\n",
282
+ " @keyframes spin {\n",
283
+ " 0% {\n",
284
+ " border-color: transparent;\n",
285
+ " border-bottom-color: var(--fill-color);\n",
286
+ " border-left-color: var(--fill-color);\n",
287
+ " }\n",
288
+ " 20% {\n",
289
+ " border-color: transparent;\n",
290
+ " border-left-color: var(--fill-color);\n",
291
+ " border-top-color: var(--fill-color);\n",
292
+ " }\n",
293
+ " 30% {\n",
294
+ " border-color: transparent;\n",
295
+ " border-left-color: var(--fill-color);\n",
296
+ " border-top-color: var(--fill-color);\n",
297
+ " border-right-color: var(--fill-color);\n",
298
+ " }\n",
299
+ " 40% {\n",
300
+ " border-color: transparent;\n",
301
+ " border-right-color: var(--fill-color);\n",
302
+ " border-top-color: var(--fill-color);\n",
303
+ " }\n",
304
+ " 60% {\n",
305
+ " border-color: transparent;\n",
306
+ " border-right-color: var(--fill-color);\n",
307
+ " }\n",
308
+ " 80% {\n",
309
+ " border-color: transparent;\n",
310
+ " border-right-color: var(--fill-color);\n",
311
+ " border-bottom-color: var(--fill-color);\n",
312
+ " }\n",
313
+ " 90% {\n",
314
+ " border-color: transparent;\n",
315
+ " border-bottom-color: var(--fill-color);\n",
316
+ " }\n",
317
+ " }\n",
318
+ "</style>\n",
319
+ "\n",
320
+ " <script>\n",
321
+ " async function quickchart(key) {\n",
322
+ " const quickchartButtonEl =\n",
323
+ " document.querySelector('#' + key + ' button');\n",
324
+ " quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n",
325
+ " quickchartButtonEl.classList.add('colab-df-spinner');\n",
326
+ " try {\n",
327
+ " const charts = await google.colab.kernel.invokeFunction(\n",
328
+ " 'suggestCharts', [key], {});\n",
329
+ " } catch (error) {\n",
330
+ " console.error('Error during call to suggestCharts:', error);\n",
331
+ " }\n",
332
+ " quickchartButtonEl.classList.remove('colab-df-spinner');\n",
333
+ " quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
334
+ " }\n",
335
+ " (() => {\n",
336
+ " let quickchartButtonEl =\n",
337
+ " document.querySelector('#df-0643eac9-aba1-4915-bb36-935cd9a062a5 button');\n",
338
+ " quickchartButtonEl.style.display =\n",
339
+ " google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
340
+ " })();\n",
341
+ " </script>\n",
342
+ "</div>\n",
343
+ "\n",
344
+ " </div>\n",
345
+ " </div>\n"
346
+ ],
347
+ "application/vnd.google.colaboratory.intrinsic+json": {
348
+ "type": "dataframe",
349
+ "variable_name": "df",
350
+ "summary": "{\n \"name\": \"df\",\n \"rows\": 2351,\n \"fields\": [\n {\n \"column\": \"Character\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 8,\n \"samples\": [\n \"Iron Man\",\n \"Batman\",\n \"Wonder Woman\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Universe\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 2,\n \"samples\": [\n \"DC Comics\",\n \"Marvel\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Strength\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 2,\n \"min\": 1,\n \"max\": 10,\n \"num_unique_values\": 10,\n \"samples\": [\n 1,\n 4\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Speed\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 2,\n \"min\": 1,\n \"max\": 10,\n \"num_unique_values\": 10,\n \"samples\": [\n 1,\n 7\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Intelligence\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 2,\n \"min\": 1,\n \"max\": 10,\n \"num_unique_values\": 10,\n \"samples\": [\n 6,\n 9\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"SpecialAbilities\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 4,\n \"samples\": [\n \"Invisibility\",\n \"Flight\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Weaknesses\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 4,\n \"samples\": [\n \"Magic\",\n \"Silver\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"BattleOutcome\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0,\n \"min\": 0,\n \"max\": 1,\n \"num_unique_values\": 2,\n \"samples\": [\n 1,\n 0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"
351
+ }
352
+ },
353
+ "metadata": {},
354
+ "execution_count": 1
355
+ }
356
+ ],
357
+ "source": [
358
+ "import pandas as pd\n",
359
+ "\n",
360
+ "# Cargar el archivo .csv\n",
361
+ "df = pd.read_csv('/content/sample_data/fictional_character_battles_complex.csv')\n",
362
+ "\n",
363
+ "# Mostrar las primeras filas del DataFrame\n",
364
+ "df.head()\n"
365
+ ]
366
+ },
367
+ {
368
+ "cell_type": "code",
369
+ "source": [
370
+ "import pandas as pd\n",
371
+ "from sklearn.model_selection import train_test_split\n",
372
+ "from sklearn.tree import DecisionTreeClassifier\n",
373
+ "from sklearn.metrics import accuracy_score\n",
374
+ "\n",
375
+ "# Cargar el archivo .csv\n",
376
+ "df = pd.read_csv('/content/sample_data/fictional_character_battles_complex.csv')\n",
377
+ "\n",
378
+ "# Mostrar las primeras filas del DataFrame\n",
379
+ "print(df.head())\n",
380
+ "\n",
381
+ "# Mostrar los nombres de las columnas\n",
382
+ "print(df.columns)\n",
383
+ "\n",
384
+ "# Asumiendo que 'BattleOutcome' es la columna objetivo\n",
385
+ "X = df.drop('BattleOutcome', axis=1)\n",
386
+ "y = df['BattleOutcome']\n",
387
+ "\n",
388
+ "# Convertir características categóricas a numéricas\n",
389
+ "X = pd.get_dummies(X)\n",
390
+ "\n",
391
+ "# Dividir los datos en conjunto de entrenamiento y prueba\n",
392
+ "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=42)\n",
393
+ "\n",
394
+ "# Crear el modelo de árbol de decisión\n",
395
+ "clf = DecisionTreeClassifier()\n",
396
+ "clf.fit(X_train, y_train)\n",
397
+ "\n",
398
+ "# Predecir en el conjunto de prueba\n",
399
+ "y_pred = clf.predict(X_test)\n",
400
+ "\n",
401
+ "# Calcular la precisión del modelo\n",
402
+ "accuracy = accuracy_score(y_test, y_pred)\n",
403
+ "print(f'Accuracy: {accuracy}')\n",
404
+ "\n"
405
+ ],
406
+ "metadata": {
407
+ "colab": {
408
+ "base_uri": "https://localhost:8080/"
409
+ },
410
+ "id": "FlrzvGXaoM2g",
411
+ "outputId": "c72f91c1-bb95-4f91-845d-fcc647069dcf"
412
+ },
413
+ "execution_count": 7,
414
+ "outputs": [
415
+ {
416
+ "output_type": "stream",
417
+ "name": "stdout",
418
+ "text": [
419
+ " Character Universe Strength Speed Intelligence SpecialAbilities \\\n",
420
+ "0 Wonder Woman Marvel 7 8 3 Telekinesis \n",
421
+ "1 Iron Man Marvel 4 7 9 Telekinesis \n",
422
+ "2 Iron Man DC Comics 8 7 5 Telekinesis \n",
423
+ "3 Spider-Man DC Comics 5 6 10 Telekinesis \n",
424
+ "4 Flash Marvel 7 6 2 Invisibility \n",
425
+ "\n",
426
+ " Weaknesses BattleOutcome \n",
427
+ "0 Kryptonite 0 \n",
428
+ "1 Kryptonite 0 \n",
429
+ "2 Magic 0 \n",
430
+ "3 Kryptonite 0 \n",
431
+ "4 Magic 0 \n",
432
+ "Index(['Character', 'Universe', 'Strength', 'Speed', 'Intelligence',\n",
433
+ " 'SpecialAbilities', 'Weaknesses', 'BattleOutcome'],\n",
434
+ " dtype='object')\n",
435
+ "Accuracy: 0.7195467422096318\n"
436
+ ]
437
+ }
438
+ ]
439
+ },
440
+ {
441
+ "cell_type": "code",
442
+ "source": [
443
+ "from sklearn.model_selection import cross_val_score\n",
444
+ "\n",
445
+ "# Evaluar el modelo utilizando validación cruzada\n",
446
+ "scores = cross_val_score(clf, X, y, cv=5)\n",
447
+ "print(f'Cross-Validation Accuracy Scores: {scores}')\n",
448
+ "print(f'Mean Cross-Validation Accuracy: {scores.mean()}')\n"
449
+ ],
450
+ "metadata": {
451
+ "colab": {
452
+ "base_uri": "https://localhost:8080/"
453
+ },
454
+ "id": "mW8m0DpfrgUO",
455
+ "outputId": "2d48b79f-11f1-41ec-f935-07b83a2efc0d"
456
+ },
457
+ "execution_count": 8,
458
+ "outputs": [
459
+ {
460
+ "output_type": "stream",
461
+ "name": "stdout",
462
+ "text": [
463
+ "Cross-Validation Accuracy Scores: [0.73036093 0.70425532 0.72340426 0.73404255 0.74042553]\n",
464
+ "Mean Cross-Validation Accuracy: 0.7264977187514117\n"
465
+ ]
466
+ }
467
+ ]
468
+ },
469
+ {
470
+ "cell_type": "code",
471
+ "source": [
472
+ "import joblib\n",
473
+ "\n",
474
+ "# Guardar el modelo entrenado\n",
475
+ "joblib.dump(clf, 'model.joblib')\n"
476
+ ],
477
+ "metadata": {
478
+ "colab": {
479
+ "base_uri": "https://localhost:8080/"
480
+ },
481
+ "id": "h-On3jAGrhxu",
482
+ "outputId": "53077bda-6f68-4243-a134-c3aba45058be"
483
+ },
484
+ "execution_count": 9,
485
+ "outputs": [
486
+ {
487
+ "output_type": "execute_result",
488
+ "data": {
489
+ "text/plain": [
490
+ "['model.joblib']"
491
+ ]
492
+ },
493
+ "metadata": {},
494
+ "execution_count": 9
495
+ }
496
+ ]
497
+ },
498
+ {
499
+ "cell_type": "code",
500
+ "source": [
501
+ "import pandas as pd\n",
502
+ "from sklearn.model_selection import train_test_split, cross_val_score\n",
503
+ "from sklearn.tree import DecisionTreeClassifier\n",
504
+ "from sklearn.metrics import accuracy_score\n",
505
+ "import joblib\n",
506
+ "\n",
507
+ "# Cargar el archivo .csv\n",
508
+ "df = pd.read_csv('/content/sample_data/fictional_character_battles_complex.csv')\n",
509
+ "\n",
510
+ "# Mostrar las primeras filas del DataFrame\n",
511
+ "print(df.head())\n",
512
+ "\n",
513
+ "# Mostrar los nombres de las columnas\n",
514
+ "print(df.columns)\n",
515
+ "\n",
516
+ "# Asumiendo que 'BattleOutcome' es la columna objetivo\n",
517
+ "X = df.drop('BattleOutcome', axis=1)\n",
518
+ "y = df['BattleOutcome']\n",
519
+ "\n",
520
+ "# Convertir características categóricas a numéricas\n",
521
+ "X = pd.get_dummies(X)\n",
522
+ "\n",
523
+ "# Dividir los datos en conjunto de entrenamiento y prueba\n",
524
+ "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=42)\n",
525
+ "\n",
526
+ "# Crear el modelo de árbol de decisión\n",
527
+ "clf = DecisionTreeClassifier()\n",
528
+ "clf.fit(X_train, y_train)\n",
529
+ "\n",
530
+ "# Predecir en el conjunto de prueba\n",
531
+ "y_pred = clf.predict(X_test)\n",
532
+ "\n",
533
+ "# Calcular la precisión del modelo\n",
534
+ "accuracy = accuracy_score(y_test, y_pred)\n",
535
+ "print(f'Accuracy: {accuracy}')\n",
536
+ "\n",
537
+ "# Evaluar el modelo utilizando validación cruzada\n",
538
+ "scores = cross_val_score(clf, X, y, cv=5)\n",
539
+ "print(f'Cross-Validation Accuracy Scores: {scores}')\n",
540
+ "print(f'Mean Cross-Validation Accuracy: {scores.mean()}')\n",
541
+ "\n",
542
+ "# Guardar el modelo entrenado\n",
543
+ "joblib.dump(clf, 'model.joblib')\n"
544
+ ],
545
+ "metadata": {
546
+ "colab": {
547
+ "base_uri": "https://localhost:8080/"
548
+ },
549
+ "id": "sACbNIeurkYu",
550
+ "outputId": "846e1cbf-d338-4b58-bcad-e11f4f971c0b"
551
+ },
552
+ "execution_count": 11,
553
+ "outputs": [
554
+ {
555
+ "output_type": "stream",
556
+ "name": "stdout",
557
+ "text": [
558
+ " Character Universe Strength Speed Intelligence SpecialAbilities \\\n",
559
+ "0 Wonder Woman Marvel 7 8 3 Telekinesis \n",
560
+ "1 Iron Man Marvel 4 7 9 Telekinesis \n",
561
+ "2 Iron Man DC Comics 8 7 5 Telekinesis \n",
562
+ "3 Spider-Man DC Comics 5 6 10 Telekinesis \n",
563
+ "4 Flash Marvel 7 6 2 Invisibility \n",
564
+ "\n",
565
+ " Weaknesses BattleOutcome \n",
566
+ "0 Kryptonite 0 \n",
567
+ "1 Kryptonite 0 \n",
568
+ "2 Magic 0 \n",
569
+ "3 Kryptonite 0 \n",
570
+ "4 Magic 0 \n",
571
+ "Index(['Character', 'Universe', 'Strength', 'Speed', 'Intelligence',\n",
572
+ " 'SpecialAbilities', 'Weaknesses', 'BattleOutcome'],\n",
573
+ " dtype='object')\n",
574
+ "Accuracy: 0.7294617563739377\n",
575
+ "Cross-Validation Accuracy Scores: [0.73673036 0.68723404 0.7212766 0.74255319 0.74042553]\n",
576
+ "Mean Cross-Validation Accuracy: 0.725643944527262\n"
577
+ ]
578
+ },
579
+ {
580
+ "output_type": "execute_result",
581
+ "data": {
582
+ "text/plain": [
583
+ "['model.joblib']"
584
+ ]
585
+ },
586
+ "metadata": {},
587
+ "execution_count": 11
588
+ }
589
+ ]
590
+ },
591
+ {
592
+ "cell_type": "code",
593
+ "source": [
594
+ "!pip3 freeze > requirements.txt\n"
595
+ ],
596
+ "metadata": {
597
+ "id": "xMAnXM0BtfwM"
598
+ },
599
+ "execution_count": 14,
600
+ "outputs": []
601
+ },
602
+ {
603
+ "cell_type": "code",
604
+ "source": [
605
+ "!pip install fastapi uvicorn pyngrok\n"
606
+ ],
607
+ "metadata": {
608
+ "colab": {
609
+ "base_uri": "https://localhost:8080/"
610
+ },
611
+ "id": "rG8DkKIWttxk",
612
+ "outputId": "47e34d7a-e29a-48ac-dfc6-0e6f60728d65"
613
+ },
614
+ "execution_count": 17,
615
+ "outputs": [
616
+ {
617
+ "output_type": "stream",
618
+ "name": "stdout",
619
+ "text": [
620
+ "Collecting fastapi\n",
621
+ " Downloading fastapi-0.111.0-py3-none-any.whl (91 kB)\n",
622
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m92.0/92.0 kB\u001b[0m \u001b[31m2.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
623
+ "\u001b[?25hCollecting uvicorn\n",
624
+ " Downloading uvicorn-0.30.1-py3-none-any.whl (62 kB)\n",
625
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m62.4/62.4 kB\u001b[0m \u001b[31m5.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
626
+ "\u001b[?25hCollecting pyngrok\n",
627
+ " Downloading pyngrok-7.1.6-py3-none-any.whl (22 kB)\n",
628
+ "Collecting starlette<0.38.0,>=0.37.2 (from fastapi)\n",
629
+ " Downloading starlette-0.37.2-py3-none-any.whl (71 kB)\n",
630
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m71.9/71.9 kB\u001b[0m \u001b[31m5.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
631
+ "\u001b[?25hRequirement already satisfied: pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0,>=1.7.4 in /usr/local/lib/python3.10/dist-packages (from fastapi) (2.7.4)\n",
632
+ "Requirement already satisfied: typing-extensions>=4.8.0 in /usr/local/lib/python3.10/dist-packages (from fastapi) (4.12.2)\n",
633
+ "Collecting fastapi-cli>=0.0.2 (from fastapi)\n",
634
+ " Downloading fastapi_cli-0.0.4-py3-none-any.whl (9.5 kB)\n",
635
+ "Collecting httpx>=0.23.0 (from fastapi)\n",
636
+ " Downloading httpx-0.27.0-py3-none-any.whl (75 kB)\n",
637
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m75.6/75.6 kB\u001b[0m \u001b[31m5.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
638
+ "\u001b[?25hRequirement already satisfied: jinja2>=2.11.2 in /usr/local/lib/python3.10/dist-packages (from fastapi) (3.1.4)\n",
639
+ "Collecting python-multipart>=0.0.7 (from fastapi)\n",
640
+ " Downloading python_multipart-0.0.9-py3-none-any.whl (22 kB)\n",
641
+ "Collecting ujson!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0,>=4.0.1 (from fastapi)\n",
642
+ " Downloading ujson-5.10.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (53 kB)\n",
643
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m53.6/53.6 kB\u001b[0m \u001b[31m5.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
644
+ "\u001b[?25hCollecting orjson>=3.2.1 (from fastapi)\n",
645
+ " Downloading orjson-3.10.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (144 kB)\n",
646
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m145.0/145.0 kB\u001b[0m \u001b[31m11.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
647
+ "\u001b[?25hCollecting email_validator>=2.0.0 (from fastapi)\n",
648
+ " Downloading email_validator-2.2.0-py3-none-any.whl (33 kB)\n",
649
+ "Requirement already satisfied: click>=7.0 in /usr/local/lib/python3.10/dist-packages (from uvicorn) (8.1.7)\n",
650
+ "Collecting h11>=0.8 (from uvicorn)\n",
651
+ " Downloading h11-0.14.0-py3-none-any.whl (58 kB)\n",
652
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m58.3/58.3 kB\u001b[0m \u001b[31m6.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
653
+ "\u001b[?25hRequirement already satisfied: PyYAML>=5.1 in /usr/local/lib/python3.10/dist-packages (from pyngrok) (6.0.1)\n",
654
+ "Collecting dnspython>=2.0.0 (from email_validator>=2.0.0->fastapi)\n",
655
+ " Downloading dnspython-2.6.1-py3-none-any.whl (307 kB)\n",
656
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m307.7/307.7 kB\u001b[0m \u001b[31m26.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
657
+ "\u001b[?25hRequirement already satisfied: idna>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from email_validator>=2.0.0->fastapi) (3.7)\n",
658
+ "Requirement already satisfied: typer>=0.12.3 in /usr/local/lib/python3.10/dist-packages (from fastapi-cli>=0.0.2->fastapi) (0.12.3)\n",
659
+ "Requirement already satisfied: anyio in /usr/local/lib/python3.10/dist-packages (from httpx>=0.23.0->fastapi) (3.7.1)\n",
660
+ "Requirement already satisfied: certifi in /usr/local/lib/python3.10/dist-packages (from httpx>=0.23.0->fastapi) (2024.6.2)\n",
661
+ "Collecting httpcore==1.* (from httpx>=0.23.0->fastapi)\n",
662
+ " Downloading httpcore-1.0.5-py3-none-any.whl (77 kB)\n",
663
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m77.9/77.9 kB\u001b[0m \u001b[31m8.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
664
+ "\u001b[?25hRequirement already satisfied: sniffio in /usr/local/lib/python3.10/dist-packages (from httpx>=0.23.0->fastapi) (1.3.1)\n",
665
+ "Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from jinja2>=2.11.2->fastapi) (2.1.5)\n",
666
+ "Requirement already satisfied: annotated-types>=0.4.0 in /usr/local/lib/python3.10/dist-packages (from pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0,>=1.7.4->fastapi) (0.7.0)\n",
667
+ "Requirement already satisfied: pydantic-core==2.18.4 in /usr/local/lib/python3.10/dist-packages (from pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0,>=1.7.4->fastapi) (2.18.4)\n",
668
+ "Collecting httptools>=0.5.0 (from uvicorn)\n",
669
+ " Downloading httptools-0.6.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (341 kB)\n",
670
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m341.4/341.4 kB\u001b[0m \u001b[31m26.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
671
+ "\u001b[?25hCollecting python-dotenv>=0.13 (from uvicorn)\n",
672
+ " Downloading python_dotenv-1.0.1-py3-none-any.whl (19 kB)\n",
673
+ "Collecting uvloop!=0.15.0,!=0.15.1,>=0.14.0 (from uvicorn)\n",
674
+ " Downloading uvloop-0.19.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.4 MB)\n",
675
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.4/3.4 MB\u001b[0m \u001b[31m50.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
676
+ "\u001b[?25hCollecting watchfiles>=0.13 (from uvicorn)\n",
677
+ " Downloading watchfiles-0.22.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB)\n",
678
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.2/1.2 MB\u001b[0m \u001b[31m38.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
679
+ "\u001b[?25hCollecting websockets>=10.4 (from uvicorn)\n",
680
+ " Downloading websockets-12.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (130 kB)\n",
681
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m130.2/130.2 kB\u001b[0m \u001b[31m14.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
682
+ "\u001b[?25hRequirement already satisfied: exceptiongroup in /usr/local/lib/python3.10/dist-packages (from anyio->httpx>=0.23.0->fastapi) (1.2.1)\n",
683
+ "Requirement already satisfied: shellingham>=1.3.0 in /usr/local/lib/python3.10/dist-packages (from typer>=0.12.3->fastapi-cli>=0.0.2->fastapi) (1.5.4)\n",
684
+ "Requirement already satisfied: rich>=10.11.0 in /usr/local/lib/python3.10/dist-packages (from typer>=0.12.3->fastapi-cli>=0.0.2->fastapi) (13.7.1)\n",
685
+ "Requirement already satisfied: markdown-it-py>=2.2.0 in /usr/local/lib/python3.10/dist-packages (from rich>=10.11.0->typer>=0.12.3->fastapi-cli>=0.0.2->fastapi) (3.0.0)\n",
686
+ "Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /usr/local/lib/python3.10/dist-packages (from rich>=10.11.0->typer>=0.12.3->fastapi-cli>=0.0.2->fastapi) (2.16.1)\n",
687
+ "Requirement already satisfied: mdurl~=0.1 in /usr/local/lib/python3.10/dist-packages (from markdown-it-py>=2.2.0->rich>=10.11.0->typer>=0.12.3->fastapi-cli>=0.0.2->fastapi) (0.1.2)\n",
688
+ "Installing collected packages: websockets, uvloop, ujson, python-multipart, python-dotenv, pyngrok, orjson, httptools, h11, dnspython, watchfiles, uvicorn, starlette, httpcore, email_validator, httpx, fastapi-cli, fastapi\n",
689
+ "Successfully installed dnspython-2.6.1 email_validator-2.2.0 fastapi-0.111.0 fastapi-cli-0.0.4 h11-0.14.0 httpcore-1.0.5 httptools-0.6.1 httpx-0.27.0 orjson-3.10.5 pyngrok-7.1.6 python-dotenv-1.0.1 python-multipart-0.0.9 starlette-0.37.2 ujson-5.10.0 uvicorn-0.30.1 uvloop-0.19.0 watchfiles-0.22.0 websockets-12.0\n"
690
+ ]
691
+ }
692
+ ]
693
+ },
694
+ {
695
+ "cell_type": "code",
696
+ "source": [
697
+ "from fastapi import FastAPI\n",
698
+ "\n",
699
+ "app = FastAPI()\n",
700
+ "\n",
701
+ "@app.get(\"/\")\n",
702
+ "def read_root():\n",
703
+ " return {\"message\": \"¡Hola desde FastAPI en Colab!\"}\n",
704
+ "\n"
705
+ ],
706
+ "metadata": {
707
+ "id": "NcJZKxYvuqd8"
708
+ },
709
+ "execution_count": 18,
710
+ "outputs": []
711
+ },
712
+ {
713
+ "cell_type": "code",
714
+ "source": [
715
+ "pip install fastapi uvicorn\n"
716
+ ],
717
+ "metadata": {
718
+ "colab": {
719
+ "base_uri": "https://localhost:8080/"
720
+ },
721
+ "id": "hLeGs7VCxnDw",
722
+ "outputId": "72181c58-e9c5-411a-9aae-539c321b32d2"
723
+ },
724
+ "execution_count": 25,
725
+ "outputs": [
726
+ {
727
+ "output_type": "stream",
728
+ "name": "stdout",
729
+ "text": [
730
+ "Requirement already satisfied: fastapi in /usr/local/lib/python3.10/dist-packages (0.111.0)\n",
731
+ "Requirement already satisfied: uvicorn in /usr/local/lib/python3.10/dist-packages (0.30.1)\n",
732
+ "Requirement already satisfied: starlette<0.38.0,>=0.37.2 in /usr/local/lib/python3.10/dist-packages (from fastapi) (0.37.2)\n",
733
+ "Requirement already satisfied: pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0,>=1.7.4 in /usr/local/lib/python3.10/dist-packages (from fastapi) (2.7.4)\n",
734
+ "Requirement already satisfied: typing-extensions>=4.8.0 in /usr/local/lib/python3.10/dist-packages (from fastapi) (4.12.2)\n",
735
+ "Requirement already satisfied: fastapi-cli>=0.0.2 in /usr/local/lib/python3.10/dist-packages (from fastapi) (0.0.4)\n",
736
+ "Requirement already satisfied: httpx>=0.23.0 in /usr/local/lib/python3.10/dist-packages (from fastapi) (0.27.0)\n",
737
+ "Requirement already satisfied: jinja2>=2.11.2 in /usr/local/lib/python3.10/dist-packages (from fastapi) (3.1.4)\n",
738
+ "Requirement already satisfied: python-multipart>=0.0.7 in /usr/local/lib/python3.10/dist-packages (from fastapi) (0.0.9)\n",
739
+ "Requirement already satisfied: ujson!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0,>=4.0.1 in /usr/local/lib/python3.10/dist-packages (from fastapi) (5.10.0)\n",
740
+ "Requirement already satisfied: orjson>=3.2.1 in /usr/local/lib/python3.10/dist-packages (from fastapi) (3.10.5)\n",
741
+ "Requirement already satisfied: email_validator>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from fastapi) (2.2.0)\n",
742
+ "Requirement already satisfied: click>=7.0 in /usr/local/lib/python3.10/dist-packages (from uvicorn) (8.1.7)\n",
743
+ "Requirement already satisfied: h11>=0.8 in /usr/local/lib/python3.10/dist-packages (from uvicorn) (0.14.0)\n",
744
+ "Requirement already satisfied: dnspython>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from email_validator>=2.0.0->fastapi) (2.6.1)\n",
745
+ "Requirement already satisfied: idna>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from email_validator>=2.0.0->fastapi) (3.7)\n",
746
+ "Requirement already satisfied: typer>=0.12.3 in /usr/local/lib/python3.10/dist-packages (from fastapi-cli>=0.0.2->fastapi) (0.12.3)\n",
747
+ "Requirement already satisfied: anyio in /usr/local/lib/python3.10/dist-packages (from httpx>=0.23.0->fastapi) (3.7.1)\n",
748
+ "Requirement already satisfied: certifi in /usr/local/lib/python3.10/dist-packages (from httpx>=0.23.0->fastapi) (2024.6.2)\n",
749
+ "Requirement already satisfied: httpcore==1.* in /usr/local/lib/python3.10/dist-packages (from httpx>=0.23.0->fastapi) (1.0.5)\n",
750
+ "Requirement already satisfied: sniffio in /usr/local/lib/python3.10/dist-packages (from httpx>=0.23.0->fastapi) (1.3.1)\n",
751
+ "Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from jinja2>=2.11.2->fastapi) (2.1.5)\n",
752
+ "Requirement already satisfied: annotated-types>=0.4.0 in /usr/local/lib/python3.10/dist-packages (from pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0,>=1.7.4->fastapi) (0.7.0)\n",
753
+ "Requirement already satisfied: pydantic-core==2.18.4 in /usr/local/lib/python3.10/dist-packages (from pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0,>=1.7.4->fastapi) (2.18.4)\n",
754
+ "Requirement already satisfied: httptools>=0.5.0 in /usr/local/lib/python3.10/dist-packages (from uvicorn) (0.6.1)\n",
755
+ "Requirement already satisfied: python-dotenv>=0.13 in /usr/local/lib/python3.10/dist-packages (from uvicorn) (1.0.1)\n",
756
+ "Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.10/dist-packages (from uvicorn) (6.0.1)\n",
757
+ "Requirement already satisfied: uvloop!=0.15.0,!=0.15.1,>=0.14.0 in /usr/local/lib/python3.10/dist-packages (from uvicorn) (0.19.0)\n",
758
+ "Requirement already satisfied: watchfiles>=0.13 in /usr/local/lib/python3.10/dist-packages (from uvicorn) (0.22.0)\n",
759
+ "Requirement already satisfied: websockets>=10.4 in /usr/local/lib/python3.10/dist-packages (from uvicorn) (12.0)\n",
760
+ "Requirement already satisfied: exceptiongroup in /usr/local/lib/python3.10/dist-packages (from anyio->httpx>=0.23.0->fastapi) (1.2.1)\n",
761
+ "Requirement already satisfied: shellingham>=1.3.0 in /usr/local/lib/python3.10/dist-packages (from typer>=0.12.3->fastapi-cli>=0.0.2->fastapi) (1.5.4)\n",
762
+ "Requirement already satisfied: rich>=10.11.0 in /usr/local/lib/python3.10/dist-packages (from typer>=0.12.3->fastapi-cli>=0.0.2->fastapi) (13.7.1)\n",
763
+ "Requirement already satisfied: markdown-it-py>=2.2.0 in /usr/local/lib/python3.10/dist-packages (from rich>=10.11.0->typer>=0.12.3->fastapi-cli>=0.0.2->fastapi) (3.0.0)\n",
764
+ "Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /usr/local/lib/python3.10/dist-packages (from rich>=10.11.0->typer>=0.12.3->fastapi-cli>=0.0.2->fastapi) (2.16.1)\n",
765
+ "Requirement already satisfied: mdurl~=0.1 in /usr/local/lib/python3.10/dist-packages (from markdown-it-py>=2.2.0->rich>=10.11.0->typer>=0.12.3->fastapi-cli>=0.0.2->fastapi) (0.1.2)\n"
766
+ ]
767
+ }
768
+ ]
769
+ },
770
+ {
771
+ "cell_type": "code",
772
+ "source": [
773
+ "!ngrok authtoken <ngrok config add-authtoken 2iUSusGlpcysV7kDQicaCdggsWp_2d9AxdM2Z6cComtKdbGZz>\n"
774
+ ],
775
+ "metadata": {
776
+ "colab": {
777
+ "base_uri": "https://localhost:8080/"
778
+ },
779
+ "id": "M_wKRYiTybVB",
780
+ "outputId": "d9ece4ad-7a27-46cc-cf47-36f2a6947570"
781
+ },
782
+ "execution_count": 30,
783
+ "outputs": [
784
+ {
785
+ "output_type": "stream",
786
+ "name": "stdout",
787
+ "text": [
788
+ "/bin/bash: -c: line 1: syntax error near unexpected token `newline'\n",
789
+ "/bin/bash: -c: line 1: `ngrok authtoken <ngrok config add-authtoken 2iUSusGlpcysV7kDQicaCdggsWp_2d9AxdM2Z6cComtKdbGZz>'\n"
790
+ ]
791
+ }
792
+ ]
793
+ },
794
+ {
795
+ "cell_type": "code",
796
+ "source": [
797
+ "# Crear el archivo app.py\n",
798
+ "with open('app.py', 'w') as f:\n",
799
+ " f.write(\"\"\"from fastapi import FastAPI\n",
800
+ "import pandas as pd\n",
801
+ "import joblib\n",
802
+ "\n",
803
+ "app = FastAPI()\n",
804
+ "\n",
805
+ "# Cargar el modelo entrenado\n",
806
+ "model = joblib.load(\"model.joblib\")\n",
807
+ "\n",
808
+ "@app.post(\"/predict\")\n",
809
+ "def predict(data: dict):\n",
810
+ " df = pd.DataFrame([data])\n",
811
+ " df = pd.get_dummies(df)\n",
812
+ " prediction = model.predict(df)\n",
813
+ " return {\"prediction\": prediction[0]}\n",
814
+ "\"\"\")\n"
815
+ ],
816
+ "metadata": {
817
+ "id": "ZF3UjAHN2zdT"
818
+ },
819
+ "execution_count": 35,
820
+ "outputs": []
821
+ },
822
+ {
823
+ "cell_type": "code",
824
+ "source": [
825
+ "!git clone https://huggingface.co/spaces/AniaAri/pregunta05.git\n",
826
+ "\n"
827
+ ],
828
+ "metadata": {
829
+ "colab": {
830
+ "base_uri": "https://localhost:8080/"
831
+ },
832
+ "id": "g2MxXkuS2930",
833
+ "outputId": "3e95d54f-cbca-4df3-a510-c92d3f8b0e89"
834
+ },
835
+ "execution_count": 38,
836
+ "outputs": [
837
+ {
838
+ "output_type": "stream",
839
+ "name": "stdout",
840
+ "text": [
841
+ "Cloning into 'pregunta05'...\n",
842
+ "remote: Enumerating objects: 4, done.\u001b[K\n",
843
+ "remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 4 (from 1)\u001b[K\n",
844
+ "Unpacking objects: 100% (4/4), 1.26 KiB | 647.00 KiB/s, done.\n"
845
+ ]
846
+ }
847
+ ]
848
+ },
849
+ {
850
+ "cell_type": "code",
851
+ "source": [
852
+ "%cd pregunta05\n"
853
+ ],
854
+ "metadata": {
855
+ "colab": {
856
+ "base_uri": "https://localhost:8080/"
857
+ },
858
+ "id": "M_ywqXi85NaE",
859
+ "outputId": "a6da64d5-5e4f-4d2e-92dd-ee6a415a5672"
860
+ },
861
+ "execution_count": 39,
862
+ "outputs": [
863
+ {
864
+ "output_type": "stream",
865
+ "name": "stdout",
866
+ "text": [
867
+ "/content/pregunta05\n"
868
+ ]
869
+ }
870
+ ]
871
+ },
872
+ {
873
+ "cell_type": "code",
874
+ "source": [
875
+ "# Crear el archivo requirements.txt\n",
876
+ "with open('requirements.txt', 'w') as f:\n",
877
+ " f.write(\"\"\"pandas\n",
878
+ "scikit-learn\n",
879
+ "joblib\n",
880
+ "fastapi\n",
881
+ "uvicorn\"\"\")\n",
882
+ "\n",
883
+ "# Crear el archivo app.py\n",
884
+ "with open('app.py', 'w') as f:\n",
885
+ " f.write(\"\"\"from fastapi import FastAPI\n",
886
+ "import pandas as pd\n",
887
+ "import joblib\n",
888
+ "\n",
889
+ "app = FastAPI()\n",
890
+ "\n",
891
+ "# Cargar el modelo entrenado\n",
892
+ "model = joblib.load(\"model.joblib\")\n",
893
+ "\n",
894
+ "@app.post(\"/predict\")\n",
895
+ "def predict(data: dict):\n",
896
+ " df = pd.DataFrame([data])\n",
897
+ " df = pd.get_dummies(df)\n",
898
+ " prediction = model.predict(df)\n",
899
+ " return {\"prediction\": prediction[0]}\n",
900
+ "\"\"\")\n",
901
+ "\n",
902
+ "# Guardar el archivo del modelo\n",
903
+ "import joblib\n",
904
+ "joblib.dump(clf, 'model.joblib')\n"
905
+ ],
906
+ "metadata": {
907
+ "colab": {
908
+ "base_uri": "https://localhost:8080/"
909
+ },
910
+ "id": "o_ATIr9W5RmS",
911
+ "outputId": "1581821e-2ff2-4011-a3ad-ac074c075965"
912
+ },
913
+ "execution_count": 40,
914
+ "outputs": [
915
+ {
916
+ "output_type": "execute_result",
917
+ "data": {
918
+ "text/plain": [
919
+ "['model.joblib']"
920
+ ]
921
+ },
922
+ "metadata": {},
923
+ "execution_count": 40
924
+ }
925
+ ]
926
+ },
927
+ {
928
+ "cell_type": "code",
929
+ "source": [
930
+ "!git add .\n",
931
+ "!git commit -m \"Initial commit\"\n",
932
+ "!git push\n"
933
+ ],
934
+ "metadata": {
935
+ "colab": {
936
+ "base_uri": "https://localhost:8080/"
937
+ },
938
+ "id": "XBAHUkKU5VE5",
939
+ "outputId": "e04849db-8438-407c-9e3c-cd9aba8c8760"
940
+ },
941
+ "execution_count": 41,
942
+ "outputs": [
943
+ {
944
+ "output_type": "stream",
945
+ "name": "stdout",
946
+ "text": [
947
+ "Author identity unknown\n",
948
+ "\n",
949
+ "*** Please tell me who you are.\n",
950
+ "\n",
951
+ "Run\n",
952
+ "\n",
953
+ " git config --global user.email \"you@example.com\"\n",
954
+ " git config --global user.name \"Your Name\"\n",
955
+ "\n",
956
+ "to set your account's default identity.\n",
957
+ "Omit --global to set the identity only in this repository.\n",
958
+ "\n",
959
+ "fatal: unable to auto-detect email address (got 'root@9f9795763e92.(none)')\n",
960
+ "fatal: could not read Username for 'https://huggingface.co': No such device or address\n"
961
+ ]
962
+ }
963
+ ]
964
+ },
965
+ {
966
+ "cell_type": "code",
967
+ "source": [
968
+ "!git config --global user.email \"anniea030204@gmail.com\"\n",
969
+ "!git config --global user.name \"AniaAri\"\n"
970
+ ],
971
+ "metadata": {
972
+ "id": "tygINiaR5tEJ"
973
+ },
974
+ "execution_count": 42,
975
+ "outputs": []
976
+ }
977
+ ]
978
+ }
app.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastapi import FastAPI
2
+ import pandas as pd
3
+ import joblib
4
+
5
+ app = FastAPI()
6
+
7
+ # Cargar el modelo entrenado
8
+ model = joblib.load("model.joblib")
9
+
10
+ @app.post("/predict")
11
+ def predict(data: dict):
12
+ df = pd.DataFrame([data])
13
+ df = pd.get_dummies(df)
14
+ prediction = model.predict(df)
15
+ return {"prediction": prediction[0]}
model (1).joblib ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:428f09ce603d4633bdd3f50ca0c24e43c265b03d6d47f84eed395add2250fee0
3
+ size 57449
requirements (3).txt ADDED
@@ -0,0 +1,488 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ absl-py==1.4.0
2
+ aiohttp==3.9.5
3
+ aiosignal==1.3.1
4
+ alabaster==0.7.16
5
+ albumentations==1.3.1
6
+ altair==4.2.2
7
+ annotated-types==0.7.0
8
+ anyio==3.7.1
9
+ argon2-cffi==23.1.0
10
+ argon2-cffi-bindings==21.2.0
11
+ array_record==0.5.1
12
+ arviz==0.15.1
13
+ astropy==5.3.4
14
+ astunparse==1.6.3
15
+ async-timeout==4.0.3
16
+ atpublic==4.1.0
17
+ attrs==23.2.0
18
+ audioread==3.0.1
19
+ autograd==1.6.2
20
+ Babel==2.15.0
21
+ backcall==0.2.0
22
+ beautifulsoup4==4.12.3
23
+ bidict==0.23.1
24
+ bigframes==1.9.0
25
+ bleach==6.1.0
26
+ blinker==1.4
27
+ blis==0.7.11
28
+ blosc2==2.0.0
29
+ bokeh==3.3.4
30
+ bqplot==0.12.43
31
+ branca==0.7.2
32
+ build==1.2.1
33
+ CacheControl==0.14.0
34
+ cachetools==5.3.3
35
+ catalogue==2.0.10
36
+ certifi==2024.6.2
37
+ cffi==1.16.0
38
+ chardet==5.2.0
39
+ charset-normalizer==3.3.2
40
+ chex==0.1.86
41
+ click==8.1.7
42
+ click-plugins==1.1.1
43
+ cligj==0.7.2
44
+ cloudpathlib==0.18.1
45
+ cloudpickle==2.2.1
46
+ cmake==3.27.9
47
+ cmdstanpy==1.2.4
48
+ colorcet==3.1.0
49
+ colorlover==0.3.0
50
+ colour==0.1.5
51
+ community==1.0.0b1
52
+ confection==0.1.5
53
+ cons==0.4.6
54
+ contextlib2==21.6.0
55
+ contourpy==1.2.1
56
+ cryptography==42.0.8
57
+ cuda-python==12.2.1
58
+ cudf-cu12 @ https://pypi.nvidia.com/cudf-cu12/cudf_cu12-24.4.1-cp310-cp310-manylinux_2_28_x86_64.whl#sha256=57366e7ef09dc63e0b389aff20df6c37d91e2790065861ee31a4720149f5b694
59
+ cufflinks==0.17.3
60
+ cupy-cuda12x==12.2.0
61
+ cvxopt==1.3.2
62
+ cvxpy==1.3.4
63
+ cycler==0.12.1
64
+ cymem==2.0.8
65
+ Cython==3.0.10
66
+ dask==2023.8.1
67
+ datascience==0.17.6
68
+ db-dtypes==1.2.0
69
+ dbus-python==1.2.18
70
+ debugpy==1.6.6
71
+ decorator==4.4.2
72
+ defusedxml==0.7.1
73
+ distributed==2023.8.1
74
+ distro==1.7.0
75
+ dlib==19.24.4
76
+ dm-tree==0.1.8
77
+ docstring_parser==0.16
78
+ docutils==0.18.1
79
+ dopamine_rl==4.0.9
80
+ duckdb==0.10.3
81
+ earthengine-api==0.1.408
82
+ easydict==1.13
83
+ ecos==2.0.14
84
+ editdistance==0.6.2
85
+ eerepr==0.0.4
86
+ en-core-web-sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.7.1/en_core_web_sm-3.7.1-py3-none-any.whl#sha256=86cc141f63942d4b2c5fcee06630fd6f904788d2f0ab005cce45aadb8fb73889
87
+ entrypoints==0.4
88
+ et-xmlfile==1.1.0
89
+ etils==1.7.0
90
+ etuples==0.3.9
91
+ exceptiongroup==1.2.1
92
+ fastai==2.7.15
93
+ fastcore==1.5.46
94
+ fastdownload==0.0.7
95
+ fastjsonschema==2.20.0
96
+ fastprogress==1.0.3
97
+ fastrlock==0.8.2
98
+ filelock==3.15.3
99
+ fiona==1.9.6
100
+ firebase-admin==5.3.0
101
+ Flask==2.2.5
102
+ flatbuffers==24.3.25
103
+ flax==0.8.4
104
+ folium==0.14.0
105
+ fonttools==4.53.0
106
+ frozendict==2.4.4
107
+ frozenlist==1.4.1
108
+ fsspec==2023.6.0
109
+ future==0.18.3
110
+ gast==0.5.4
111
+ gcsfs==2023.6.0
112
+ GDAL==3.6.4
113
+ gdown==5.1.0
114
+ geemap==0.32.1
115
+ gensim==4.3.2
116
+ geocoder==1.38.1
117
+ geographiclib==2.0
118
+ geopandas==0.13.2
119
+ geopy==2.3.0
120
+ gin-config==0.5.0
121
+ glob2==0.7
122
+ google==2.0.3
123
+ google-ai-generativelanguage==0.6.4
124
+ google-api-core==2.11.1
125
+ google-api-python-client==2.84.0
126
+ google-auth==2.27.0
127
+ google-auth-httplib2==0.1.1
128
+ google-auth-oauthlib==1.2.0
129
+ google-cloud-aiplatform==1.56.0
130
+ google-cloud-bigquery==3.21.0
131
+ google-cloud-bigquery-connection==1.12.1
132
+ google-cloud-bigquery-storage==2.25.0
133
+ google-cloud-core==2.3.3
134
+ google-cloud-datastore==2.15.2
135
+ google-cloud-firestore==2.11.1
136
+ google-cloud-functions==1.13.3
137
+ google-cloud-iam==2.15.0
138
+ google-cloud-language==2.13.3
139
+ google-cloud-resource-manager==1.12.3
140
+ google-cloud-storage==2.8.0
141
+ google-cloud-translate==3.11.3
142
+ google-colab @ file:///colabtools/dist/google-colab-1.0.0.tar.gz#sha256=4b82ee85a233a3034fc34bde479ecda74a4fce0b408178f732d12a0161bc0de8
143
+ google-crc32c==1.5.0
144
+ google-generativeai==0.5.4
145
+ google-pasta==0.2.0
146
+ google-resumable-media==2.7.1
147
+ googleapis-common-protos==1.63.1
148
+ googledrivedownloader==0.4
149
+ graphviz==0.20.3
150
+ greenlet==3.0.3
151
+ grpc-google-iam-v1==0.13.0
152
+ grpcio==1.64.1
153
+ grpcio-status==1.48.2
154
+ gspread==6.0.2
155
+ gspread-dataframe==3.3.1
156
+ gym==0.25.2
157
+ gym-notices==0.0.8
158
+ h5netcdf==1.3.0
159
+ h5py==3.9.0
160
+ holidays==0.51
161
+ holoviews==1.17.1
162
+ html5lib==1.1
163
+ httpimport==1.3.1
164
+ httplib2==0.22.0
165
+ huggingface-hub==0.23.4
166
+ humanize==4.7.0
167
+ hyperopt==0.2.7
168
+ ibis-framework==8.0.0
169
+ idna==3.7
170
+ imageio==2.31.6
171
+ imageio-ffmpeg==0.5.1
172
+ imagesize==1.4.1
173
+ imbalanced-learn==0.10.1
174
+ imgaug==0.4.0
175
+ immutabledict==4.2.0
176
+ importlib_metadata==7.2.0
177
+ importlib_resources==6.4.0
178
+ imutils==0.5.4
179
+ inflect==7.0.0
180
+ iniconfig==2.0.0
181
+ intel-openmp==2023.2.4
182
+ ipyevents==2.0.2
183
+ ipyfilechooser==0.6.0
184
+ ipykernel==5.5.6
185
+ ipyleaflet==0.18.2
186
+ ipyparallel==8.8.0
187
+ ipython==7.34.0
188
+ ipython-genutils==0.2.0
189
+ ipython-sql==0.5.0
190
+ ipytree==0.2.2
191
+ ipywidgets==7.7.1
192
+ itsdangerous==2.2.0
193
+ jax==0.4.26
194
+ jaxlib @ https://storage.googleapis.com/jax-releases/cuda12/jaxlib-0.4.26+cuda12.cudnn89-cp310-cp310-manylinux2014_x86_64.whl#sha256=813cf1fe3e7ca4dbf5327d6e7b4fc8521e92d8bba073ee645ae0d5d036a25750
195
+ jeepney==0.7.1
196
+ jellyfish==1.0.4
197
+ jieba==0.42.1
198
+ Jinja2==3.1.4
199
+ joblib==1.4.2
200
+ jsonpickle==3.2.2
201
+ jsonschema==4.19.2
202
+ jsonschema-specifications==2023.12.1
203
+ jupyter-client==6.1.12
204
+ jupyter-console==6.1.0
205
+ jupyter-server==1.24.0
206
+ jupyter_core==5.7.2
207
+ jupyterlab_pygments==0.3.0
208
+ jupyterlab_widgets==3.0.11
209
+ kaggle==1.6.14
210
+ kagglehub==0.2.5
211
+ keras==2.15.0
212
+ keyring==23.5.0
213
+ kiwisolver==1.4.5
214
+ langcodes==3.4.0
215
+ language_data==1.2.0
216
+ launchpadlib==1.10.16
217
+ lazr.restfulclient==0.14.4
218
+ lazr.uri==1.0.6
219
+ lazy_loader==0.4
220
+ libclang==18.1.1
221
+ librosa==0.10.2.post1
222
+ lightgbm==4.1.0
223
+ linkify-it-py==2.0.3
224
+ llvmlite==0.41.1
225
+ locket==1.0.0
226
+ logical-unification==0.4.6
227
+ lxml==4.9.4
228
+ malloy==2023.1067
229
+ marisa-trie==1.2.0
230
+ Markdown==3.6
231
+ markdown-it-py==3.0.0
232
+ MarkupSafe==2.1.5
233
+ matplotlib==3.7.1
234
+ matplotlib-inline==0.1.7
235
+ matplotlib-venn==0.11.10
236
+ mdit-py-plugins==0.4.1
237
+ mdurl==0.1.2
238
+ miniKanren==1.0.3
239
+ missingno==0.5.2
240
+ mistune==0.8.4
241
+ mizani==0.9.3
242
+ mkl==2023.2.0
243
+ ml-dtypes==0.2.0
244
+ mlxtend==0.22.0
245
+ more-itertools==10.1.0
246
+ moviepy==1.0.3
247
+ mpmath==1.3.0
248
+ msgpack==1.0.8
249
+ multidict==6.0.5
250
+ multipledispatch==1.0.0
251
+ multitasking==0.0.11
252
+ murmurhash==1.0.10
253
+ music21==9.1.0
254
+ natsort==8.4.0
255
+ nbclassic==1.1.0
256
+ nbclient==0.10.0
257
+ nbconvert==6.5.4
258
+ nbformat==5.10.4
259
+ nest-asyncio==1.6.0
260
+ networkx==3.3
261
+ nibabel==4.0.2
262
+ nltk==3.8.1
263
+ notebook==6.5.5
264
+ notebook_shim==0.2.4
265
+ numba==0.58.1
266
+ numexpr==2.10.1
267
+ numpy==1.25.2
268
+ nvtx==0.2.10
269
+ oauth2client==4.1.3
270
+ oauthlib==3.2.2
271
+ opencv-contrib-python==4.8.0.76
272
+ opencv-python==4.8.0.76
273
+ opencv-python-headless==4.10.0.84
274
+ openpyxl==3.1.4
275
+ opt-einsum==3.3.0
276
+ optax==0.2.2
277
+ orbax-checkpoint==0.4.4
278
+ osqp==0.6.2.post8
279
+ packaging==24.1
280
+ pandas==2.0.3
281
+ pandas-datareader==0.10.0
282
+ pandas-gbq==0.19.2
283
+ pandas-stubs==2.0.3.230814
284
+ pandocfilters==1.5.1
285
+ panel==1.3.8
286
+ param==2.1.0
287
+ parso==0.8.4
288
+ parsy==2.1
289
+ partd==1.4.2
290
+ pathlib==1.0.1
291
+ patsy==0.5.6
292
+ peewee==3.17.5
293
+ pexpect==4.9.0
294
+ pickleshare==0.7.5
295
+ Pillow==9.4.0
296
+ pip-tools==6.13.0
297
+ platformdirs==4.2.2
298
+ plotly==5.15.0
299
+ plotnine==0.12.4
300
+ pluggy==1.5.0
301
+ polars==0.20.2
302
+ pooch==1.8.2
303
+ portpicker==1.5.2
304
+ prefetch-generator==1.0.3
305
+ preshed==3.0.9
306
+ prettytable==3.10.0
307
+ proglog==0.1.10
308
+ progressbar2==4.2.0
309
+ prometheus_client==0.20.0
310
+ promise==2.3
311
+ prompt_toolkit==3.0.47
312
+ prophet==1.1.5
313
+ proto-plus==1.24.0
314
+ protobuf==3.20.3
315
+ psutil==5.9.5
316
+ psycopg2==2.9.9
317
+ ptyprocess==0.7.0
318
+ py-cpuinfo==9.0.0
319
+ py4j==0.10.9.7
320
+ pyarrow==14.0.2
321
+ pyarrow-hotfix==0.6
322
+ pyasn1==0.6.0
323
+ pyasn1_modules==0.4.0
324
+ pycocotools==2.0.8
325
+ pycparser==2.22
326
+ pydantic==2.7.4
327
+ pydantic_core==2.18.4
328
+ pydata-google-auth==1.8.2
329
+ pydot==1.4.2
330
+ pydot-ng==2.0.0
331
+ pydotplus==2.0.2
332
+ PyDrive==1.3.1
333
+ PyDrive2==1.6.3
334
+ pyerfa==2.0.1.4
335
+ pygame==2.5.2
336
+ Pygments==2.16.1
337
+ PyGObject==3.42.1
338
+ PyJWT==2.3.0
339
+ pymc==5.10.4
340
+ pymystem3==0.2.0
341
+ pynvjitlink-cu12==0.2.4
342
+ PyOpenGL==3.1.7
343
+ pyOpenSSL==24.1.0
344
+ pyparsing==3.1.2
345
+ pyperclip==1.9.0
346
+ pyproj==3.6.1
347
+ pyproject_hooks==1.1.0
348
+ pyshp==2.3.1
349
+ PySocks==1.7.1
350
+ pytensor==2.18.6
351
+ pytest==7.4.4
352
+ python-apt @ file:///backend-container/containers/python_apt-0.0.0-cp310-cp310-linux_x86_64.whl#sha256=b209c7165d6061963abe611492f8c91c3bcef4b7a6600f966bab58900c63fefa
353
+ python-box==7.2.0
354
+ python-dateutil==2.8.2
355
+ python-louvain==0.16
356
+ python-slugify==8.0.4
357
+ python-utils==3.8.2
358
+ pytz==2023.4
359
+ pyviz_comms==3.0.2
360
+ PyWavelets==1.6.0
361
+ PyYAML==6.0.1
362
+ pyzmq==24.0.1
363
+ qdldl==0.1.7.post3
364
+ qudida==0.0.4
365
+ ratelim==0.1.6
366
+ referencing==0.35.1
367
+ regex==2024.5.15
368
+ requests==2.31.0
369
+ requests-oauthlib==1.3.1
370
+ requirements-parser==0.9.0
371
+ rich==13.7.1
372
+ rmm-cu12==24.4.0
373
+ rpds-py==0.18.1
374
+ rpy2==3.4.2
375
+ rsa==4.9
376
+ safetensors==0.4.3
377
+ scikit-image==0.19.3
378
+ scikit-learn==1.2.2
379
+ scipy==1.11.4
380
+ scooby==0.10.0
381
+ scs==3.2.4.post3
382
+ seaborn==0.13.1
383
+ SecretStorage==3.3.1
384
+ Send2Trash==1.8.3
385
+ sentencepiece==0.1.99
386
+ shapely==2.0.4
387
+ shellingham==1.5.4
388
+ simple_parsing==0.1.5
389
+ six==1.16.0
390
+ sklearn-pandas==2.2.0
391
+ smart-open==7.0.4
392
+ sniffio==1.3.1
393
+ snowballstemmer==2.2.0
394
+ sortedcontainers==2.4.0
395
+ soundfile==0.12.1
396
+ soupsieve==2.5
397
+ soxr==0.3.7
398
+ spacy==3.7.5
399
+ spacy-legacy==3.0.12
400
+ spacy-loggers==1.0.5
401
+ Sphinx==5.0.2
402
+ sphinxcontrib-applehelp==1.0.8
403
+ sphinxcontrib-devhelp==1.0.6
404
+ sphinxcontrib-htmlhelp==2.0.5
405
+ sphinxcontrib-jsmath==1.0.1
406
+ sphinxcontrib-qthelp==1.0.7
407
+ sphinxcontrib-serializinghtml==1.1.10
408
+ SQLAlchemy==2.0.31
409
+ sqlglot==20.11.0
410
+ sqlparse==0.5.0
411
+ srsly==2.4.8
412
+ stanio==0.5.0
413
+ statsmodels==0.14.2
414
+ StrEnum==0.4.15
415
+ sympy==1.12.1
416
+ tables==3.8.0
417
+ tabulate==0.9.0
418
+ tbb==2021.13.0
419
+ tblib==3.0.0
420
+ tenacity==8.4.1
421
+ tensorboard==2.15.2
422
+ tensorboard-data-server==0.7.2
423
+ tensorflow @ https://storage.googleapis.com/colab-tf-builds-public-09h6ksrfwbb9g9xv/tensorflow-2.15.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl#sha256=a2ec79931350b378c1ef300ca836b52a55751acb71a433582508a07f0de57c42
424
+ tensorflow-datasets==4.9.6
425
+ tensorflow-estimator==2.15.0
426
+ tensorflow-gcs-config==2.15.0
427
+ tensorflow-hub==0.16.1
428
+ tensorflow-io-gcs-filesystem==0.37.0
429
+ tensorflow-metadata==1.15.0
430
+ tensorflow-probability==0.23.0
431
+ tensorstore==0.1.45
432
+ termcolor==2.4.0
433
+ terminado==0.18.1
434
+ text-unidecode==1.3
435
+ textblob==0.17.1
436
+ tf-slim==1.1.0
437
+ tf_keras==2.15.1
438
+ thinc==8.2.5
439
+ threadpoolctl==3.5.0
440
+ tifffile==2024.6.18
441
+ tinycss2==1.3.0
442
+ tokenizers==0.19.1
443
+ toml==0.10.2
444
+ tomli==2.0.1
445
+ toolz==0.12.1
446
+ torch @ https://download.pytorch.org/whl/cu121/torch-2.3.0%2Bcu121-cp310-cp310-linux_x86_64.whl#sha256=0a12aa9aa6bc442dff8823ac8b48d991fd0771562eaa38593f9c8196d65f7007
447
+ torchaudio @ https://download.pytorch.org/whl/cu121/torchaudio-2.3.0%2Bcu121-cp310-cp310-linux_x86_64.whl#sha256=38b49393f8c322dcaa29d19e5acbf5a0b1978cf1b719445ab670f1fb486e3aa6
448
+ torchsummary==1.5.1
449
+ torchtext==0.18.0
450
+ torchvision @ https://download.pytorch.org/whl/cu121/torchvision-0.18.0%2Bcu121-cp310-cp310-linux_x86_64.whl#sha256=13e1b48dc5ce41ccb8100ab3dd26fdf31d8f1e904ecf2865ac524493013d0df5
451
+ tornado==6.3.3
452
+ tqdm==4.66.4
453
+ traitlets==5.7.1
454
+ traittypes==0.2.1
455
+ transformers==4.41.2
456
+ triton==2.3.0
457
+ tweepy==4.14.0
458
+ typer==0.12.3
459
+ types-pytz==2024.1.0.20240417
460
+ types-setuptools==70.1.0.20240625
461
+ typing_extensions==4.12.2
462
+ tzdata==2024.1
463
+ tzlocal==5.2
464
+ uc-micro-py==1.0.3
465
+ uritemplate==4.1.1
466
+ urllib3==2.0.7
467
+ vega-datasets==0.9.0
468
+ wadllib==1.3.6
469
+ wasabi==1.1.3
470
+ wcwidth==0.2.13
471
+ weasel==0.4.1
472
+ webcolors==24.6.0
473
+ webencodings==0.5.1
474
+ websocket-client==1.8.0
475
+ Werkzeug==3.0.3
476
+ widgetsnbextension==3.6.6
477
+ wordcloud==1.9.3
478
+ wrapt==1.14.1
479
+ xarray==2023.7.0
480
+ xarray-einstats==0.7.0
481
+ xgboost==2.0.3
482
+ xlrd==2.0.1
483
+ xyzservices==2024.6.0
484
+ yarl==1.9.4
485
+ yellowbrick==1.5
486
+ yfinance==0.2.40
487
+ zict==3.0.0
488
+ zipp==3.19.2