|
10 | 10 | }, |
11 | 11 | { |
12 | 12 | "cell_type": "code", |
13 | | - "execution_count": 11, |
| 13 | + "execution_count": null, |
14 | 14 | "id": "9beb769c", |
15 | 15 | "metadata": {}, |
16 | 16 | "outputs": [ |
|
26 | 26 | } |
27 | 27 | ], |
28 | 28 | "source": [ |
29 | | - "import os \n", |
30 | | - "import sys\n", |
| 29 | + "import os\n", |
| 30 | + "import joblib\n", |
31 | 31 | "\n", |
32 | 32 | "os.getcwd()\n" |
33 | 33 | ] |
|
161 | 161 | "print(f\"\\nColumns: {df.columns.tolist()}\")\n", |
162 | 162 | "print(f\"\\nData Types:\\n{df.dtypes}\")\n", |
163 | 163 | "print(f\"\\nMissing Values:\\n{df.isnull().sum()}\")\n", |
164 | | - "print(f\"\\nFirst 5 rows:\")\n", |
| 164 | + "print(\"\\nFirst 5 rows:\")\n", |
165 | 165 | "print(df.head())\n", |
166 | 166 | "\n", |
167 | | - "print(f\"\\n=== BASIC STATISTICS ===\")\n", |
| 167 | + "print(\"\\n=== BASIC STATISTICS ===\")\n", |
168 | 168 | "print(df.describe())\n", |
169 | 169 | "\n", |
170 | | - "print(f\"\\n=== UNIQUE VALUES ===\")\n", |
| 170 | + "print(\"\\n=== UNIQUE VALUES ===\")\n", |
171 | 171 | "print(f\"Visitor types: {df['type_of_visitors'].unique()}\")\n", |
172 | 172 | "print(f\"Number of countries: {df['country_receiving'].nunique()}\")\n", |
173 | 173 | "print(f\"Years range: {df['year'].min()} to {df['year'].max()}\")\n" |
174 | 174 | ] |
175 | 175 | }, |
176 | | - { |
177 | | - "cell_type": "code", |
178 | | - "execution_count": 20, |
179 | | - "id": "acc8bd2f", |
180 | | - "metadata": {}, |
181 | | - "outputs": [ |
182 | | - { |
183 | | - "name": "stdout", |
184 | | - "output_type": "stream", |
185 | | - "text": [ |
186 | | - "<class 'pandas.core.frame.DataFrame'>\n", |
187 | | - "RangeIndex: 3025 entries, 0 to 3024\n", |
188 | | - "Data columns (total 6 columns):\n", |
189 | | - " # Column Non-Null Count Dtype \n", |
190 | | - "--- ------ -------------- ----- \n", |
191 | | - " 0 type_of_visitors 3025 non-null object \n", |
192 | | - " 1 country_receiving 3025 non-null object \n", |
193 | | - " 2 where_tourist_from 3025 non-null object \n", |
194 | | - " 3 year 3025 non-null int64 \n", |
195 | | - " 4 number_of_tourist 3025 non-null float64\n", |
196 | | - " 5 unit 3025 non-null object \n", |
197 | | - "dtypes: float64(1), int64(1), object(4)\n", |
198 | | - "memory usage: 141.9+ KB\n" |
199 | | - ] |
200 | | - }, |
201 | | - { |
202 | | - "data": { |
203 | | - "text/html": [ |
204 | | - "<div>\n", |
205 | | - "<style scoped>\n", |
206 | | - " .dataframe tbody tr th:only-of-type {\n", |
207 | | - " vertical-align: middle;\n", |
208 | | - " }\n", |
209 | | - "\n", |
210 | | - " .dataframe tbody tr th {\n", |
211 | | - " vertical-align: top;\n", |
212 | | - " }\n", |
213 | | - "\n", |
214 | | - " .dataframe thead th {\n", |
215 | | - " text-align: right;\n", |
216 | | - " }\n", |
217 | | - "</style>\n", |
218 | | - "<table border=\"1\" class=\"dataframe\">\n", |
219 | | - " <thead>\n", |
220 | | - " <tr style=\"text-align: right;\">\n", |
221 | | - " <th></th>\n", |
222 | | - " <th>type_of_visitors</th>\n", |
223 | | - " <th>country_receiving</th>\n", |
224 | | - " <th>where_tourist_from</th>\n", |
225 | | - " <th>year</th>\n", |
226 | | - " <th>number_of_tourist</th>\n", |
227 | | - " <th>unit</th>\n", |
228 | | - " </tr>\n", |
229 | | - " </thead>\n", |
230 | | - " <tbody>\n", |
231 | | - " <tr>\n", |
232 | | - " <th>0</th>\n", |
233 | | - " <td>excursionists</td>\n", |
234 | | - " <td>Antigua and Barbuda</td>\n", |
235 | | - " <td>World</td>\n", |
236 | | - " <td>1995</td>\n", |
237 | | - " <td>227.0</td>\n", |
238 | | - " <td>thousand trips</td>\n", |
239 | | - " </tr>\n", |
240 | | - " <tr>\n", |
241 | | - " <th>1</th>\n", |
242 | | - " <td>excursionists</td>\n", |
243 | | - " <td>Antigua and Barbuda</td>\n", |
244 | | - " <td>World</td>\n", |
245 | | - " <td>1996</td>\n", |
246 | | - " <td>270.0</td>\n", |
247 | | - " <td>thousand trips</td>\n", |
248 | | - " </tr>\n", |
249 | | - " <tr>\n", |
250 | | - " <th>2</th>\n", |
251 | | - " <td>excursionists</td>\n", |
252 | | - " <td>Antigua and Barbuda</td>\n", |
253 | | - " <td>World</td>\n", |
254 | | - " <td>1997</td>\n", |
255 | | - " <td>286.0</td>\n", |
256 | | - " <td>thousand trips</td>\n", |
257 | | - " </tr>\n", |
258 | | - " <tr>\n", |
259 | | - " <th>3</th>\n", |
260 | | - " <td>excursionists</td>\n", |
261 | | - " <td>Antigua and Barbuda</td>\n", |
262 | | - " <td>World</td>\n", |
263 | | - " <td>1998</td>\n", |
264 | | - " <td>336.0</td>\n", |
265 | | - " <td>thousand trips</td>\n", |
266 | | - " </tr>\n", |
267 | | - " <tr>\n", |
268 | | - " <th>4</th>\n", |
269 | | - " <td>excursionists</td>\n", |
270 | | - " <td>Antigua and Barbuda</td>\n", |
271 | | - " <td>World</td>\n", |
272 | | - " <td>1999</td>\n", |
273 | | - " <td>328.0</td>\n", |
274 | | - " <td>thousand trips</td>\n", |
275 | | - " </tr>\n", |
276 | | - " </tbody>\n", |
277 | | - "</table>\n", |
278 | | - "</div>" |
279 | | - ], |
280 | | - "text/plain": [ |
281 | | - " type_of_visitors country_receiving where_tourist_from year \\\n", |
282 | | - "0 excursionists Antigua and Barbuda World 1995 \n", |
283 | | - "1 excursionists Antigua and Barbuda World 1996 \n", |
284 | | - "2 excursionists Antigua and Barbuda World 1997 \n", |
285 | | - "3 excursionists Antigua and Barbuda World 1998 \n", |
286 | | - "4 excursionists Antigua and Barbuda World 1999 \n", |
287 | | - "\n", |
288 | | - " number_of_tourist unit \n", |
289 | | - "0 227.0 thousand trips \n", |
290 | | - "1 270.0 thousand trips \n", |
291 | | - "2 286.0 thousand trips \n", |
292 | | - "3 336.0 thousand trips \n", |
293 | | - "4 328.0 thousand trips " |
294 | | - ] |
295 | | - }, |
296 | | - "execution_count": 20, |
297 | | - "metadata": {}, |
298 | | - "output_type": "execute_result" |
299 | | - } |
300 | | - ], |
301 | | - "source": [ |
302 | | - "data.info()\n", |
303 | | - "\n", |
304 | | - "data.head()\n" |
305 | | - ] |
306 | | - }, |
307 | 176 | { |
308 | 177 | "cell_type": "markdown", |
309 | 178 | "id": "c7b16997", |
|
1086 | 955 | }, |
1087 | 956 | { |
1088 | 957 | "cell_type": "code", |
1089 | | - "execution_count": 30, |
| 958 | + "execution_count": null, |
1090 | 959 | "id": "fb356334", |
1091 | 960 | "metadata": {}, |
1092 | 961 | "outputs": [ |
|
1151 | 1020 | "# Step 10.2: Save the model (optional)\n", |
1152 | 1021 | "print(\"\\n=== SAVING MODEL ARTIFACTS ===\")\n", |
1153 | 1022 | "\n", |
1154 | | - "import joblib\n", |
1155 | | - "import os\n", |
| 1023 | + "\n", |
1156 | 1024 | "\n", |
1157 | 1025 | "# Create directory for model artifacts\n", |
1158 | 1026 | "os.makedirs(\"model_artifacts\", exist_ok=True)\n", |
|
0 commit comments