Search is not available for this dataset
text
stringlengths
1.78k
99.5M
id
stringlengths
22
24
file_path
stringclasses
48 values
{ "cells": [ { "cell_type": "markdown", "id": "ac8decf8", "metadata": { "papermill": { "duration": 0.008068, "end_time": "2023-07-05T10:02:09.482759", "exception": false, "start_time": "2023-07-05T10:02:09.474691", "status": "completed" }, "tags": [] }, "source": [ "### Introduction \n", "This notebook is created based on this research paper [**PubMed 200k RCT:\n", "a Dataset for Sequential Sentence Classification in Medical Abstracts**](https://arxiv.org/pdf/1710.06071.pdf)<br>\n", "\n", "The summary of this reseach paper is that, it converts medical research paper **Abstract's** each sentence to a category (background, objective, methods, results, conclusions)." ] }, { "cell_type": "markdown", "id": "d291922b", "metadata": { "papermill": { "duration": 0.007248, "end_time": "2023-07-05T10:02:09.497699", "exception": false, "start_time": "2023-07-05T10:02:09.490451", "status": "completed" }, "tags": [] }, "source": [ "### Getting the data\n", "Good thing is that data is publicly available." ] }, { "cell_type": "code", "execution_count": 1, "id": "de07fd70", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:02:09.514489Z", "iopub.status.busy": "2023-07-05T10:02:09.513819Z", "iopub.status.idle": "2023-07-05T10:02:23.774018Z", "shell.execute_reply": "2023-07-05T10:02:23.772878Z" }, "papermill": { "duration": 14.271209, "end_time": "2023-07-05T10:02:23.776395", "exception": false, "start_time": "2023-07-05T10:02:09.505186", "status": "completed" }, "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Cloning into 'pubmed-rct'...\r\n", "remote: Enumerating objects: 33, done.\u001b[K\r\n", "remote: Counting objects: 100% (8/8), done.\u001b[K\r\n", "remote: Compressing objects: 100% (3/3), done.\u001b[K\r\n", "remote: Total 33 (delta 5), reused 5 (delta 5), pack-reused 25\u001b[K\r\n", "Receiving objects: 100% (33/33), 177.08 MiB | 16.56 MiB/s, done.\r\n", "Resolving deltas: 100% (12/12), done.\r\n" ] } ], "source": [ "!git clone https://github.com/Franck-Dernoncourt/pubmed-rct.git" ] }, { "cell_type": "code", "execution_count": 2, "id": "5315ed11", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:02:23.797043Z", "iopub.status.busy": "2023-07-05T10:02:23.796732Z", "iopub.status.idle": "2023-07-05T10:02:24.729745Z", "shell.execute_reply": "2023-07-05T10:02:24.728613Z" }, "papermill": { "duration": 0.946121, "end_time": "2023-07-05T10:02:24.732384", "exception": false, "start_time": "2023-07-05T10:02:23.786263", "status": "completed" }, "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "PubMed_200k_RCT\r\n", "PubMed_200k_RCT_numbers_replaced_with_at_sign\r\n", "PubMed_20k_RCT\r\n", "PubMed_20k_RCT_numbers_replaced_with_at_sign\r\n", "README.md\r\n" ] } ], "source": [ "!ls pubmed-rct" ] }, { "cell_type": "code", "execution_count": 3, "id": "d73effac", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:02:24.756019Z", "iopub.status.busy": "2023-07-05T10:02:24.755698Z", "iopub.status.idle": "2023-07-05T10:02:25.686923Z", "shell.execute_reply": "2023-07-05T10:02:25.685789Z" }, "papermill": { "duration": 0.947089, "end_time": "2023-07-05T10:02:25.689400", "exception": false, "start_time": "2023-07-05T10:02:24.742311", "status": "completed" }, "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "dev.txt test.txt train.txt\r\n" ] } ], "source": [ "!ls /kaggle/working/pubmed-rct/PubMed_20k_RCT" ] }, { "cell_type": "markdown", "id": "2cc0995f", "metadata": { "papermill": { "duration": 0.009289, "end_time": "2023-07-05T10:02:25.708451", "exception": false, "start_time": "2023-07-05T10:02:25.699162", "status": "completed" }, "tags": [] }, "source": [ "`dev.txt` is validation set <br>\n", "`test.txt` is test set and<br>\n", "`train.txt` is train set" ] }, { "cell_type": "code", "execution_count": 4, "id": "40a587ca", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:02:25.729170Z", "iopub.status.busy": "2023-07-05T10:02:25.728814Z", "iopub.status.idle": "2023-07-05T10:02:25.733491Z", "shell.execute_reply": "2023-07-05T10:02:25.732586Z" }, "papermill": { "duration": 0.017221, "end_time": "2023-07-05T10:02:25.735404", "exception": false, "start_time": "2023-07-05T10:02:25.718183", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "data_dir = \"pubmed-rct/PubMed_20k_RCT_numbers_replaced_with_at_sign/\"" ] }, { "cell_type": "code", "execution_count": 5, "id": "5619ed9d", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:02:25.757450Z", "iopub.status.busy": "2023-07-05T10:02:25.756682Z", "iopub.status.idle": "2023-07-05T10:02:25.765282Z", "shell.execute_reply": "2023-07-05T10:02:25.764423Z" }, "papermill": { "duration": 0.02226, "end_time": "2023-07-05T10:02:25.767230", "exception": false, "start_time": "2023-07-05T10:02:25.744970", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "['pubmed-rct/PubMed_20k_RCT_numbers_replaced_with_at_sign/test.txt',\n", " 'pubmed-rct/PubMed_20k_RCT_numbers_replaced_with_at_sign/dev.txt',\n", " 'pubmed-rct/PubMed_20k_RCT_numbers_replaced_with_at_sign/train.txt']" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import os \n", "filenames = [data_dir + filename for filename in os.listdir(data_dir)]\n", "filenames" ] }, { "cell_type": "markdown", "id": "37356d02", "metadata": { "papermill": { "duration": 0.009467, "end_time": "2023-07-05T10:02:25.786554", "exception": false, "start_time": "2023-07-05T10:02:25.777087", "status": "completed" }, "tags": [] }, "source": [ "### Preprocessing data" ] }, { "cell_type": "code", "execution_count": 6, "id": "0699639e", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:02:25.812228Z", "iopub.status.busy": "2023-07-05T10:02:25.811870Z", "iopub.status.idle": "2023-07-05T10:02:25.816598Z", "shell.execute_reply": "2023-07-05T10:02:25.815675Z" }, "papermill": { "duration": 0.025465, "end_time": "2023-07-05T10:02:25.821490", "exception": false, "start_time": "2023-07-05T10:02:25.796025", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "def read_lines(filename):\n", " with open(filename) as file:\n", " return file.readlines()" ] }, { "cell_type": "code", "execution_count": 7, "id": "6bbad8c9", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:02:25.860341Z", "iopub.status.busy": "2023-07-05T10:02:25.859536Z", "iopub.status.idle": "2023-07-05T10:02:25.865768Z", "shell.execute_reply": "2023-07-05T10:02:25.864929Z" }, "papermill": { "duration": 0.031872, "end_time": "2023-07-05T10:02:25.869678", "exception": false, "start_time": "2023-07-05T10:02:25.837806", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "'pubmed-rct/PubMed_20k_RCT_numbers_replaced_with_at_sign/test.txt'" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "filenames[0]" ] }, { "cell_type": "code", "execution_count": 8, "id": "ec11ec9e", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:02:25.906309Z", "iopub.status.busy": "2023-07-05T10:02:25.905988Z", "iopub.status.idle": "2023-07-05T10:02:25.923173Z", "shell.execute_reply": "2023-07-05T10:02:25.922285Z" }, "papermill": { "duration": 0.039542, "end_time": "2023-07-05T10:02:25.925299", "exception": false, "start_time": "2023-07-05T10:02:25.885757", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "['###24290286\\n',\n", " 'BACKGROUND\\tIgE sensitization to Aspergillus fumigatus and a positive sputum fungal culture result are common in patients with refractory asthma .\\n',\n", " 'BACKGROUND\\tIt is not clear whether these patients would benefit from antifungal treatment .\\n',\n", " 'OBJECTIVE\\tWe sought to determine whether a @-month course of voriconazole improved asthma-related outcomes in patients with asthma who are IgE sensitized to A fumigatus .\\n',\n", " 'METHODS\\tAsthmatic patients who were IgE sensitized to A fumigatus with a history of at least @ severe exacerbations in the previous @ months were treated for @ months with @ mg of voriconazole twice daily , followed by observation for @ months , in a double-blind , placebo-controlled , randomized design .\\n',\n", " 'METHODS\\tPrimary outcomes were improvement in quality of life at the end of the treatment period and a reduction in the number of severe exacerbations over the @ months of the study .\\n',\n", " 'RESULTS\\tSixty-five patients were randomized .\\n',\n", " 'RESULTS\\tFifty-nine patients started treatment ( @ receiving voriconazole and @ receiving placebo ) and were included in an intention-to-treat analysis .\\n',\n", " 'RESULTS\\tFifty-six patients took the full @ months of medication .\\n',\n", " 'RESULTS\\tBetween the voriconazole and placebo groups , there were no significant differences in the number of severe exacerbations ( @ vs @ per patient per year , respectively ; mean difference , @ ; @ % CI , @-@ @ ) , quality of life ( change in Asthma Quality of Life Questionnaire score , @ vs @ ; mean difference between groups , @ ; @ % CI , -@ to -@ ) , or any of our secondary outcome measures .\\n']" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "train_file = read_lines(filename=filenames[1])\n", "train_file[:10]" ] }, { "cell_type": "code", "execution_count": 9, "id": "b933a3cf", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:02:25.946107Z", "iopub.status.busy": "2023-07-05T10:02:25.945573Z", "iopub.status.idle": "2023-07-05T10:02:25.952896Z", "shell.execute_reply": "2023-07-05T10:02:25.952095Z" }, "papermill": { "duration": 0.019791, "end_time": "2023-07-05T10:02:25.954833", "exception": false, "start_time": "2023-07-05T10:02:25.935042", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "def preprocess_text(filename):\n", " \n", " input_lines = read_lines(filename)\n", "\n", " abstract_lines = \"\"\n", " abstracts = []\n", "\n", " for line in input_lines:\n", " if line.startswith(\"###\"):\n", " abstract_lines = \"\"\n", "\n", " elif line.isspace():\n", " abstract_line_split = abstract_lines.splitlines()\n", "\n", " for abstract_line_number, abstract_line in enumerate(abstract_line_split):\n", " line_data = {}\n", " line_split = abstract_line.split(\"\\t\")\n", " line_data[\"target\"] = line_split[0]\n", " line_data[\"text\"] = line_split[1].lower()\n", " line_data[\"line_number\"] = abstract_line_number + 1\n", " line_data[\"total_lines\"] = len(abstract_line_split)\n", " abstracts.append(line_data)\n", " else:\n", " abstract_lines += line\n", " \n", " return abstracts" ] }, { "cell_type": "code", "execution_count": 10, "id": "88613785", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:02:25.976015Z", "iopub.status.busy": "2023-07-05T10:02:25.975300Z", "iopub.status.idle": "2023-07-05T10:02:26.064159Z", "shell.execute_reply": "2023-07-05T10:02:26.063073Z" }, "papermill": { "duration": 0.108098, "end_time": "2023-07-05T10:02:26.072864", "exception": false, "start_time": "2023-07-05T10:02:25.964766", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "[{'target': 'BACKGROUND',\n", " 'text': 'this study analyzed liver function abnormalities in heart failure patients admitted with severe acute decompensated heart failure ( adhf ) .',\n", " 'line_number': 1,\n", " 'total_lines': 9},\n", " {'target': 'RESULTS',\n", " 'text': 'a post hoc analysis was conducted with the use of data from the evaluation study of congestive heart failure and pulmonary artery catheterization effectiveness ( escape ) .',\n", " 'line_number': 2,\n", " 'total_lines': 9},\n", " {'target': 'RESULTS',\n", " 'text': 'liver function tests ( lfts ) were measured at @ time points from baseline , at discharge , and up to @ months follow-up .',\n", " 'line_number': 3,\n", " 'total_lines': 9},\n", " {'target': 'RESULTS',\n", " 'text': 'survival analyses were used to assess the association between admission model of end-stage liver disease excluding international normalized ratio ( meld-xi ) scores and patient outcome.there was a high prevalence of abnormal baseline ( admission ) lfts ( albumin @ % , aspartate transaminase @ % , alanine transaminase @ % , and total bilirubin @ % ) .',\n", " 'line_number': 4,\n", " 'total_lines': 9},\n", " {'target': 'RESULTS',\n", " 'text': \"the percentage of patients with abnormal lfts decreased significantly from baseline to @-months ' follow-up .\",\n", " 'line_number': 5,\n", " 'total_lines': 9},\n", " {'target': 'RESULTS',\n", " 'text': 'when mean hemodynamic profiles were compared in patients with abnormal versus normal lfts , elevated total bilirubin was associated with a significantly lower cardiac index ( @ vs @ ; p < @ ) and higher central venous pressure ( @ vs @ ; p = @ ) .',\n", " 'line_number': 6,\n", " 'total_lines': 9},\n", " {'target': 'RESULTS',\n", " 'text': 'multivariable analyses revealed that patients with elevated meld-xi scores ( @ ) had a @-fold ( hazard ratio@ @ , @ % confidence interval @-@ @ ) increased risk of death , rehospitalization , or transplantation after adjusting for baseline lfts , age , sex , race , body mass index , diabetes , and systolic blood pressure .',\n", " 'line_number': 7,\n", " 'total_lines': 9},\n", " {'target': 'CONCLUSIONS',\n", " 'text': 'abnormal lfts are common in the adhf population and are a dynamic marker of an impaired hemodynamic state .',\n", " 'line_number': 8,\n", " 'total_lines': 9},\n", " {'target': 'CONCLUSIONS',\n", " 'text': 'elevated meld-xi scores are associated with poor outcomes among patients admitted with adhf .',\n", " 'line_number': 9,\n", " 'total_lines': 9},\n", " {'target': 'BACKGROUND',\n", " 'text': 'minimally invasive endovascular aneurysm repair ( evar ) could be a surgical technique that improves outcome of patients with ruptured abdominal aortic aneurysm ( raaa ) .',\n", " 'line_number': 1,\n", " 'total_lines': 13}]" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "abstracts = preprocess_text(filename=filenames[0])\n", "abstracts[:10]" ] }, { "cell_type": "code", "execution_count": 11, "id": "912e48db", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:02:26.095665Z", "iopub.status.busy": "2023-07-05T10:02:26.095367Z", "iopub.status.idle": "2023-07-05T10:02:26.100922Z", "shell.execute_reply": "2023-07-05T10:02:26.100042Z" }, "papermill": { "duration": 0.018768, "end_time": "2023-07-05T10:02:26.103008", "exception": false, "start_time": "2023-07-05T10:02:26.084240", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "['pubmed-rct/PubMed_20k_RCT_numbers_replaced_with_at_sign/test.txt',\n", " 'pubmed-rct/PubMed_20k_RCT_numbers_replaced_with_at_sign/dev.txt',\n", " 'pubmed-rct/PubMed_20k_RCT_numbers_replaced_with_at_sign/train.txt']" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "filenames" ] }, { "cell_type": "markdown", "id": "e98d63e9", "metadata": { "papermill": { "duration": 0.009947, "end_time": "2023-07-05T10:02:26.123023", "exception": false, "start_time": "2023-07-05T10:02:26.113076", "status": "completed" }, "tags": [] }, "source": [ "### Visualizing Data" ] }, { "cell_type": "code", "execution_count": 12, "id": "53474260", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:02:26.144648Z", "iopub.status.busy": "2023-07-05T10:02:26.143862Z", "iopub.status.idle": "2023-07-05T10:02:27.154612Z", "shell.execute_reply": "2023-07-05T10:02:27.153475Z" }, "papermill": { "duration": 1.024367, "end_time": "2023-07-05T10:02:27.157368", "exception": false, "start_time": "2023-07-05T10:02:26.133001", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "train_samples = preprocess_text(filename=data_dir + \"train.txt\")\n", "dev_samples = preprocess_text(filename=filenames[1])\n", "test_samples = preprocess_text(filename=filenames[2])" ] }, { "cell_type": "code", "execution_count": 13, "id": "a4f162ee", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:02:27.179496Z", "iopub.status.busy": "2023-07-05T10:02:27.179177Z", "iopub.status.idle": "2023-07-05T10:02:27.184826Z", "shell.execute_reply": "2023-07-05T10:02:27.183960Z" }, "papermill": { "duration": 0.018966, "end_time": "2023-07-05T10:02:27.186892", "exception": false, "start_time": "2023-07-05T10:02:27.167926", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 14, "id": "71895652", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:02:27.208485Z", "iopub.status.busy": "2023-07-05T10:02:27.208207Z", "iopub.status.idle": "2023-07-05T10:02:27.879907Z", "shell.execute_reply": "2023-07-05T10:02:27.878941Z" }, "papermill": { "duration": 0.685192, "end_time": "2023-07-05T10:02:27.882397", "exception": false, "start_time": "2023-07-05T10:02:27.197205", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "train_df = pd.DataFrame(train_samples)\n", "dev_df = pd.DataFrame(dev_samples)\n", "test_df = pd.DataFrame(test_samples)" ] }, { "cell_type": "code", "execution_count": 15, "id": "ef42d924", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:02:27.905523Z", "iopub.status.busy": "2023-07-05T10:02:27.904804Z", "iopub.status.idle": "2023-07-05T10:02:27.925001Z", "shell.execute_reply": "2023-07-05T10:02:27.924038Z" }, "papermill": { "duration": 0.0342, "end_time": "2023-07-05T10:02:27.927022", "exception": false, "start_time": "2023-07-05T10:02:27.892822", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/html": [ "<div>\n", "<style scoped>\n", " .dataframe tbody tr th:only-of-type {\n", " vertical-align: middle;\n", " }\n", "\n", " .dataframe tbody tr th {\n", " vertical-align: top;\n", " }\n", "\n", " .dataframe thead th {\n", " text-align: right;\n", " }\n", "</style>\n", "<table border=\"1\" class=\"dataframe\">\n", " <thead>\n", " <tr style=\"text-align: right;\">\n", " <th></th>\n", " <th>target</th>\n", " <th>text</th>\n", " <th>line_number</th>\n", " <th>total_lines</th>\n", " </tr>\n", " </thead>\n", " <tbody>\n", " <tr>\n", " <th>0</th>\n", " <td>OBJECTIVE</td>\n", " <td>to investigate the efficacy of @ weeks of dail...</td>\n", " <td>1</td>\n", " <td>12</td>\n", " </tr>\n", " <tr>\n", " <th>1</th>\n", " <td>METHODS</td>\n", " <td>a total of @ patients with primary knee oa wer...</td>\n", " <td>2</td>\n", " <td>12</td>\n", " </tr>\n", " <tr>\n", " <th>2</th>\n", " <td>METHODS</td>\n", " <td>outcome measures included pain reduction and i...</td>\n", " <td>3</td>\n", " <td>12</td>\n", " </tr>\n", " <tr>\n", " <th>3</th>\n", " <td>METHODS</td>\n", " <td>pain was assessed using the visual analog pain...</td>\n", " <td>4</td>\n", " <td>12</td>\n", " </tr>\n", " <tr>\n", " <th>4</th>\n", " <td>METHODS</td>\n", " <td>secondary outcome measures included the wester...</td>\n", " <td>5</td>\n", " <td>12</td>\n", " </tr>\n", " <tr>\n", " <th>...</th>\n", " <td>...</td>\n", " <td>...</td>\n", " <td>...</td>\n", " <td>...</td>\n", " </tr>\n", " <tr>\n", " <th>180035</th>\n", " <td>RESULTS</td>\n", " <td>for the absolute change in percent atheroma vo...</td>\n", " <td>8</td>\n", " <td>12</td>\n", " </tr>\n", " <tr>\n", " <th>180036</th>\n", " <td>RESULTS</td>\n", " <td>for pav , a significantly greater percentage o...</td>\n", " <td>9</td>\n", " <td>12</td>\n", " </tr>\n", " <tr>\n", " <th>180037</th>\n", " <td>RESULTS</td>\n", " <td>both strategies had acceptable side effect pro...</td>\n", " <td>10</td>\n", " <td>12</td>\n", " </tr>\n", " <tr>\n", " <th>180038</th>\n", " <td>CONCLUSIONS</td>\n", " <td>compared with standard statin monotherapy , th...</td>\n", " <td>11</td>\n", " <td>12</td>\n", " </tr>\n", " <tr>\n", " <th>180039</th>\n", " <td>CONCLUSIONS</td>\n", " <td>( plaque regression with cholesterol absorptio...</td>\n", " <td>12</td>\n", " <td>12</td>\n", " </tr>\n", " </tbody>\n", "</table>\n", "<p>180040 rows × 4 columns</p>\n", "</div>" ], "text/plain": [ " target text \\\n", "0 OBJECTIVE to investigate the efficacy of @ weeks of dail... \n", "1 METHODS a total of @ patients with primary knee oa wer... \n", "2 METHODS outcome measures included pain reduction and i... \n", "3 METHODS pain was assessed using the visual analog pain... \n", "4 METHODS secondary outcome measures included the wester... \n", "... ... ... \n", "180035 RESULTS for the absolute change in percent atheroma vo... \n", "180036 RESULTS for pav , a significantly greater percentage o... \n", "180037 RESULTS both strategies had acceptable side effect pro... \n", "180038 CONCLUSIONS compared with standard statin monotherapy , th... \n", "180039 CONCLUSIONS ( plaque regression with cholesterol absorptio... \n", "\n", " line_number total_lines \n", "0 1 12 \n", "1 2 12 \n", "2 3 12 \n", "3 4 12 \n", "4 5 12 \n", "... ... ... \n", "180035 8 12 \n", "180036 9 12 \n", "180037 10 12 \n", "180038 11 12 \n", "180039 12 12 \n", "\n", "[180040 rows x 4 columns]" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "train_df" ] }, { "cell_type": "code", "execution_count": 16, "id": "722a355b", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:02:27.949389Z", "iopub.status.busy": "2023-07-05T10:02:27.948659Z", "iopub.status.idle": "2023-07-05T10:02:27.989013Z", "shell.execute_reply": "2023-07-05T10:02:27.988039Z" }, "papermill": { "duration": 0.053664, "end_time": "2023-07-05T10:02:27.991131", "exception": false, "start_time": "2023-07-05T10:02:27.937467", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "METHODS 59353\n", "RESULTS 57953\n", "CONCLUSIONS 27168\n", "BACKGROUND 21727\n", "OBJECTIVE 13839\n", "Name: target, dtype: int64" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "train_df[\"target\"].value_counts()" ] }, { "cell_type": "code", "execution_count": 17, "id": "4d67d711", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:02:28.013893Z", "iopub.status.busy": "2023-07-05T10:02:28.013087Z", "iopub.status.idle": "2023-07-05T10:02:28.335021Z", "shell.execute_reply": "2023-07-05T10:02:28.334020Z" }, "papermill": { "duration": 0.33593, "end_time": "2023-07-05T10:02:28.337425", "exception": false, "start_time": "2023-07-05T10:02:28.001495", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAk0AAAGeCAYAAACJuDVEAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA1cUlEQVR4nO3df3BU9b3/8deaH9skTbYhIVn2GjFXQy4xaGvoDQErKJCABPxxp+BNXaFiwIkSU5JBaf+Q9nrDT4Pemyli64A/qGktYu0AabDStCkEMG2qoUhtRRIkS1CWDaRhE5Pz/cPr+boJ4iEGdxOfj5kzw57Pe895nzNnJi8+e/aszTAMQwAAALigy4LdAAAAwFBAaAIAALCA0AQAAGABoQkAA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mUlBSdOXNGVVVV+t3vfqfq6urhcV0G74t7+CLMmzfPGDVqlBEREWG4XC7jjjvuMA4ePBjstoaE3bt3G5L6LfPnzzcM46OvdT/yyCOG0+k07Ha7ceONNxpvvvlmcJsOYRc6n//85z+N3NxcY+TIkUZERIRxxRVXGPPnzzeam5uD3XZIOt95lGRs2rTJrOH6tOazziXX5sW55557jNGjRxuRkZHGyJEjjalTpxo1NTXm+FC/Lm2GYRhfZEgDAAAYirinCQAAwAJCEwAAgAWEJgAAAAsITQAAABYQmgAAACwgNAEAAFhAaAIAALCA0AQAAGABoQkAAMACQhMAAIAFhCYAAAALCE0AAAAW/D9xwg5Km9GUBwAAAABJRU5ErkJggg==", "text/plain": [ "<Figure size 640x480 with 1 Axes>" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "train_df[\"total_lines\"].plot.hist();" ] }, { "cell_type": "code", "execution_count": 18, "id": "bbbffe72", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:02:28.364574Z", "iopub.status.busy": "2023-07-05T10:02:28.362745Z", "iopub.status.idle": "2023-07-05T10:02:28.371099Z", "shell.execute_reply": "2023-07-05T10:02:28.370120Z" }, "papermill": { "duration": 0.023662, "end_time": "2023-07-05T10:02:28.373278", "exception": false, "start_time": "2023-07-05T10:02:28.349616", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "(180040, 30212, 180040)" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(train_df[\"text\"]), len(dev_df[\"text\"]), len(test_df[\"text\"])" ] }, { "cell_type": "markdown", "id": "7eba6ef9", "metadata": { "papermill": { "duration": 0.013115, "end_time": "2023-07-05T10:02:28.399791", "exception": false, "start_time": "2023-07-05T10:02:28.386676", "status": "completed" }, "tags": [] }, "source": [ "### `OneHotEncoder`" ] }, { "cell_type": "code", "execution_count": 19, "id": "af9bc46a", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:02:28.426627Z", "iopub.status.busy": "2023-07-05T10:02:28.425868Z", "iopub.status.idle": "2023-07-05T10:02:29.676989Z", "shell.execute_reply": "2023-07-05T10:02:29.676119Z" }, "papermill": { "duration": 1.267016, "end_time": "2023-07-05T10:02:29.679600", "exception": false, "start_time": "2023-07-05T10:02:28.412584", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "from sklearn.preprocessing import OneHotEncoder" ] }, { "cell_type": "code", "execution_count": 20, "id": "6d707273", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:02:29.713658Z", "iopub.status.busy": "2023-07-05T10:02:29.712741Z", "iopub.status.idle": "2023-07-05T10:02:29.977236Z", "shell.execute_reply": "2023-07-05T10:02:29.976278Z" }, "papermill": { "duration": 0.284612, "end_time": "2023-07-05T10:02:29.980200", "exception": false, "start_time": "2023-07-05T10:02:29.695588", "status": "completed" }, "tags": [] }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/opt/conda/lib/python3.10/site-packages/sklearn/preprocessing/_encoders.py:868: FutureWarning: `sparse` was renamed to `sparse_output` in version 1.2 and will be removed in 1.4. `sparse_output` is ignored unless you leave `sparse` to its default value.\n", " warnings.warn(\n", "/opt/conda/lib/python3.10/site-packages/sklearn/preprocessing/_encoders.py:868: FutureWarning: `sparse` was renamed to `sparse_output` in version 1.2 and will be removed in 1.4. `sparse_output` is ignored unless you leave `sparse` to its default value.\n", " warnings.warn(\n", "/opt/conda/lib/python3.10/site-packages/sklearn/preprocessing/_encoders.py:868: FutureWarning: `sparse` was renamed to `sparse_output` in version 1.2 and will be removed in 1.4. `sparse_output` is ignored unless you leave `sparse` to its default value.\n", " warnings.warn(\n" ] } ], "source": [ "one_hot_encoder = OneHotEncoder(sparse=False)\n", "train_hot_encoder = one_hot_encoder.fit_transform(train_df[\"target\"].to_numpy().reshape(-1,1)) \n", "dev_hot_encoder = one_hot_encoder.fit_transform(dev_df[\"target\"].to_numpy().reshape(-1,1)) \n", "test_hot_encoder = one_hot_encoder.fit_transform(test_df[\"target\"].to_numpy().reshape(-1,1)) " ] }, { "cell_type": "code", "execution_count": 21, "id": "8c03a633", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:02:30.015905Z", "iopub.status.busy": "2023-07-05T10:02:30.015563Z", "iopub.status.idle": "2023-07-05T10:02:30.026233Z", "shell.execute_reply": "2023-07-05T10:02:30.025371Z" }, "papermill": { "duration": 0.030523, "end_time": "2023-07-05T10:02:30.028888", "exception": false, "start_time": "2023-07-05T10:02:29.998365", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "array([[0., 0., 0., 1., 0.],\n", " [0., 0., 1., 0., 0.],\n", " [0., 0., 1., 0., 0.],\n", " ...,\n", " [0., 0., 0., 0., 1.],\n", " [0., 1., 0., 0., 0.],\n", " [0., 1., 0., 0., 0.]])" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "train_hot_encoder" ] }, { "cell_type": "markdown", "id": "0ae79492", "metadata": { "papermill": { "duration": 0.015537, "end_time": "2023-07-05T10:02:30.060786", "exception": false, "start_time": "2023-07-05T10:02:30.045249", "status": "completed" }, "tags": [] }, "source": [ "### `LabelEncoder`" ] }, { "cell_type": "code", "execution_count": 22, "id": "4a254dd6", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:02:30.093389Z", "iopub.status.busy": "2023-07-05T10:02:30.093049Z", "iopub.status.idle": "2023-07-05T10:02:30.097099Z", "shell.execute_reply": "2023-07-05T10:02:30.096339Z" }, "papermill": { "duration": 0.024785, "end_time": "2023-07-05T10:02:30.101180", "exception": false, "start_time": "2023-07-05T10:02:30.076395", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "from sklearn.preprocessing import LabelEncoder" ] }, { "cell_type": "code", "execution_count": 23, "id": "fc8ecc5c", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:02:30.133597Z", "iopub.status.busy": "2023-07-05T10:02:30.133279Z", "iopub.status.idle": "2023-07-05T10:02:30.304660Z", "shell.execute_reply": "2023-07-05T10:02:30.303795Z" }, "papermill": { "duration": 0.195337, "end_time": "2023-07-05T10:02:30.312104", "exception": false, "start_time": "2023-07-05T10:02:30.116767", "status": "completed" }, "tags": [] }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/opt/conda/lib/python3.10/site-packages/sklearn/preprocessing/_label.py:116: DataConversionWarning: A column-vector y was passed when a 1d array was expected. Please change the shape of y to (n_samples, ), for example using ravel().\n", " y = column_or_1d(y, warn=True)\n", "/opt/conda/lib/python3.10/site-packages/sklearn/preprocessing/_label.py:116: DataConversionWarning: A column-vector y was passed when a 1d array was expected. Please change the shape of y to (n_samples, ), for example using ravel().\n", " y = column_or_1d(y, warn=True)\n", "/opt/conda/lib/python3.10/site-packages/sklearn/preprocessing/_label.py:116: DataConversionWarning: A column-vector y was passed when a 1d array was expected. Please change the shape of y to (n_samples, ), for example using ravel().\n", " y = column_or_1d(y, warn=True)\n" ] } ], "source": [ "label_encoder = LabelEncoder()\n", "train_label_encoder = label_encoder.fit_transform(train_df[\"target\"].to_numpy().reshape(-1,1))\n", "dev_label_encoder = label_encoder.fit_transform(dev_df[\"target\"].to_numpy().reshape(-1,1))\n", "test_label_encoder = label_encoder.fit_transform(test_df[\"target\"].to_numpy().reshape(-1,1))" ] }, { "cell_type": "code", "execution_count": 24, "id": "b9f4d501", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:02:30.345548Z", "iopub.status.busy": "2023-07-05T10:02:30.345243Z", "iopub.status.idle": "2023-07-05T10:02:30.351383Z", "shell.execute_reply": "2023-07-05T10:02:30.350499Z" }, "papermill": { "duration": 0.025247, "end_time": "2023-07-05T10:02:30.353372", "exception": false, "start_time": "2023-07-05T10:02:30.328125", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "(5,\n", " array(['BACKGROUND', 'CONCLUSIONS', 'METHODS', 'OBJECTIVE', 'RESULTS'],\n", " dtype=object))" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(label_encoder.classes_), label_encoder.classes_" ] }, { "cell_type": "code", "execution_count": null, "id": "4641f6e5", "metadata": { "papermill": { "duration": 0.011318, "end_time": "2023-07-05T10:02:30.376406", "exception": false, "start_time": "2023-07-05T10:02:30.365088", "status": "completed" }, "tags": [] }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.10" }, "papermill": { "default_parameters": {}, "duration": 32.304872, "end_time": "2023-07-05T10:02:31.207312", "environment_variables": {}, "exception": null, "input_path": "__notebook__.ipynb", "output_path": "__notebook__.ipynb", "parameters": {}, "start_time": "2023-07-05T10:01:58.902440", "version": "2.4.0" } }, "nbformat": 4, "nbformat_minor": 5 }
0135/795/135795928.ipynb
s3://data-agents/kaggle-outputs/sharded/031_00135.jsonl.gz
{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.10","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directoryq\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n for filename in filenames:\n print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2023-07-05T09:46:44.311522Z","iopub.execute_input":"2023-07-05T09:46:44.312100Z","iopub.status.idle":"2023-07-05T09:46:44.335717Z","shell.execute_reply.started":"2023-07-05T09:46:44.312049Z","shell.execute_reply":"2023-07-05T09:46:44.334772Z"},"trusted":true},"execution_count":17,"outputs":[{"name":"stdout","text":"/kaggle/input/flipkart-fasion-products-dataset/output.xlsx\n/kaggle/input/flipkart-fasion-products-dataset/flipkart_fashion_products_dataset.json\n","output_type":"stream"}]},{"cell_type":"markdown","source":"# Importing the datasets ","metadata":{}},{"cell_type":"code","source":"output_df = pd.read_excel('/kaggle/input/flipkart-fasion-products-dataset/output.xlsx')","metadata":{"execution":{"iopub.status.busy":"2023-07-05T09:46:44.337901Z","iopub.execute_input":"2023-07-05T09:46:44.338581Z","iopub.status.idle":"2023-07-05T09:47:00.240608Z","shell.execute_reply.started":"2023-07-05T09:46:44.338546Z","shell.execute_reply":"2023-07-05T09:47:00.239076Z"},"trusted":true},"execution_count":18,"outputs":[]},{"cell_type":"code","source":"output_df.head()","metadata":{"execution":{"iopub.status.busy":"2023-07-05T09:47:00.242646Z","iopub.execute_input":"2023-07-05T09:47:00.243244Z","iopub.status.idle":"2023-07-05T09:47:00.266569Z","shell.execute_reply.started":"2023-07-05T09:47:00.243194Z","shell.execute_reply":"2023-07-05T09:47:00.265314Z"},"trusted":true},"execution_count":19,"outputs":[{"execution_count":19,"output_type":"execute_result","data":{"text/plain":" Unnamed: 0 _id actual_price \\\n0 0 fa8e22d6-c0b6-5229-bb9e-ad52eda39a0a 2,999 \n1 1 893e6980-f2a0-531f-b056-34dd63fe912c 1,499 \n2 2 eb4c8eab-8206-59d0-bcd1-a724d96bf74f 2,999 \n3 3 3f3f97bb-5faf-57df-a9ff-1af24e2b1045 2,999 \n4 4 750caa3d-6264-53ca-8ce1-94118a1d8951 2,999 \n\n average_rating brand category crawled_at \\\n0 3.9 York Clothing and Accessories 02/10/2021, 20:11:51 \n1 3.9 York Clothing and Accessories 02/10/2021, 20:11:52 \n2 3.9 York Clothing and Accessories 02/10/2021, 20:11:52 \n3 3.9 York Clothing and Accessories 02/10/2021, 20:11:53 \n4 3.9 York Clothing and Accessories 02/10/2021, 20:11:53 \n\n description discount \\\n0 69% off Yorker trackpants made from 100% rich combed c... \n1 66% off Yorker trackpants made from 100% rich combed c... \n2 68% off Yorker trackpants made from 100% rich combed c... \n3 69% off Yorker trackpants made from 100% rich combed c... \n4 68% off Yorker trackpants made from 100% rich combed c... \n\n images out_of_stock \\\n0 ['https://rukminim1.flixcart.com/image/128/128... False \n1 ['https://rukminim1.flixcart.com/image/128/128... False \n2 ['https://rukminim1.flixcart.com/image/128/128... False \n3 ['https://rukminim1.flixcart.com/image/128/128... False \n4 ['https://rukminim1.flixcart.com/image/128/128... False \n\n pid product_details \\\n0 TKPFCZ9EA7H5FYZH [{'Style Code': '1005COMBO2'}, {'Closure': 'El... \n1 TKPFCZ9EJZV2UVRZ [{'Style Code': '1005BLUE'}, {'Closure': 'Draw... \n2 TKPFCZ9EHFCY5Z4Y [{'Style Code': '1005COMBO4'}, {'Closure': 'El... \n3 TKPFCZ9ESZZ7YWEF [{'Style Code': '1005COMBO3'}, {'Closure': 'El... \n4 TKPFCZ9EVXKBSUD7 [{'Style Code': '1005COMBO1'}, {'Closure': 'Dr... \n\n seller selling_price sub_category \\\n0 Shyam Enterprises 921 Bottomwear \n1 Shyam Enterprises 499 Bottomwear \n2 Shyam Enterprises 931 Bottomwear \n3 Shyam Enterprises 911 Bottomwear \n4 Shyam Enterprises 943 Bottomwear \n\n title \\\n0 Solid Men Multicolor Track Pants \n1 Solid Men Blue Track Pants \n2 Solid Men Multicolor Track Pants \n3 Solid Men Multicolor Track Pants \n4 Solid Men Brown, Grey Track Pants \n\n url \n0 https://www.flipkart.com/yorker-solid-men-mult... \n1 https://www.flipkart.com/yorker-solid-men-blue... \n2 https://www.flipkart.com/yorker-solid-men-mult... \n3 https://www.flipkart.com/yorker-solid-men-mult... \n4 https://www.flipkart.com/yorker-solid-men-brow... ","text/html":"<div>\n<style scoped>\n .dataframe tbody tr th:only-of-type {\n vertical-align: middle;\n }\n\n .dataframe tbody tr th {\n vertical-align: top;\n }\n\n .dataframe thead th {\n text-align: right;\n }\n</style>\n<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: right;\">\n <th></th>\n <th>Unnamed: 0</th>\n <th>_id</th>\n <th>actual_price</th>\n <th>average_rating</th>\n <th>brand</th>\n <th>category</th>\n <th>crawled_at</th>\n <th>description</th>\n <th>discount</th>\n <th>images</th>\n <th>out_of_stock</th>\n <th>pid</th>\n <th>product_details</th>\n <th>seller</th>\n <th>selling_price</th>\n <th>sub_category</th>\n <th>title</th>\n <th>url</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>0</td>\n <td>fa8e22d6-c0b6-5229-bb9e-ad52eda39a0a</td>\n <td>2,999</td>\n <td>3.9</td>\n <td>York</td>\n <td>Clothing and Accessories</td>\n <td>02/10/2021, 20:11:51</td>\n <td>69% off</td>\n <td>Yorker trackpants made from 100% rich combed c...</td>\n <td>['https://rukminim1.flixcart.com/image/128/128...</td>\n <td>False</td>\n <td>TKPFCZ9EA7H5FYZH</td>\n <td>[{'Style Code': '1005COMBO2'}, {'Closure': 'El...</td>\n <td>Shyam Enterprises</td>\n <td>921</td>\n <td>Bottomwear</td>\n <td>Solid Men Multicolor Track Pants</td>\n <td>https://www.flipkart.com/yorker-solid-men-mult...</td>\n </tr>\n <tr>\n <th>1</th>\n <td>1</td>\n <td>893e6980-f2a0-531f-b056-34dd63fe912c</td>\n <td>1,499</td>\n <td>3.9</td>\n <td>York</td>\n <td>Clothing and Accessories</td>\n <td>02/10/2021, 20:11:52</td>\n <td>66% off</td>\n <td>Yorker trackpants made from 100% rich combed c...</td>\n <td>['https://rukminim1.flixcart.com/image/128/128...</td>\n <td>False</td>\n <td>TKPFCZ9EJZV2UVRZ</td>\n <td>[{'Style Code': '1005BLUE'}, {'Closure': 'Draw...</td>\n <td>Shyam Enterprises</td>\n <td>499</td>\n <td>Bottomwear</td>\n <td>Solid Men Blue Track Pants</td>\n <td>https://www.flipkart.com/yorker-solid-men-blue...</td>\n </tr>\n <tr>\n <th>2</th>\n <td>2</td>\n <td>eb4c8eab-8206-59d0-bcd1-a724d96bf74f</td>\n <td>2,999</td>\n <td>3.9</td>\n <td>York</td>\n <td>Clothing and Accessories</td>\n <td>02/10/2021, 20:11:52</td>\n <td>68% off</td>\n <td>Yorker trackpants made from 100% rich combed c...</td>\n <td>['https://rukminim1.flixcart.com/image/128/128...</td>\n <td>False</td>\n <td>TKPFCZ9EHFCY5Z4Y</td>\n <td>[{'Style Code': '1005COMBO4'}, {'Closure': 'El...</td>\n <td>Shyam Enterprises</td>\n <td>931</td>\n <td>Bottomwear</td>\n <td>Solid Men Multicolor Track Pants</td>\n <td>https://www.flipkart.com/yorker-solid-men-mult...</td>\n </tr>\n <tr>\n <th>3</th>\n <td>3</td>\n <td>3f3f97bb-5faf-57df-a9ff-1af24e2b1045</td>\n <td>2,999</td>\n <td>3.9</td>\n <td>York</td>\n <td>Clothing and Accessories</td>\n <td>02/10/2021, 20:11:53</td>\n <td>69% off</td>\n <td>Yorker trackpants made from 100% rich combed c...</td>\n <td>['https://rukminim1.flixcart.com/image/128/128...</td>\n <td>False</td>\n <td>TKPFCZ9ESZZ7YWEF</td>\n <td>[{'Style Code': '1005COMBO3'}, {'Closure': 'El...</td>\n <td>Shyam Enterprises</td>\n <td>911</td>\n <td>Bottomwear</td>\n <td>Solid Men Multicolor Track Pants</td>\n <td>https://www.flipkart.com/yorker-solid-men-mult...</td>\n </tr>\n <tr>\n <th>4</th>\n <td>4</td>\n <td>750caa3d-6264-53ca-8ce1-94118a1d8951</td>\n <td>2,999</td>\n <td>3.9</td>\n <td>York</td>\n <td>Clothing and Accessories</td>\n <td>02/10/2021, 20:11:53</td>\n <td>68% off</td>\n <td>Yorker trackpants made from 100% rich combed c...</td>\n <td>['https://rukminim1.flixcart.com/image/128/128...</td>\n <td>False</td>\n <td>TKPFCZ9EVXKBSUD7</td>\n <td>[{'Style Code': '1005COMBO1'}, {'Closure': 'Dr...</td>\n <td>Shyam Enterprises</td>\n <td>943</td>\n <td>Bottomwear</td>\n <td>Solid Men Brown, Grey Track Pants</td>\n <td>https://www.flipkart.com/yorker-solid-men-brow...</td>\n </tr>\n </tbody>\n</table>\n</div>"},"metadata":{}}]},{"cell_type":"code","source":"output_df.shape","metadata":{"execution":{"iopub.status.busy":"2023-07-05T09:47:00.268735Z","iopub.execute_input":"2023-07-05T09:47:00.269176Z","iopub.status.idle":"2023-07-05T09:47:00.279631Z","shell.execute_reply.started":"2023-07-05T09:47:00.269138Z","shell.execute_reply":"2023-07-05T09:47:00.278481Z"},"trusted":true},"execution_count":20,"outputs":[{"execution_count":20,"output_type":"execute_result","data":{"text/plain":"(30000, 18)"},"metadata":{}}]},{"cell_type":"code","source":"fp_data = pd.read_json('/kaggle/input/flipkart-fasion-products-dataset/flipkart_fashion_products_dataset.json')\n\n# /kaggle/input/flipkart-fasion-products-dataset/flipkart_fashion_products_dataset.json","metadata":{"execution":{"iopub.status.busy":"2023-07-05T09:47:00.281095Z","iopub.execute_input":"2023-07-05T09:47:00.281496Z","iopub.status.idle":"2023-07-05T09:47:03.923280Z","shell.execute_reply.started":"2023-07-05T09:47:00.281462Z","shell.execute_reply":"2023-07-05T09:47:03.922169Z"},"trusted":true},"execution_count":21,"outputs":[]},{"cell_type":"code","source":"fp_data.head()","metadata":{"execution":{"iopub.status.busy":"2023-07-05T09:47:27.231551Z","iopub.execute_input":"2023-07-05T09:47:27.232281Z","iopub.status.idle":"2023-07-05T09:47:27.272387Z","shell.execute_reply.started":"2023-07-05T09:47:27.232241Z","shell.execute_reply":"2023-07-05T09:47:27.271075Z"},"trusted":true},"execution_count":23,"outputs":[{"execution_count":23,"output_type":"execute_result","data":{"text/plain":" _id actual_price average_rating brand \\\n0 fa8e22d6-c0b6-5229-bb9e-ad52eda39a0a 2,999 3.9 York \n1 893e6980-f2a0-531f-b056-34dd63fe912c 1,499 3.9 York \n2 eb4c8eab-8206-59d0-bcd1-a724d96bf74f 2,999 3.9 York \n3 3f3f97bb-5faf-57df-a9ff-1af24e2b1045 2,999 3.9 York \n4 750caa3d-6264-53ca-8ce1-94118a1d8951 2,999 3.9 York \n\n category crawled_at \\\n0 Clothing and Accessories 2021-02-10 20:11:51 \n1 Clothing and Accessories 2021-02-10 20:11:52 \n2 Clothing and Accessories 2021-02-10 20:11:52 \n3 Clothing and Accessories 2021-02-10 20:11:53 \n4 Clothing and Accessories 2021-02-10 20:11:53 \n\n description discount \\\n0 Yorker trackpants made from 100% rich combed c... 69% off \n1 Yorker trackpants made from 100% rich combed c... 66% off \n2 Yorker trackpants made from 100% rich combed c... 68% off \n3 Yorker trackpants made from 100% rich combed c... 69% off \n4 Yorker trackpants made from 100% rich combed c... 68% off \n\n images out_of_stock \\\n0 [https://rukminim1.flixcart.com/image/128/128/... False \n1 [https://rukminim1.flixcart.com/image/128/128/... False \n2 [https://rukminim1.flixcart.com/image/128/128/... False \n3 [https://rukminim1.flixcart.com/image/128/128/... False \n4 [https://rukminim1.flixcart.com/image/128/128/... False \n\n pid product_details \\\n0 TKPFCZ9EA7H5FYZH [{'Style Code': '1005COMBO2'}, {'Closure': 'El... \n1 TKPFCZ9EJZV2UVRZ [{'Style Code': '1005BLUE'}, {'Closure': 'Draw... \n2 TKPFCZ9EHFCY5Z4Y [{'Style Code': '1005COMBO4'}, {'Closure': 'El... \n3 TKPFCZ9ESZZ7YWEF [{'Style Code': '1005COMBO3'}, {'Closure': 'El... \n4 TKPFCZ9EVXKBSUD7 [{'Style Code': '1005COMBO1'}, {'Closure': 'Dr... \n\n seller selling_price sub_category \\\n0 Shyam Enterprises 921 Bottomwear \n1 Shyam Enterprises 499 Bottomwear \n2 Shyam Enterprises 931 Bottomwear \n3 Shyam Enterprises 911 Bottomwear \n4 Shyam Enterprises 943 Bottomwear \n\n title \\\n0 Solid Men Multicolor Track Pants \n1 Solid Men Blue Track Pants \n2 Solid Men Multicolor Track Pants \n3 Solid Men Multicolor Track Pants \n4 Solid Men Brown, Grey Track Pants \n\n url \n0 https://www.flipkart.com/yorker-solid-men-mult... \n1 https://www.flipkart.com/yorker-solid-men-blue... \n2 https://www.flipkart.com/yorker-solid-men-mult... \n3 https://www.flipkart.com/yorker-solid-men-mult... \n4 https://www.flipkart.com/yorker-solid-men-brow... ","text/html":"<div>\n<style scoped>\n .dataframe tbody tr th:only-of-type {\n vertical-align: middle;\n }\n\n .dataframe tbody tr th {\n vertical-align: top;\n }\n\n .dataframe thead th {\n text-align: right;\n }\n</style>\n<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: right;\">\n <th></th>\n <th>_id</th>\n <th>actual_price</th>\n <th>average_rating</th>\n <th>brand</th>\n <th>category</th>\n <th>crawled_at</th>\n <th>description</th>\n <th>discount</th>\n <th>images</th>\n <th>out_of_stock</th>\n <th>pid</th>\n <th>product_details</th>\n <th>seller</th>\n <th>selling_price</th>\n <th>sub_category</th>\n <th>title</th>\n <th>url</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>fa8e22d6-c0b6-5229-bb9e-ad52eda39a0a</td>\n <td>2,999</td>\n <td>3.9</td>\n <td>York</td>\n <td>Clothing and Accessories</td>\n <td>2021-02-10 20:11:51</td>\n <td>Yorker trackpants made from 100% rich combed c...</td>\n <td>69% off</td>\n <td>[https://rukminim1.flixcart.com/image/128/128/...</td>\n <td>False</td>\n <td>TKPFCZ9EA7H5FYZH</td>\n <td>[{'Style Code': '1005COMBO2'}, {'Closure': 'El...</td>\n <td>Shyam Enterprises</td>\n <td>921</td>\n <td>Bottomwear</td>\n <td>Solid Men Multicolor Track Pants</td>\n <td>https://www.flipkart.com/yorker-solid-men-mult...</td>\n </tr>\n <tr>\n <th>1</th>\n <td>893e6980-f2a0-531f-b056-34dd63fe912c</td>\n <td>1,499</td>\n <td>3.9</td>\n <td>York</td>\n <td>Clothing and Accessories</td>\n <td>2021-02-10 20:11:52</td>\n <td>Yorker trackpants made from 100% rich combed c...</td>\n <td>66% off</td>\n <td>[https://rukminim1.flixcart.com/image/128/128/...</td>\n <td>False</td>\n <td>TKPFCZ9EJZV2UVRZ</td>\n <td>[{'Style Code': '1005BLUE'}, {'Closure': 'Draw...</td>\n <td>Shyam Enterprises</td>\n <td>499</td>\n <td>Bottomwear</td>\n <td>Solid Men Blue Track Pants</td>\n <td>https://www.flipkart.com/yorker-solid-men-blue...</td>\n </tr>\n <tr>\n <th>2</th>\n <td>eb4c8eab-8206-59d0-bcd1-a724d96bf74f</td>\n <td>2,999</td>\n <td>3.9</td>\n <td>York</td>\n <td>Clothing and Accessories</td>\n <td>2021-02-10 20:11:52</td>\n <td>Yorker trackpants made from 100% rich combed c...</td>\n <td>68% off</td>\n <td>[https://rukminim1.flixcart.com/image/128/128/...</td>\n <td>False</td>\n <td>TKPFCZ9EHFCY5Z4Y</td>\n <td>[{'Style Code': '1005COMBO4'}, {'Closure': 'El...</td>\n <td>Shyam Enterprises</td>\n <td>931</td>\n <td>Bottomwear</td>\n <td>Solid Men Multicolor Track Pants</td>\n <td>https://www.flipkart.com/yorker-solid-men-mult...</td>\n </tr>\n <tr>\n <th>3</th>\n <td>3f3f97bb-5faf-57df-a9ff-1af24e2b1045</td>\n <td>2,999</td>\n <td>3.9</td>\n <td>York</td>\n <td>Clothing and Accessories</td>\n <td>2021-02-10 20:11:53</td>\n <td>Yorker trackpants made from 100% rich combed c...</td>\n <td>69% off</td>\n <td>[https://rukminim1.flixcart.com/image/128/128/...</td>\n <td>False</td>\n <td>TKPFCZ9ESZZ7YWEF</td>\n <td>[{'Style Code': '1005COMBO3'}, {'Closure': 'El...</td>\n <td>Shyam Enterprises</td>\n <td>911</td>\n <td>Bottomwear</td>\n <td>Solid Men Multicolor Track Pants</td>\n <td>https://www.flipkart.com/yorker-solid-men-mult...</td>\n </tr>\n <tr>\n <th>4</th>\n <td>750caa3d-6264-53ca-8ce1-94118a1d8951</td>\n <td>2,999</td>\n <td>3.9</td>\n <td>York</td>\n <td>Clothing and Accessories</td>\n <td>2021-02-10 20:11:53</td>\n <td>Yorker trackpants made from 100% rich combed c...</td>\n <td>68% off</td>\n <td>[https://rukminim1.flixcart.com/image/128/128/...</td>\n <td>False</td>\n <td>TKPFCZ9EVXKBSUD7</td>\n <td>[{'Style Code': '1005COMBO1'}, {'Closure': 'Dr...</td>\n <td>Shyam Enterprises</td>\n <td>943</td>\n <td>Bottomwear</td>\n <td>Solid Men Brown, Grey Track Pants</td>\n <td>https://www.flipkart.com/yorker-solid-men-brow...</td>\n </tr>\n </tbody>\n</table>\n</div>"},"metadata":{}}]},{"cell_type":"code","source":"## Both the datasets are the same and hence we will proceed with the output_df data ","metadata":{"execution":{"iopub.status.busy":"2023-07-05T09:47:03.925145Z","iopub.execute_input":"2023-07-05T09:47:03.925512Z","iopub.status.idle":"2023-07-05T09:47:03.930245Z","shell.execute_reply.started":"2023-07-05T09:47:03.925481Z","shell.execute_reply":"2023-07-05T09:47:03.929188Z"},"trusted":true},"execution_count":22,"outputs":[]},{"cell_type":"markdown","source":"# Exploring the dataset","metadata":{}},{"cell_type":"code","source":"output_df.columns","metadata":{"execution":{"iopub.status.busy":"2023-07-05T09:48:36.706000Z","iopub.execute_input":"2023-07-05T09:48:36.706391Z","iopub.status.idle":"2023-07-05T09:48:36.714146Z","shell.execute_reply.started":"2023-07-05T09:48:36.706361Z","shell.execute_reply":"2023-07-05T09:48:36.712911Z"},"trusted":true},"execution_count":24,"outputs":[{"execution_count":24,"output_type":"execute_result","data":{"text/plain":"Index(['Unnamed: 0', '_id', 'actual_price', 'average_rating', 'brand',\n 'category', 'crawled_at', 'description', 'discount', 'images',\n 'out_of_stock', 'pid', 'product_details', 'seller', 'selling_price',\n 'sub_category', 'title', 'url'],\n dtype='object')"},"metadata":{}}]},{"cell_type":"code","source":"output_df = output_df.drop(['Unnamed: 0', '_id','description','images' , 'url','pid'], axis = 1)\n# Looking into the data types\noutput_df.info()","metadata":{"execution":{"iopub.status.busy":"2023-07-05T09:53:50.201717Z","iopub.execute_input":"2023-07-05T09:53:50.202173Z","iopub.status.idle":"2023-07-05T09:53:50.275247Z","shell.execute_reply.started":"2023-07-05T09:53:50.202139Z","shell.execute_reply":"2023-07-05T09:53:50.274103Z"},"trusted":true},"execution_count":28,"outputs":[{"name":"stdout","text":"<class 'pandas.core.frame.DataFrame'>\nRangeIndex: 30000 entries, 0 to 29999\nData columns (total 12 columns):\n # Column Non-Null Count Dtype \n--- ------ -------------- ----- \n 0 actual_price 29137 non-null object \n 1 average_rating 27554 non-null float64\n 2 brand 27932 non-null object \n 3 category 30000 non-null object \n 4 crawled_at 30000 non-null object \n 5 discount 18017 non-null object \n 6 out_of_stock 30000 non-null bool \n 7 product_details 30000 non-null object \n 8 seller 28259 non-null object \n 9 selling_price 29998 non-null object \n 10 sub_category 30000 non-null object \n 11 title 30000 non-null object \ndtypes: bool(1), float64(1), object(10)\nmemory usage: 2.5+ MB\n","output_type":"stream"}]},{"cell_type":"code","source":"## Converting the data into appropriate type\noutput_df['actual_price'] = output_df['actual_price'].str.replace(',','')\noutput_df['selling_price'] = output_df['selling_price'].str.replace(',','')\noutput_df[['actual_price','selling_price']] = output_df[['actual_price','selling_price']].apply(pd.to_numeric)\n","metadata":{"execution":{"iopub.status.busy":"2023-07-05T10:01:20.492184Z","iopub.execute_input":"2023-07-05T10:01:20.492635Z","iopub.status.idle":"2023-07-05T10:01:20.533047Z","shell.execute_reply.started":"2023-07-05T10:01:20.492600Z","shell.execute_reply":"2023-07-05T10:01:20.531969Z"},"trusted":true},"execution_count":42,"outputs":[]},{"cell_type":"code","source":"","metadata":{"execution":{"iopub.status.busy":"2023-07-05T10:02:02.886032Z","iopub.execute_input":"2023-07-05T10:02:02.886497Z","iopub.status.idle":"2023-07-05T10:02:02.945530Z","shell.execute_reply.started":"2023-07-05T10:02:02.886460Z","shell.execute_reply":"2023-07-05T10:02:02.944492Z"},"trusted":true},"execution_count":45,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}
0135/796/135796051.ipynb
s3://data-agents/kaggle-outputs/sharded/031_00135.jsonl.gz
{ "cells": [ { "cell_type": "markdown", "id": "1bf4ba0a", "metadata": { "papermill": { "duration": 0.015185, "end_time": "2023-07-05T10:04:40.256905", "exception": false, "start_time": "2023-07-05T10:04:40.241720", "status": "completed" }, "tags": [] }, "source": [ "# Uber Drives Data Analysis With Python\n", "## Created And Done By \"Anubhav Kumar Gupta\"" ] }, { "cell_type": "code", "execution_count": 1, "id": "f43a1d6a", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:04:40.285426Z", "iopub.status.busy": "2023-07-05T10:04:40.284722Z", "iopub.status.idle": "2023-07-05T10:04:40.298588Z", "shell.execute_reply": "2023-07-05T10:04:40.297719Z" }, "papermill": { "duration": 0.030646, "end_time": "2023-07-05T10:04:40.300688", "exception": false, "start_time": "2023-07-05T10:04:40.270042", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/html": [ "<img src=\"https://www.careeraddict.com/uploads/article/61365/how-to-become-an-uber-driver.png\" width=\"500\" height=\"800\"/>" ], "text/plain": [ "<IPython.core.display.Image object>" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import IPython.display as dsp\n", "dsp.Image(url='https://www.careeraddict.com/uploads/article/61365/how-to-become-an-uber-driver.png',height=800,width=500)" ] }, { "cell_type": "code", "execution_count": 2, "id": "6581756c", "metadata": { "_cell_guid": "b1076dfc-b9ad-4769-8c92-a6c4dae69d19", "_uuid": "8f2839f25d086af736a60e9eeb907d3b93b6e0e5", "execution": { "iopub.execute_input": "2023-07-05T10:04:40.329520Z", "iopub.status.busy": "2023-07-05T10:04:40.329079Z", "iopub.status.idle": "2023-07-05T10:04:42.552348Z", "shell.execute_reply": "2023-07-05T10:04:42.551438Z" }, "papermill": { "duration": 2.240849, "end_time": "2023-07-05T10:04:42.555011", "exception": false, "start_time": "2023-07-05T10:04:40.314162", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd\n", "import matplotlib.pyplot as plt\n", "import seaborn as sns\n", "import plotly.express as px\n", "import datetime as dt" ] }, { "cell_type": "code", "execution_count": 3, "id": "a46da58a", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:04:42.582636Z", "iopub.status.busy": "2023-07-05T10:04:42.582279Z", "iopub.status.idle": "2023-07-05T10:04:42.607265Z", "shell.execute_reply": "2023-07-05T10:04:42.606456Z" }, "papermill": { "duration": 0.041357, "end_time": "2023-07-05T10:04:42.609645", "exception": false, "start_time": "2023-07-05T10:04:42.568288", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "df=pd.read_csv('/kaggle/input/uberdrives/My Uber Drives - 2016.csv')" ] }, { "cell_type": "code", "execution_count": 4, "id": "1e4ecc57", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:04:42.638210Z", "iopub.status.busy": "2023-07-05T10:04:42.637088Z", "iopub.status.idle": "2023-07-05T10:04:42.667788Z", "shell.execute_reply": "2023-07-05T10:04:42.666797Z" }, "papermill": { "duration": 0.047274, "end_time": "2023-07-05T10:04:42.670018", "exception": false, "start_time": "2023-07-05T10:04:42.622744", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/html": [ "<div>\n", "<style scoped>\n", " .dataframe tbody tr th:only-of-type {\n", " vertical-align: middle;\n", " }\n", "\n", " .dataframe tbody tr th {\n", " vertical-align: top;\n", " }\n", "\n", " .dataframe thead th {\n", " text-align: right;\n", " }\n", "</style>\n", "<table border=\"1\" class=\"dataframe\">\n", " <thead>\n", " <tr style=\"text-align: right;\">\n", " <th></th>\n", " <th>START_DATE*</th>\n", " <th>END_DATE*</th>\n", " <th>CATEGORY*</th>\n", " <th>START*</th>\n", " <th>STOP*</th>\n", " <th>MILES*</th>\n", " <th>PURPOSE*</th>\n", " </tr>\n", " </thead>\n", " <tbody>\n", " <tr>\n", " <th>0</th>\n", " <td>1/1/2016 21:11</td>\n", " <td>1/1/2016 21:17</td>\n", " <td>Business</td>\n", " <td>Fort Pierce</td>\n", " <td>Fort Pierce</td>\n", " <td>5.1</td>\n", " <td>Meal/Entertain</td>\n", " </tr>\n", " <tr>\n", " <th>1</th>\n", " <td>1/2/2016 1:25</td>\n", " <td>1/2/2016 1:37</td>\n", " <td>Business</td>\n", " <td>Fort Pierce</td>\n", " <td>Fort Pierce</td>\n", " <td>5.0</td>\n", " <td>NaN</td>\n", " </tr>\n", " <tr>\n", " <th>2</th>\n", " <td>1/2/2016 20:25</td>\n", " <td>1/2/2016 20:38</td>\n", " <td>Business</td>\n", " <td>Fort Pierce</td>\n", " <td>Fort Pierce</td>\n", " <td>4.8</td>\n", " <td>Errand/Supplies</td>\n", " </tr>\n", " <tr>\n", " <th>3</th>\n", " <td>1/5/2016 17:31</td>\n", " <td>1/5/2016 17:45</td>\n", " <td>Business</td>\n", " <td>Fort Pierce</td>\n", " <td>Fort Pierce</td>\n", " <td>4.7</td>\n", " <td>Meeting</td>\n", " </tr>\n", " <tr>\n", " <th>4</th>\n", " <td>1/6/2016 14:42</td>\n", " <td>1/6/2016 15:49</td>\n", " <td>Business</td>\n", " <td>Fort Pierce</td>\n", " <td>West Palm Beach</td>\n", " <td>63.7</td>\n", " <td>Customer Visit</td>\n", " </tr>\n", " </tbody>\n", "</table>\n", "</div>" ], "text/plain": [ " START_DATE* END_DATE* CATEGORY* START* STOP* \\\n", "0 1/1/2016 21:11 1/1/2016 21:17 Business Fort Pierce Fort Pierce \n", "1 1/2/2016 1:25 1/2/2016 1:37 Business Fort Pierce Fort Pierce \n", "2 1/2/2016 20:25 1/2/2016 20:38 Business Fort Pierce Fort Pierce \n", "3 1/5/2016 17:31 1/5/2016 17:45 Business Fort Pierce Fort Pierce \n", "4 1/6/2016 14:42 1/6/2016 15:49 Business Fort Pierce West Palm Beach \n", "\n", " MILES* PURPOSE* \n", "0 5.1 Meal/Entertain \n", "1 5.0 NaN \n", "2 4.8 Errand/Supplies \n", "3 4.7 Meeting \n", "4 63.7 Customer Visit " ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.head()" ] }, { "cell_type": "code", "execution_count": 5, "id": "02311879", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:04:42.697795Z", "iopub.status.busy": "2023-07-05T10:04:42.697432Z", "iopub.status.idle": "2023-07-05T10:04:42.705474Z", "shell.execute_reply": "2023-07-05T10:04:42.704513Z" }, "papermill": { "duration": 0.024099, "end_time": "2023-07-05T10:04:42.707535", "exception": false, "start_time": "2023-07-05T10:04:42.683436", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "8092" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.size" ] }, { "cell_type": "code", "execution_count": 6, "id": "bed893f6", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:04:42.734982Z", "iopub.status.busy": "2023-07-05T10:04:42.734570Z", "iopub.status.idle": "2023-07-05T10:04:42.741604Z", "shell.execute_reply": "2023-07-05T10:04:42.740645Z" }, "papermill": { "duration": 0.023391, "end_time": "2023-07-05T10:04:42.743662", "exception": false, "start_time": "2023-07-05T10:04:42.720271", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "(1156, 7)" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.shape" ] }, { "cell_type": "code", "execution_count": 7, "id": "f5a7905f", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:04:42.771278Z", "iopub.status.busy": "2023-07-05T10:04:42.770886Z", "iopub.status.idle": "2023-07-05T10:04:42.798105Z", "shell.execute_reply": "2023-07-05T10:04:42.796600Z" }, "papermill": { "duration": 0.043601, "end_time": "2023-07-05T10:04:42.800497", "exception": false, "start_time": "2023-07-05T10:04:42.756896", "status": "completed" }, "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "<class 'pandas.core.frame.DataFrame'>\n", "RangeIndex: 1156 entries, 0 to 1155\n", "Data columns (total 7 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 START_DATE* 1156 non-null object \n", " 1 END_DATE* 1155 non-null object \n", " 2 CATEGORY* 1155 non-null object \n", " 3 START* 1155 non-null object \n", " 4 STOP* 1155 non-null object \n", " 5 MILES* 1156 non-null float64\n", " 6 PURPOSE* 653 non-null object \n", "dtypes: float64(1), object(6)\n", "memory usage: 63.3+ KB\n" ] } ], "source": [ "df.info()" ] }, { "cell_type": "code", "execution_count": 8, "id": "5db991a4", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:04:42.828613Z", "iopub.status.busy": "2023-07-05T10:04:42.827879Z", "iopub.status.idle": "2023-07-05T10:04:42.843400Z", "shell.execute_reply": "2023-07-05T10:04:42.842564Z" }, "papermill": { "duration": 0.031864, "end_time": "2023-07-05T10:04:42.845447", "exception": false, "start_time": "2023-07-05T10:04:42.813583", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/html": [ "<div>\n", "<style scoped>\n", " .dataframe tbody tr th:only-of-type {\n", " vertical-align: middle;\n", " }\n", "\n", " .dataframe tbody tr th {\n", " vertical-align: top;\n", " }\n", "\n", " .dataframe thead th {\n", " text-align: right;\n", " }\n", "</style>\n", "<table border=\"1\" class=\"dataframe\">\n", " <thead>\n", " <tr style=\"text-align: right;\">\n", " <th></th>\n", " <th>MILES*</th>\n", " </tr>\n", " </thead>\n", " <tbody>\n", " <tr>\n", " <th>count</th>\n", " <td>1156.000000</td>\n", " </tr>\n", " <tr>\n", " <th>mean</th>\n", " <td>21.115398</td>\n", " </tr>\n", " <tr>\n", " <th>std</th>\n", " <td>359.299007</td>\n", " </tr>\n", " <tr>\n", " <th>min</th>\n", " <td>0.500000</td>\n", " </tr>\n", " <tr>\n", " <th>25%</th>\n", " <td>2.900000</td>\n", " </tr>\n", " <tr>\n", " <th>50%</th>\n", " <td>6.000000</td>\n", " </tr>\n", " <tr>\n", " <th>75%</th>\n", " <td>10.400000</td>\n", " </tr>\n", " <tr>\n", " <th>max</th>\n", " <td>12204.700000</td>\n", " </tr>\n", " </tbody>\n", "</table>\n", "</div>" ], "text/plain": [ " MILES*\n", "count 1156.000000\n", "mean 21.115398\n", "std 359.299007\n", "min 0.500000\n", "25% 2.900000\n", "50% 6.000000\n", "75% 10.400000\n", "max 12204.700000" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.describe()" ] }, { "cell_type": "code", "execution_count": 9, "id": "42412c0d", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:04:42.874268Z", "iopub.status.busy": "2023-07-05T10:04:42.873892Z", "iopub.status.idle": "2023-07-05T10:04:42.880003Z", "shell.execute_reply": "2023-07-05T10:04:42.879023Z" }, "papermill": { "duration": 0.022978, "end_time": "2023-07-05T10:04:42.881992", "exception": false, "start_time": "2023-07-05T10:04:42.859014", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "Index(['START_DATE*', 'END_DATE*', 'CATEGORY*', 'START*', 'STOP*', 'MILES*',\n", " 'PURPOSE*'],\n", " dtype='object')" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.columns" ] }, { "cell_type": "code", "execution_count": 10, "id": "b5449919", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:04:42.911397Z", "iopub.status.busy": "2023-07-05T10:04:42.910718Z", "iopub.status.idle": "2023-07-05T10:04:42.916608Z", "shell.execute_reply": "2023-07-05T10:04:42.915588Z" }, "papermill": { "duration": 0.022943, "end_time": "2023-07-05T10:04:42.918624", "exception": false, "start_time": "2023-07-05T10:04:42.895681", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "df.rename(columns={'START_DATE*':'start_date','END_DATE*':'end_date','CATEGORY*':'category','START*':'start','STOP*':'stop','MILES*':'miles','PURPOSE*':'purpose'},inplace=True)" ] }, { "cell_type": "code", "execution_count": 11, "id": "191bca6b", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:04:42.947557Z", "iopub.status.busy": "2023-07-05T10:04:42.946913Z", "iopub.status.idle": "2023-07-05T10:04:42.953478Z", "shell.execute_reply": "2023-07-05T10:04:42.952541Z" }, "papermill": { "duration": 0.023737, "end_time": "2023-07-05T10:04:42.955479", "exception": false, "start_time": "2023-07-05T10:04:42.931742", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "Index(['start_date', 'end_date', 'category', 'start', 'stop', 'miles',\n", " 'purpose'],\n", " dtype='object')" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.columns" ] }, { "cell_type": "code", "execution_count": 12, "id": "8466056f", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:04:42.985942Z", "iopub.status.busy": "2023-07-05T10:04:42.985323Z", "iopub.status.idle": "2023-07-05T10:04:43.003021Z", "shell.execute_reply": "2023-07-05T10:04:43.001976Z" }, "papermill": { "duration": 0.035426, "end_time": "2023-07-05T10:04:43.005110", "exception": false, "start_time": "2023-07-05T10:04:42.969684", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/html": [ "<div>\n", "<style scoped>\n", " .dataframe tbody tr th:only-of-type {\n", " vertical-align: middle;\n", " }\n", "\n", " .dataframe tbody tr th {\n", " vertical-align: top;\n", " }\n", "\n", " .dataframe thead th {\n", " text-align: right;\n", " }\n", "</style>\n", "<table border=\"1\" class=\"dataframe\">\n", " <thead>\n", " <tr style=\"text-align: right;\">\n", " <th></th>\n", " <th>start_date</th>\n", " <th>end_date</th>\n", " <th>category</th>\n", " <th>start</th>\n", " <th>stop</th>\n", " <th>miles</th>\n", " <th>purpose</th>\n", " </tr>\n", " </thead>\n", " <tbody>\n", " <tr>\n", " <th>492</th>\n", " <td>6/28/2016 23:34</td>\n", " <td>6/28/2016 23:59</td>\n", " <td>Business</td>\n", " <td>Durham</td>\n", " <td>Cary</td>\n", " <td>9.9</td>\n", " <td>Meeting</td>\n", " </tr>\n", " </tbody>\n", "</table>\n", "</div>" ], "text/plain": [ " start_date end_date category start stop miles purpose\n", "492 6/28/2016 23:34 6/28/2016 23:59 Business Durham Cary 9.9 Meeting" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df[df.duplicated()]" ] }, { "cell_type": "code", "execution_count": 13, "id": "52e404c1", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:04:43.035543Z", "iopub.status.busy": "2023-07-05T10:04:43.034908Z", "iopub.status.idle": "2023-07-05T10:04:43.040914Z", "shell.execute_reply": "2023-07-05T10:04:43.040231Z" }, "papermill": { "duration": 0.023816, "end_time": "2023-07-05T10:04:43.042927", "exception": false, "start_time": "2023-07-05T10:04:43.019111", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "df.drop([492],axis=0,inplace=True)" ] }, { "cell_type": "code", "execution_count": 14, "id": "bd7eb20d", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:04:43.073343Z", "iopub.status.busy": "2023-07-05T10:04:43.072729Z", "iopub.status.idle": "2023-07-05T10:04:43.085441Z", "shell.execute_reply": "2023-07-05T10:04:43.084461Z" }, "papermill": { "duration": 0.030345, "end_time": "2023-07-05T10:04:43.087601", "exception": false, "start_time": "2023-07-05T10:04:43.057256", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/html": [ "<div>\n", "<style scoped>\n", " .dataframe tbody tr th:only-of-type {\n", " vertical-align: middle;\n", " }\n", "\n", " .dataframe tbody tr th {\n", " vertical-align: top;\n", " }\n", "\n", " .dataframe thead th {\n", " text-align: right;\n", " }\n", "</style>\n", "<table border=\"1\" class=\"dataframe\">\n", " <thead>\n", " <tr style=\"text-align: right;\">\n", " <th></th>\n", " <th>start_date</th>\n", " <th>end_date</th>\n", " <th>category</th>\n", " <th>start</th>\n", " <th>stop</th>\n", " <th>miles</th>\n", " <th>purpose</th>\n", " </tr>\n", " </thead>\n", " <tbody>\n", " </tbody>\n", "</table>\n", "</div>" ], "text/plain": [ "Empty DataFrame\n", "Columns: [start_date, end_date, category, start, stop, miles, purpose]\n", "Index: []" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df[df.duplicated()]" ] }, { "cell_type": "code", "execution_count": 15, "id": "23dfafd5", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:04:43.118417Z", "iopub.status.busy": "2023-07-05T10:04:43.118037Z", "iopub.status.idle": "2023-07-05T10:04:43.128502Z", "shell.execute_reply": "2023-07-05T10:04:43.127570Z" }, "papermill": { "duration": 0.028249, "end_time": "2023-07-05T10:04:43.130488", "exception": false, "start_time": "2023-07-05T10:04:43.102239", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "start_date 0\n", "end_date 1\n", "category 1\n", "start 1\n", "stop 1\n", "miles 0\n", "purpose 503\n", "dtype: int64" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.isna().sum()" ] }, { "cell_type": "code", "execution_count": 16, "id": "6855c15f", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:04:43.161292Z", "iopub.status.busy": "2023-07-05T10:04:43.160673Z", "iopub.status.idle": "2023-07-05T10:04:44.561563Z", "shell.execute_reply": "2023-07-05T10:04:44.560116Z" }, "papermill": { "duration": 1.418129, "end_time": "2023-07-05T10:04:44.563186", "exception": true, "start_time": "2023-07-05T10:04:43.145057", "status": "failed" }, "tags": [] }, "outputs": [ { "ename": "ParserError", "evalue": "Unknown string format: Totals present at position 1154", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mParserError\u001b[0m Traceback (most recent call last)", "File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/pandas/_libs/tslib.pyx:605\u001b[0m, in \u001b[0;36mpandas._libs.tslib.array_to_datetime\u001b[0;34m()\u001b[0m\n", "File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/pandas/_libs/tslibs/parsing.pyx:318\u001b[0m, in \u001b[0;36mpandas._libs.tslibs.parsing.parse_datetime_string\u001b[0;34m()\u001b[0m\n", "File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/dateutil/parser/_parser.py:1368\u001b[0m, in \u001b[0;36mparse\u001b[0;34m(timestr, parserinfo, **kwargs)\u001b[0m\n\u001b[1;32m 1367\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m-> 1368\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mDEFAULTPARSER\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mparse\u001b[49m\u001b[43m(\u001b[49m\u001b[43mtimestr\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n", "File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/dateutil/parser/_parser.py:643\u001b[0m, in \u001b[0;36mparser.parse\u001b[0;34m(self, timestr, default, ignoretz, tzinfos, **kwargs)\u001b[0m\n\u001b[1;32m 642\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m res \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m--> 643\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m ParserError(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mUnknown string format: \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m\"\u001b[39m, timestr)\n\u001b[1;32m 645\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(res) \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m0\u001b[39m:\n", "\u001b[0;31mParserError\u001b[0m: Unknown string format: Totals", "\nDuring handling of the above exception, another exception occurred:\n", "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", "File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/pandas/_libs/tslib.pyx:616\u001b[0m, in \u001b[0;36mpandas._libs.tslib.array_to_datetime\u001b[0;34m()\u001b[0m\n", "\u001b[0;31mTypeError\u001b[0m: invalid string coercion to datetime for \"Totals\" at position 1154", "\nDuring handling of the above exception, another exception occurred:\n", "\u001b[0;31mParserError\u001b[0m Traceback (most recent call last)", "Cell \u001b[0;32mIn[16], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m df[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mstart_date\u001b[39m\u001b[38;5;124m'\u001b[39m]\u001b[38;5;241m=\u001b[39m\u001b[43mpd\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mto_datetime\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdf\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mstart_date\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m)\u001b[49m\n", "File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/pandas/core/tools/datetimes.py:1068\u001b[0m, in \u001b[0;36mto_datetime\u001b[0;34m(arg, errors, dayfirst, yearfirst, utc, format, exact, unit, infer_datetime_format, origin, cache)\u001b[0m\n\u001b[1;32m 1066\u001b[0m result \u001b[38;5;241m=\u001b[39m arg\u001b[38;5;241m.\u001b[39mmap(cache_array)\n\u001b[1;32m 1067\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m-> 1068\u001b[0m values \u001b[38;5;241m=\u001b[39m \u001b[43mconvert_listlike\u001b[49m\u001b[43m(\u001b[49m\u001b[43marg\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_values\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mformat\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1069\u001b[0m result \u001b[38;5;241m=\u001b[39m arg\u001b[38;5;241m.\u001b[39m_constructor(values, index\u001b[38;5;241m=\u001b[39marg\u001b[38;5;241m.\u001b[39mindex, name\u001b[38;5;241m=\u001b[39marg\u001b[38;5;241m.\u001b[39mname)\n\u001b[1;32m 1070\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(arg, (ABCDataFrame, abc\u001b[38;5;241m.\u001b[39mMutableMapping)):\n", "File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/pandas/core/tools/datetimes.py:438\u001b[0m, in \u001b[0;36m_convert_listlike_datetimes\u001b[0;34m(arg, format, name, tz, unit, errors, infer_datetime_format, dayfirst, yearfirst, exact)\u001b[0m\n\u001b[1;32m 436\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m \u001b[38;5;28mformat\u001b[39m \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mor\u001b[39;00m infer_datetime_format\n\u001b[1;32m 437\u001b[0m utc \u001b[38;5;241m=\u001b[39m tz \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mutc\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m--> 438\u001b[0m result, tz_parsed \u001b[38;5;241m=\u001b[39m \u001b[43mobjects_to_datetime64ns\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 439\u001b[0m \u001b[43m \u001b[49m\u001b[43marg\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 440\u001b[0m \u001b[43m \u001b[49m\u001b[43mdayfirst\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdayfirst\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 441\u001b[0m \u001b[43m \u001b[49m\u001b[43myearfirst\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43myearfirst\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 442\u001b[0m \u001b[43m \u001b[49m\u001b[43mutc\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mutc\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 443\u001b[0m \u001b[43m \u001b[49m\u001b[43merrors\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43merrors\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 444\u001b[0m \u001b[43m \u001b[49m\u001b[43mrequire_iso8601\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrequire_iso8601\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 445\u001b[0m \u001b[43m \u001b[49m\u001b[43mallow_object\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[1;32m 446\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 448\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m tz_parsed \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 449\u001b[0m \u001b[38;5;66;03m# We can take a shortcut since the datetime64 numpy array\u001b[39;00m\n\u001b[1;32m 450\u001b[0m \u001b[38;5;66;03m# is in UTC\u001b[39;00m\n\u001b[1;32m 451\u001b[0m dta \u001b[38;5;241m=\u001b[39m DatetimeArray(result, dtype\u001b[38;5;241m=\u001b[39mtz_to_dtype(tz_parsed))\n", "File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/pandas/core/arrays/datetimes.py:2177\u001b[0m, in \u001b[0;36mobjects_to_datetime64ns\u001b[0;34m(data, dayfirst, yearfirst, utc, errors, require_iso8601, allow_object, allow_mixed)\u001b[0m\n\u001b[1;32m 2175\u001b[0m order: Literal[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mF\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mC\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mF\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m flags\u001b[38;5;241m.\u001b[39mf_contiguous \u001b[38;5;28;01melse\u001b[39;00m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mC\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 2176\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m-> 2177\u001b[0m result, tz_parsed \u001b[38;5;241m=\u001b[39m \u001b[43mtslib\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43marray_to_datetime\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 2178\u001b[0m \u001b[43m \u001b[49m\u001b[43mdata\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mravel\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mK\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2179\u001b[0m \u001b[43m \u001b[49m\u001b[43merrors\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43merrors\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2180\u001b[0m \u001b[43m \u001b[49m\u001b[43mutc\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mutc\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2181\u001b[0m \u001b[43m \u001b[49m\u001b[43mdayfirst\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdayfirst\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2182\u001b[0m \u001b[43m \u001b[49m\u001b[43myearfirst\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43myearfirst\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2183\u001b[0m \u001b[43m \u001b[49m\u001b[43mrequire_iso8601\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrequire_iso8601\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2184\u001b[0m \u001b[43m \u001b[49m\u001b[43mallow_mixed\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mallow_mixed\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2185\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 2186\u001b[0m result \u001b[38;5;241m=\u001b[39m result\u001b[38;5;241m.\u001b[39mreshape(data\u001b[38;5;241m.\u001b[39mshape, order\u001b[38;5;241m=\u001b[39morder)\n\u001b[1;32m 2187\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mOverflowError\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m err:\n\u001b[1;32m 2188\u001b[0m \u001b[38;5;66;03m# Exception is raised when a part of date is greater than 32 bit signed int\u001b[39;00m\n", "File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/pandas/_libs/tslib.pyx:427\u001b[0m, in \u001b[0;36mpandas._libs.tslib.array_to_datetime\u001b[0;34m()\u001b[0m\n", "File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/pandas/_libs/tslib.pyx:683\u001b[0m, in \u001b[0;36mpandas._libs.tslib.array_to_datetime\u001b[0;34m()\u001b[0m\n", "File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/pandas/_libs/tslib.pyx:829\u001b[0m, in \u001b[0;36mpandas._libs.tslib._array_to_datetime_object\u001b[0;34m()\u001b[0m\n", "File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/pandas/_libs/tslib.pyx:819\u001b[0m, in \u001b[0;36mpandas._libs.tslib._array_to_datetime_object\u001b[0;34m()\u001b[0m\n", "File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/pandas/_libs/tslibs/parsing.pyx:318\u001b[0m, in \u001b[0;36mpandas._libs.tslibs.parsing.parse_datetime_string\u001b[0;34m()\u001b[0m\n", "File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/dateutil/parser/_parser.py:1368\u001b[0m, in \u001b[0;36mparse\u001b[0;34m(timestr, parserinfo, **kwargs)\u001b[0m\n\u001b[1;32m 1366\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m parser(parserinfo)\u001b[38;5;241m.\u001b[39mparse(timestr, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[1;32m 1367\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m-> 1368\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mDEFAULTPARSER\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mparse\u001b[49m\u001b[43m(\u001b[49m\u001b[43mtimestr\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n", "File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/dateutil/parser/_parser.py:643\u001b[0m, in \u001b[0;36mparser.parse\u001b[0;34m(self, timestr, default, ignoretz, tzinfos, **kwargs)\u001b[0m\n\u001b[1;32m 640\u001b[0m res, skipped_tokens \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_parse(timestr, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[1;32m 642\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m res \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m--> 643\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m ParserError(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mUnknown string format: \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m\"\u001b[39m, timestr)\n\u001b[1;32m 645\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(res) \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m0\u001b[39m:\n\u001b[1;32m 646\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m ParserError(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mString does not contain a date: \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m\"\u001b[39m, timestr)\n", "\u001b[0;31mParserError\u001b[0m: Unknown string format: Totals present at position 1154" ] } ], "source": [ "df['start_date']=pd.to_datetime(df['start_date'])" ] }, { "cell_type": "markdown", "id": "27a3852d", "metadata": { "papermill": { "duration": null, "end_time": null, "exception": null, "start_time": null, "status": "pending" }, "tags": [] }, "source": [ "#### Solving The Error:-\"Unknown string format: Totals present at position 1154\" To Convert Column 'start_date' To DateTime" ] }, { "cell_type": "code", "execution_count": null, "id": "63d61127", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T09:53:39.887185Z", "iopub.status.busy": "2023-07-05T09:53:39.886144Z", "iopub.status.idle": "2023-07-05T09:53:39.906088Z", "shell.execute_reply": "2023-07-05T09:53:39.904941Z", "shell.execute_reply.started": "2023-07-05T09:53:39.887130Z" }, "papermill": { "duration": null, "end_time": null, "exception": null, "start_time": null, "status": "pending" }, "tags": [] }, "outputs": [], "source": [ "df.iloc[[1154]]" ] }, { "cell_type": "code", "execution_count": null, "id": "a5a1abe0", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T09:53:42.425667Z", "iopub.status.busy": "2023-07-05T09:53:42.424825Z", "iopub.status.idle": "2023-07-05T09:53:42.432968Z", "shell.execute_reply": "2023-07-05T09:53:42.431833Z", "shell.execute_reply.started": "2023-07-05T09:53:42.425622Z" }, "papermill": { "duration": null, "end_time": null, "exception": null, "start_time": null, "status": "pending" }, "tags": [] }, "outputs": [], "source": [ "df.drop([1155],axis=0,inplace=True)" ] }, { "cell_type": "code", "execution_count": null, "id": "c7f25aa9", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T09:53:43.353156Z", "iopub.status.busy": "2023-07-05T09:53:43.352748Z", "iopub.status.idle": "2023-07-05T09:53:43.491767Z", "shell.execute_reply": "2023-07-05T09:53:43.490700Z", "shell.execute_reply.started": "2023-07-05T09:53:43.353124Z" }, "papermill": { "duration": null, "end_time": null, "exception": null, "start_time": null, "status": "pending" }, "tags": [] }, "outputs": [], "source": [ "df['start_date']=pd.to_datetime(df['start_date'])" ] }, { "cell_type": "markdown", "id": "cecae5de", "metadata": { "papermill": { "duration": null, "end_time": null, "exception": null, "start_time": null, "status": "pending" }, "tags": [] }, "source": [ "#### Error Solved In The Previous 3 Steps:-Successfully Converted Column 'start_date' To DateTime" ] }, { "cell_type": "code", "execution_count": null, "id": "7108d519", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T09:53:47.001575Z", "iopub.status.busy": "2023-07-05T09:53:47.001171Z", "iopub.status.idle": "2023-07-05T09:53:47.144645Z", "shell.execute_reply": "2023-07-05T09:53:47.143267Z", "shell.execute_reply.started": "2023-07-05T09:53:47.001547Z" }, "papermill": { "duration": null, "end_time": null, "exception": null, "start_time": null, "status": "pending" }, "tags": [] }, "outputs": [], "source": [ "df['end_date']=pd.to_datetime(df['end_date'])" ] }, { "cell_type": "code", "execution_count": null, "id": "d75935ec", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T09:53:47.993516Z", "iopub.status.busy": "2023-07-05T09:53:47.992889Z", "iopub.status.idle": "2023-07-05T09:53:48.004368Z", "shell.execute_reply": "2023-07-05T09:53:48.003212Z", "shell.execute_reply.started": "2023-07-05T09:53:47.993485Z" }, "papermill": { "duration": null, "end_time": null, "exception": null, "start_time": null, "status": "pending" }, "tags": [] }, "outputs": [], "source": [ "df.isna().sum()" ] }, { "cell_type": "code", "execution_count": null, "id": "a9670dd2", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T09:53:48.985437Z", "iopub.status.busy": "2023-07-05T09:53:48.984832Z", "iopub.status.idle": "2023-07-05T09:53:48.994851Z", "shell.execute_reply": "2023-07-05T09:53:48.993731Z", "shell.execute_reply.started": "2023-07-05T09:53:48.985403Z" }, "papermill": { "duration": null, "end_time": null, "exception": null, "start_time": null, "status": "pending" }, "tags": [] }, "outputs": [], "source": [ "df['purpose'].value_counts()" ] }, { "cell_type": "code", "execution_count": null, "id": "e574fe3b", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T09:53:50.041684Z", "iopub.status.busy": "2023-07-05T09:53:50.041277Z", "iopub.status.idle": "2023-07-05T09:53:50.048295Z", "shell.execute_reply": "2023-07-05T09:53:50.047306Z", "shell.execute_reply.started": "2023-07-05T09:53:50.041653Z" }, "papermill": { "duration": null, "end_time": null, "exception": null, "start_time": null, "status": "pending" }, "tags": [] }, "outputs": [], "source": [ "df['purpose']=df['purpose'].replace(np.nan,'Purpose Not Defined')" ] }, { "cell_type": "code", "execution_count": null, "id": "35d673cd", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T09:53:52.707492Z", "iopub.status.busy": "2023-07-05T09:53:52.707017Z", "iopub.status.idle": "2023-07-05T09:53:52.717660Z", "shell.execute_reply": "2023-07-05T09:53:52.716065Z", "shell.execute_reply.started": "2023-07-05T09:53:52.707455Z" }, "papermill": { "duration": null, "end_time": null, "exception": null, "start_time": null, "status": "pending" }, "tags": [] }, "outputs": [], "source": [ "df['purpose'].value_counts()" ] }, { "cell_type": "code", "execution_count": null, "id": "dc3a5b77", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T09:53:53.498910Z", "iopub.status.busy": "2023-07-05T09:53:53.498488Z", "iopub.status.idle": "2023-07-05T09:53:53.896334Z", "shell.execute_reply": "2023-07-05T09:53:53.895149Z", "shell.execute_reply.started": "2023-07-05T09:53:53.498876Z" }, "papermill": { "duration": null, "end_time": null, "exception": null, "start_time": null, "status": "pending" }, "tags": [] }, "outputs": [], "source": [ "px.bar(df,x=df['purpose'].value_counts().keys(),y=df['purpose'].value_counts(),color=df['purpose'].value_counts().keys(),title='Purpose To Travel')" ] }, { "cell_type": "code", "execution_count": null, "id": "6869804e", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T09:53:57.646819Z", "iopub.status.busy": "2023-07-05T09:53:57.646421Z", "iopub.status.idle": "2023-07-05T09:53:57.655692Z", "shell.execute_reply": "2023-07-05T09:53:57.654427Z", "shell.execute_reply.started": "2023-07-05T09:53:57.646789Z" }, "papermill": { "duration": null, "end_time": null, "exception": null, "start_time": null, "status": "pending" }, "tags": [] }, "outputs": [], "source": [ "df['category'].value_counts()" ] }, { "cell_type": "code", "execution_count": null, "id": "ff563783", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T09:53:58.482256Z", "iopub.status.busy": "2023-07-05T09:53:58.481840Z", "iopub.status.idle": "2023-07-05T09:53:58.570468Z", "shell.execute_reply": "2023-07-05T09:53:58.569007Z", "shell.execute_reply.started": "2023-07-05T09:53:58.482209Z" }, "papermill": { "duration": null, "end_time": null, "exception": null, "start_time": null, "status": "pending" }, "tags": [] }, "outputs": [], "source": [ "px.bar(df,x=df['category'].value_counts().keys(),y=df['category'].value_counts(),color=df['category'].value_counts().keys(),title='Category To Travel')" ] }, { "cell_type": "code", "execution_count": null, "id": "8c156e12", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T09:53:59.450383Z", "iopub.status.busy": "2023-07-05T09:53:59.449937Z", "iopub.status.idle": "2023-07-05T09:53:59.458119Z", "shell.execute_reply": "2023-07-05T09:53:59.456768Z", "shell.execute_reply.started": "2023-07-05T09:53:59.450349Z" }, "papermill": { "duration": null, "end_time": null, "exception": null, "start_time": null, "status": "pending" }, "tags": [] }, "outputs": [], "source": [ "df['month_name']=df['start_date'].dt.month_name()" ] }, { "cell_type": "code", "execution_count": null, "id": "98e5d855", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T09:54:03.379902Z", "iopub.status.busy": "2023-07-05T09:54:03.379449Z", "iopub.status.idle": "2023-07-05T09:54:03.387395Z", "shell.execute_reply": "2023-07-05T09:54:03.386330Z", "shell.execute_reply.started": "2023-07-05T09:54:03.379843Z" }, "papermill": { "duration": null, "end_time": null, "exception": null, "start_time": null, "status": "pending" }, "tags": [] }, "outputs": [], "source": [ "df['day_name']=df['start_date'].dt.day_name()" ] }, { "cell_type": "code", "execution_count": null, "id": "b72fca12", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T09:54:04.318076Z", "iopub.status.busy": "2023-07-05T09:54:04.317637Z", "iopub.status.idle": "2023-07-05T09:54:04.336140Z", "shell.execute_reply": "2023-07-05T09:54:04.335037Z", "shell.execute_reply.started": "2023-07-05T09:54:04.318020Z" }, "papermill": { "duration": null, "end_time": null, "exception": null, "start_time": null, "status": "pending" }, "tags": [] }, "outputs": [], "source": [ "df.head()" ] }, { "cell_type": "code", "execution_count": null, "id": "d04dd960", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T09:54:06.943075Z", "iopub.status.busy": "2023-07-05T09:54:06.942660Z", "iopub.status.idle": "2023-07-05T09:54:06.953230Z", "shell.execute_reply": "2023-07-05T09:54:06.952319Z", "shell.execute_reply.started": "2023-07-05T09:54:06.943044Z" }, "papermill": { "duration": null, "end_time": null, "exception": null, "start_time": null, "status": "pending" }, "tags": [] }, "outputs": [], "source": [ "df['month_name'].value_counts()" ] }, { "cell_type": "code", "execution_count": null, "id": "8947399c", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T09:54:07.634463Z", "iopub.status.busy": "2023-07-05T09:54:07.634044Z", "iopub.status.idle": "2023-07-05T09:54:07.770101Z", "shell.execute_reply": "2023-07-05T09:54:07.769012Z", "shell.execute_reply.started": "2023-07-05T09:54:07.634430Z" }, "papermill": { "duration": null, "end_time": null, "exception": null, "start_time": null, "status": "pending" }, "tags": [] }, "outputs": [], "source": [ "px.bar(df,x=df['month_name'].value_counts().keys(),y=df['month_name'].value_counts(),color=df['month_name'].value_counts().keys(),title='Months To Travel')" ] }, { "cell_type": "code", "execution_count": null, "id": "9d3ece7d", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T09:54:09.139811Z", "iopub.status.busy": "2023-07-05T09:54:09.138664Z", "iopub.status.idle": "2023-07-05T09:54:09.149343Z", "shell.execute_reply": "2023-07-05T09:54:09.148010Z", "shell.execute_reply.started": "2023-07-05T09:54:09.139770Z" }, "papermill": { "duration": null, "end_time": null, "exception": null, "start_time": null, "status": "pending" }, "tags": [] }, "outputs": [], "source": [ "df['day_name'].value_counts()" ] }, { "cell_type": "code", "execution_count": null, "id": "a15f538d", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T09:54:10.362110Z", "iopub.status.busy": "2023-07-05T09:54:10.361719Z", "iopub.status.idle": "2023-07-05T09:54:10.471215Z", "shell.execute_reply": "2023-07-05T09:54:10.470173Z", "shell.execute_reply.started": "2023-07-05T09:54:10.362081Z" }, "papermill": { "duration": null, "end_time": null, "exception": null, "start_time": null, "status": "pending" }, "tags": [] }, "outputs": [], "source": [ "px.bar(df,x=df['day_name'].value_counts().keys(),y=df['day_name'].value_counts(),color=df['day_name'].value_counts().keys(),title='Days To Travel')" ] }, { "cell_type": "code", "execution_count": null, "id": "ed8d65e2", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T09:54:11.514142Z", "iopub.status.busy": "2023-07-05T09:54:11.513724Z", "iopub.status.idle": "2023-07-05T09:54:11.525181Z", "shell.execute_reply": "2023-07-05T09:54:11.523934Z", "shell.execute_reply.started": "2023-07-05T09:54:11.514111Z" }, "papermill": { "duration": null, "end_time": null, "exception": null, "start_time": null, "status": "pending" }, "tags": [] }, "outputs": [], "source": [ "df['start'].value_counts()" ] }, { "cell_type": "code", "execution_count": null, "id": "0fb60f32", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T09:54:12.298575Z", "iopub.status.busy": "2023-07-05T09:54:12.298142Z", "iopub.status.idle": "2023-07-05T09:54:13.233414Z", "shell.execute_reply": "2023-07-05T09:54:13.232323Z", "shell.execute_reply.started": "2023-07-05T09:54:12.298541Z" }, "papermill": { "duration": null, "end_time": null, "exception": null, "start_time": null, "status": "pending" }, "tags": [] }, "outputs": [], "source": [ "px.bar(df,x=df['start'].value_counts().keys(),y=df['start'].value_counts(),color=df['start'].value_counts().keys(),title='Start Location To Travel')" ] }, { "cell_type": "code", "execution_count": null, "id": "6f5dd8a4", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T09:54:16.703694Z", "iopub.status.busy": "2023-07-05T09:54:16.703234Z", "iopub.status.idle": "2023-07-05T09:54:16.714580Z", "shell.execute_reply": "2023-07-05T09:54:16.713326Z", "shell.execute_reply.started": "2023-07-05T09:54:16.703653Z" }, "papermill": { "duration": null, "end_time": null, "exception": null, "start_time": null, "status": "pending" }, "tags": [] }, "outputs": [], "source": [ "df['stop'].value_counts()" ] }, { "cell_type": "code", "execution_count": null, "id": "f99bf7f2", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T09:54:17.435360Z", "iopub.status.busy": "2023-07-05T09:54:17.434586Z", "iopub.status.idle": "2023-07-05T09:54:18.440198Z", "shell.execute_reply": "2023-07-05T09:54:18.439085Z", "shell.execute_reply.started": "2023-07-05T09:54:17.435314Z" }, "papermill": { "duration": null, "end_time": null, "exception": null, "start_time": null, "status": "pending" }, "tags": [] }, "outputs": [], "source": [ "px.bar(df,x=df['stop'].value_counts().keys(),y=df['stop'].value_counts(),color=df['stop'].value_counts().keys(),title='Stop Location To Travel')" ] }, { "cell_type": "code", "execution_count": null, "id": "cb30a4b0", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T09:58:40.357278Z", "iopub.status.busy": "2023-07-05T09:58:40.356914Z", "iopub.status.idle": "2023-07-05T09:58:40.375414Z", "shell.execute_reply": "2023-07-05T09:58:40.374082Z", "shell.execute_reply.started": "2023-07-05T09:58:40.357235Z" }, "papermill": { "duration": null, "end_time": null, "exception": null, "start_time": null, "status": "pending" }, "tags": [] }, "outputs": [], "source": [ "df_mon_day=df.groupby(['month_name','day_name']).agg({'day_name':'count'}).rename(columns={'day_name':'day_name_count'}).reset_index()\n", "df_mon_day.head()" ] }, { "cell_type": "code", "execution_count": null, "id": "4242df89", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T09:58:33.804484Z", "iopub.status.busy": "2023-07-05T09:58:33.803880Z", "iopub.status.idle": "2023-07-05T09:58:33.820946Z", "shell.execute_reply": "2023-07-05T09:58:33.819663Z", "shell.execute_reply.started": "2023-07-05T09:58:33.804435Z" }, "papermill": { "duration": null, "end_time": null, "exception": null, "start_time": null, "status": "pending" }, "tags": [] }, "outputs": [], "source": [ "df_mon_day.sort_values(by='day_name_count',ascending=False).head()" ] }, { "cell_type": "code", "execution_count": null, "id": "6ab6b367", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T09:56:21.383261Z", "iopub.status.busy": "2023-07-05T09:56:21.382792Z", "iopub.status.idle": "2023-07-05T09:56:21.495572Z", "shell.execute_reply": "2023-07-05T09:56:21.494333Z", "shell.execute_reply.started": "2023-07-05T09:56:21.383205Z" }, "papermill": { "duration": null, "end_time": null, "exception": null, "start_time": null, "status": "pending" }, "tags": [] }, "outputs": [], "source": [ "px.bar(df_mon_day,x='month_name',y='day_name_count',color='day_name',title='Month Day To Travel')" ] }, { "cell_type": "markdown", "id": "029ca390", "metadata": { "papermill": { "duration": null, "end_time": null, "exception": null, "start_time": null, "status": "pending" }, "tags": [] }, "source": [ "## Thanks And Regards\n", "### Anubhav Kumar Gupta" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.10" }, "papermill": { "default_parameters": {}, "duration": 16.947487, "end_time": "2023-07-05T10:04:45.599378", "environment_variables": {}, "exception": true, "input_path": "__notebook__.ipynb", "output_path": "__notebook__.ipynb", "parameters": {}, "start_time": "2023-07-05T10:04:28.651891", "version": "2.4.0" } }, "nbformat": 4, "nbformat_minor": 5 }
0135/796/135796173.ipynb
s3://data-agents/kaggle-outputs/sharded/031_00135.jsonl.gz
{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "1d4d3d4c", "metadata": { "_cell_guid": "b1076dfc-b9ad-4769-8c92-a6c4dae69d19", "_uuid": "8f2839f25d086af736a60e9eeb907d3b93b6e0e5", "execution": { "iopub.execute_input": "2023-07-05T10:09:21.035079Z", "iopub.status.busy": "2023-07-05T10:09:21.034414Z", "iopub.status.idle": "2023-07-05T10:09:21.050402Z", "shell.execute_reply": "2023-07-05T10:09:21.049318Z" }, "papermill": { "duration": 0.027483, "end_time": "2023-07-05T10:09:21.053139", "exception": false, "start_time": "2023-07-05T10:09:21.025656", "status": "completed" }, "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "/kaggle/input/playground-series-s3e18/sample_submission.csv\n", "/kaggle/input/playground-series-s3e18/train.csv\n", "/kaggle/input/playground-series-s3e18/test.csv\n" ] } ], "source": [ "# This Python 3 environment comes with many helpful analytics libraries installed\n", "# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n", "# For example, here's several helpful packages to load\n", "\n", "import numpy as np # linear algebra\n", "import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n", "\n", "\n", "# Input data files are available in the read-only \"../input/\" directory\n", "# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n", "\n", "import os\n", "for dirname, _, filenames in os.walk('/kaggle/input'):\n", " for filename in filenames:\n", " print(os.path.join(dirname, filename))\n", "\n", "# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n", "# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session" ] }, { "cell_type": "code", "execution_count": 2, "id": "e749eb69", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:09:21.067962Z", "iopub.status.busy": "2023-07-05T10:09:21.067296Z", "iopub.status.idle": "2023-07-05T10:09:21.270291Z", "shell.execute_reply": "2023-07-05T10:09:21.269096Z" }, "papermill": { "duration": 0.213492, "end_time": "2023-07-05T10:09:21.273025", "exception": false, "start_time": "2023-07-05T10:09:21.059533", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "X = pd.read_csv('/kaggle/input/playground-series-s3e18/train.csv')\n", "\n", "#Drop EC3-6 to prevent leakage\n", "X = X.drop(['id', 'EC3', 'EC4', 'EC5', 'EC6'], axis=1)\n", "# remove -666 row\n", "idxs = X[(X['FpDensityMorgan1'] == -666) | (X['FpDensityMorgan2'] == -666) | (X['FpDensityMorgan3'] == -666)].index\n", "X = X.drop(idxs, axis=0)\n", "\n", "y1 = X.pop('EC1')\n", "y2 = X.pop('EC2')" ] }, { "cell_type": "code", "execution_count": 3, "id": "79c9dafd", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:09:21.287445Z", "iopub.status.busy": "2023-07-05T10:09:21.287042Z", "iopub.status.idle": "2023-07-05T10:09:21.294997Z", "shell.execute_reply": "2023-07-05T10:09:21.293910Z" }, "papermill": { "duration": 0.017718, "end_time": "2023-07-05T10:09:21.297210", "exception": false, "start_time": "2023-07-05T10:09:21.279492", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "(14837, 31)" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "X.shape" ] }, { "cell_type": "markdown", "id": "be0f5e27", "metadata": { "papermill": { "duration": 0.005986, "end_time": "2023-07-05T10:09:21.309522", "exception": false, "start_time": "2023-07-05T10:09:21.303536", "status": "completed" }, "tags": [] }, "source": [ "I decide to trian models on EC1 and EC2 separately. The objective is to maximize the cv score." ] }, { "cell_type": "code", "execution_count": 4, "id": "e4854421", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:09:21.323914Z", "iopub.status.busy": "2023-07-05T10:09:21.323488Z", "iopub.status.idle": "2023-07-05T10:09:23.898614Z", "shell.execute_reply": "2023-07-05T10:09:23.897454Z" }, "papermill": { "duration": 2.585943, "end_time": "2023-07-05T10:09:23.901706", "exception": false, "start_time": "2023-07-05T10:09:21.315763", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "from sklearn.pipeline import Pipeline, make_pipeline\n", "from sklearn.model_selection import GridSearchCV\n", "from sklearn.ensemble import BaggingClassifier, VotingClassifier\n", "from sklearn.compose import ColumnTransformer\n", "from sklearn.preprocessing import StandardScaler, FunctionTransformer\n", "# Use optuna to tune the hp\n", "import optuna" ] }, { "cell_type": "code", "execution_count": 5, "id": "1fa9f163", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:09:23.916359Z", "iopub.status.busy": "2023-07-05T10:09:23.915938Z", "iopub.status.idle": "2023-07-05T10:09:23.921216Z", "shell.execute_reply": "2023-07-05T10:09:23.919994Z" }, "papermill": { "duration": 0.015504, "end_time": "2023-07-05T10:09:23.923709", "exception": false, "start_time": "2023-07-05T10:09:23.908205", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "def add_features():\n", " # add several features\n", " pass" ] }, { "cell_type": "markdown", "id": "107a54ca", "metadata": { "papermill": { "duration": 0.006198, "end_time": "2023-07-05T10:09:23.938574", "exception": false, "start_time": "2023-07-05T10:09:23.932376", "status": "completed" }, "tags": [] }, "source": [ "# EC1" ] }, { "cell_type": "code", "execution_count": 6, "id": "0b19463e", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:09:23.953320Z", "iopub.status.busy": "2023-07-05T10:09:23.952890Z", "iopub.status.idle": "2023-07-05T10:09:25.210602Z", "shell.execute_reply": "2023-07-05T10:09:25.209306Z" }, "papermill": { "duration": 1.268739, "end_time": "2023-07-05T10:09:25.213818", "exception": false, "start_time": "2023-07-05T10:09:23.945079", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "# Use LGBM to predict EC1\n", "from lightgbm import LGBMClassifier" ] }, { "cell_type": "code", "execution_count": 7, "id": "83bf4309", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:09:25.229089Z", "iopub.status.busy": "2023-07-05T10:09:25.228485Z", "iopub.status.idle": "2023-07-05T10:09:25.240109Z", "shell.execute_reply": "2023-07-05T10:09:25.238996Z" }, "papermill": { "duration": 0.023078, "end_time": "2023-07-05T10:09:25.243525", "exception": false, "start_time": "2023-07-05T10:09:25.220447", "status": "completed" }, "tags": [] }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/tmp/ipykernel_20/456241668.py:10: ExperimentalWarning: OptunaSearchCV is experimental (supported from v0.17.0). The interface can change in the future.\n", " optuna_search1 = optuna.integration.OptunaSearchCV(LGBMClassifier(random_state = 100),\n" ] } ], "source": [ "param1_distributions = {\n", " 'learning_rate': optuna.distributions.FloatDistribution(1e-3, 0.05),\n", " 'n_estimators': optuna.distributions.IntDistribution(80, 500),\n", " 'min_child_samples': optuna.distributions.IntDistribution(10, 90),\n", " 'reg_alpha': optuna.distributions.FloatDistribution(1e-3, 10.0),\n", " 'subsample': optuna.distributions.FloatDistribution(0.6, 1.0),\n", " 'colsample_bytree':optuna.distributions.FloatDistribution(0.6, 1.0),\n", "}\n", "\n", "optuna_search1 = optuna.integration.OptunaSearchCV(LGBMClassifier(random_state = 100),\n", " param1_distributions,\n", " scoring = 'roc_auc',\n", " refit = True,\n", " random_state = 1289, \n", " verbose=0)\n", "#optuna_search1.fit(X,y1)" ] }, { "cell_type": "code", "execution_count": 8, "id": "e2efc096", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:09:25.259149Z", "iopub.status.busy": "2023-07-05T10:09:25.257990Z", "iopub.status.idle": "2023-07-05T10:09:35.552163Z", "shell.execute_reply": "2023-07-05T10:09:35.550988Z" }, "papermill": { "duration": 10.304625, "end_time": "2023-07-05T10:09:35.554727", "exception": false, "start_time": "2023-07-05T10:09:25.250102", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/html": [ "<style>#sk-container-id-1 {color: black;background-color: white;}#sk-container-id-1 pre{padding: 0;}#sk-container-id-1 div.sk-toggleable {background-color: white;}#sk-container-id-1 label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.3em;box-sizing: border-box;text-align: center;}#sk-container-id-1 label.sk-toggleable__label-arrow:before {content: \"▸\";float: left;margin-right: 0.25em;color: #696969;}#sk-container-id-1 label.sk-toggleable__label-arrow:hover:before {color: black;}#sk-container-id-1 div.sk-estimator:hover label.sk-toggleable__label-arrow:before {color: black;}#sk-container-id-1 div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;background-color: #f0f8ff;}#sk-container-id-1 div.sk-toggleable__content pre {margin: 0.2em;color: black;border-radius: 0.25em;background-color: #f0f8ff;}#sk-container-id-1 input.sk-toggleable__control:checked~div.sk-toggleable__content {max-height: 200px;max-width: 100%;overflow: auto;}#sk-container-id-1 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: \"▾\";}#sk-container-id-1 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;}#sk-container-id-1 div.sk-estimator {font-family: monospace;background-color: #f0f8ff;border: 1px dotted black;border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;}#sk-container-id-1 div.sk-estimator:hover {background-color: #d4ebff;}#sk-container-id-1 div.sk-parallel-item::after {content: \"\";width: 100%;border-bottom: 1px solid gray;flex-grow: 1;}#sk-container-id-1 div.sk-label:hover label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 div.sk-serial::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: 0;}#sk-container-id-1 div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: white;padding-right: 0.2em;padding-left: 0.2em;position: relative;}#sk-container-id-1 div.sk-item {position: relative;z-index: 1;}#sk-container-id-1 div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: white;position: relative;}#sk-container-id-1 div.sk-item::before, #sk-container-id-1 div.sk-parallel-item::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: -1;}#sk-container-id-1 div.sk-parallel-item {display: flex;flex-direction: column;z-index: 1;position: relative;background-color: white;}#sk-container-id-1 div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;}#sk-container-id-1 div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;}#sk-container-id-1 div.sk-parallel-item:only-child::after {width: 0;}#sk-container-id-1 div.sk-dashed-wrapped {border: 1px dashed gray;margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: white;}#sk-container-id-1 div.sk-label label {font-family: monospace;font-weight: bold;display: inline-block;line-height: 1.2em;}#sk-container-id-1 div.sk-label-container {text-align: center;}#sk-container-id-1 div.sk-container {/* jupyter's `normalize.less` sets `[hidden] { display: none; }` but bootstrap.min.css set `[hidden] { display: none !important; }` so we also need the `!important` here to be able to override the default hidden behavior on the sphinx rendered scikit-learn.org. See: https://github.com/scikit-learn/scikit-learn/issues/21755 */display: inline-block !important;position: relative;}#sk-container-id-1 div.sk-text-repr-fallback {display: none;}</style><div id=\"sk-container-id-1\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>GridSearchCV(estimator=LGBMClassifier(learning_rate=0.04, min_child_samples=50,\n", " n_estimators=160, random_state=100,\n", " reg_alpha=1.06, reg_lambda=2),\n", " param_grid={}, scoring=&#x27;roc_auc&#x27;)</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item sk-dashed-wrapped\"><div class=\"sk-label-container\"><div class=\"sk-label sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-1\" type=\"checkbox\" ><label for=\"sk-estimator-id-1\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">GridSearchCV</label><div class=\"sk-toggleable__content\"><pre>GridSearchCV(estimator=LGBMClassifier(learning_rate=0.04, min_child_samples=50,\n", " n_estimators=160, random_state=100,\n", " reg_alpha=1.06, reg_lambda=2),\n", " param_grid={}, scoring=&#x27;roc_auc&#x27;)</pre></div></div></div><div class=\"sk-parallel\"><div class=\"sk-parallel-item\"><div class=\"sk-item\"><div class=\"sk-label-container\"><div class=\"sk-label sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-2\" type=\"checkbox\" ><label for=\"sk-estimator-id-2\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">estimator: LGBMClassifier</label><div class=\"sk-toggleable__content\"><pre>LGBMClassifier(learning_rate=0.04, min_child_samples=50, n_estimators=160,\n", " random_state=100, reg_alpha=1.06, reg_lambda=2)</pre></div></div></div><div class=\"sk-serial\"><div class=\"sk-item\"><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-3\" type=\"checkbox\" ><label for=\"sk-estimator-id-3\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">LGBMClassifier</label><div class=\"sk-toggleable__content\"><pre>LGBMClassifier(learning_rate=0.04, min_child_samples=50, n_estimators=160,\n", " random_state=100, reg_alpha=1.06, reg_lambda=2)</pre></div></div></div></div></div></div></div></div></div></div>" ], "text/plain": [ "GridSearchCV(estimator=LGBMClassifier(learning_rate=0.04, min_child_samples=50,\n", " n_estimators=160, random_state=100,\n", " reg_alpha=1.06, reg_lambda=2),\n", " param_grid={}, scoring='roc_auc')" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Tuned by optuna\n", "clf1 = LGBMClassifier(random_state = 100,\n", " n_estimators = 160,\n", " learning_rate = 0.04,\n", " min_child_samples=50,\n", " reg_alpha = 1.06,\n", " reg_lambda = 2\n", " )\n", "\n", "gcv1= GridSearchCV(clf1, {},\n", " refit=True,\n", " scoring = 'roc_auc')\n", "gcv1.fit(X,y1)" ] }, { "cell_type": "code", "execution_count": 9, "id": "f33bee5b", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:09:35.570588Z", "iopub.status.busy": "2023-07-05T10:09:35.570196Z", "iopub.status.idle": "2023-07-05T10:09:35.577259Z", "shell.execute_reply": "2023-07-05T10:09:35.576168Z" }, "papermill": { "duration": 0.017782, "end_time": "2023-07-05T10:09:35.579765", "exception": false, "start_time": "2023-07-05T10:09:35.561983", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "0.7027195720286965" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gcv1.best_score_" ] }, { "cell_type": "markdown", "id": "f6a72f0b", "metadata": { "papermill": { "duration": 0.006592, "end_time": "2023-07-05T10:09:35.593256", "exception": false, "start_time": "2023-07-05T10:09:35.586664", "status": "completed" }, "tags": [] }, "source": [ "# EC2" ] }, { "cell_type": "code", "execution_count": 10, "id": "2459fc82", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:09:35.609666Z", "iopub.status.busy": "2023-07-05T10:09:35.608861Z", "iopub.status.idle": "2023-07-05T10:09:35.616254Z", "shell.execute_reply": "2023-07-05T10:09:35.615195Z" }, "papermill": { "duration": 0.017836, "end_time": "2023-07-05T10:09:35.618570", "exception": false, "start_time": "2023-07-05T10:09:35.600734", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "from sklearn.neighbors import KNeighborsClassifier" ] }, { "cell_type": "code", "execution_count": 11, "id": "a4bcdb70", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:09:35.634088Z", "iopub.status.busy": "2023-07-05T10:09:35.633717Z", "iopub.status.idle": "2023-07-05T10:16:58.317397Z", "shell.execute_reply": "2023-07-05T10:16:58.316125Z" }, "papermill": { "duration": 442.701849, "end_time": "2023-07-05T10:16:58.327400", "exception": false, "start_time": "2023-07-05T10:09:35.625551", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/html": [ "<style>#sk-container-id-2 {color: black;background-color: white;}#sk-container-id-2 pre{padding: 0;}#sk-container-id-2 div.sk-toggleable {background-color: white;}#sk-container-id-2 label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.3em;box-sizing: border-box;text-align: center;}#sk-container-id-2 label.sk-toggleable__label-arrow:before {content: \"▸\";float: left;margin-right: 0.25em;color: #696969;}#sk-container-id-2 label.sk-toggleable__label-arrow:hover:before {color: black;}#sk-container-id-2 div.sk-estimator:hover label.sk-toggleable__label-arrow:before {color: black;}#sk-container-id-2 div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;background-color: #f0f8ff;}#sk-container-id-2 div.sk-toggleable__content pre {margin: 0.2em;color: black;border-radius: 0.25em;background-color: #f0f8ff;}#sk-container-id-2 input.sk-toggleable__control:checked~div.sk-toggleable__content {max-height: 200px;max-width: 100%;overflow: auto;}#sk-container-id-2 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: \"▾\";}#sk-container-id-2 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-2 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-2 input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;}#sk-container-id-2 div.sk-estimator {font-family: monospace;background-color: #f0f8ff;border: 1px dotted black;border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;}#sk-container-id-2 div.sk-estimator:hover {background-color: #d4ebff;}#sk-container-id-2 div.sk-parallel-item::after {content: \"\";width: 100%;border-bottom: 1px solid gray;flex-grow: 1;}#sk-container-id-2 div.sk-label:hover label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-2 div.sk-serial::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: 0;}#sk-container-id-2 div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: white;padding-right: 0.2em;padding-left: 0.2em;position: relative;}#sk-container-id-2 div.sk-item {position: relative;z-index: 1;}#sk-container-id-2 div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: white;position: relative;}#sk-container-id-2 div.sk-item::before, #sk-container-id-2 div.sk-parallel-item::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: -1;}#sk-container-id-2 div.sk-parallel-item {display: flex;flex-direction: column;z-index: 1;position: relative;background-color: white;}#sk-container-id-2 div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;}#sk-container-id-2 div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;}#sk-container-id-2 div.sk-parallel-item:only-child::after {width: 0;}#sk-container-id-2 div.sk-dashed-wrapped {border: 1px dashed gray;margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: white;}#sk-container-id-2 div.sk-label label {font-family: monospace;font-weight: bold;display: inline-block;line-height: 1.2em;}#sk-container-id-2 div.sk-label-container {text-align: center;}#sk-container-id-2 div.sk-container {/* jupyter's `normalize.less` sets `[hidden] { display: none; }` but bootstrap.min.css set `[hidden] { display: none !important; }` so we also need the `!important` here to be able to override the default hidden behavior on the sphinx rendered scikit-learn.org. See: https://github.com/scikit-learn/scikit-learn/issues/21755 */display: inline-block !important;position: relative;}#sk-container-id-2 div.sk-text-repr-fallback {display: none;}</style><div id=\"sk-container-id-2\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>GridSearchCV(estimator=Pipeline(steps=[(&#x27;standardscaler&#x27;, StandardScaler()),\n", " (&#x27;baggingclassifier&#x27;,\n", " BaggingClassifier(bootstrap=False,\n", " estimator=KNeighborsClassifier(n_neighbors=500,\n", " weights=&#x27;distance&#x27;),\n", " max_features=9,\n", " n_estimators=100,\n", " random_state=1))]),\n", " param_grid={}, scoring=&#x27;roc_auc&#x27;)</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item sk-dashed-wrapped\"><div class=\"sk-label-container\"><div class=\"sk-label sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-4\" type=\"checkbox\" ><label for=\"sk-estimator-id-4\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">GridSearchCV</label><div class=\"sk-toggleable__content\"><pre>GridSearchCV(estimator=Pipeline(steps=[(&#x27;standardscaler&#x27;, StandardScaler()),\n", " (&#x27;baggingclassifier&#x27;,\n", " BaggingClassifier(bootstrap=False,\n", " estimator=KNeighborsClassifier(n_neighbors=500,\n", " weights=&#x27;distance&#x27;),\n", " max_features=9,\n", " n_estimators=100,\n", " random_state=1))]),\n", " param_grid={}, scoring=&#x27;roc_auc&#x27;)</pre></div></div></div><div class=\"sk-parallel\"><div class=\"sk-parallel-item\"><div class=\"sk-item\"><div class=\"sk-label-container\"><div class=\"sk-label sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-5\" type=\"checkbox\" ><label for=\"sk-estimator-id-5\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">estimator: Pipeline</label><div class=\"sk-toggleable__content\"><pre>Pipeline(steps=[(&#x27;standardscaler&#x27;, StandardScaler()),\n", " (&#x27;baggingclassifier&#x27;,\n", " BaggingClassifier(bootstrap=False,\n", " estimator=KNeighborsClassifier(n_neighbors=500,\n", " weights=&#x27;distance&#x27;),\n", " max_features=9, n_estimators=100,\n", " random_state=1))])</pre></div></div></div><div class=\"sk-serial\"><div class=\"sk-item\"><div class=\"sk-serial\"><div class=\"sk-item\"><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-6\" type=\"checkbox\" ><label for=\"sk-estimator-id-6\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">StandardScaler</label><div class=\"sk-toggleable__content\"><pre>StandardScaler()</pre></div></div></div><div class=\"sk-item sk-dashed-wrapped\"><div class=\"sk-label-container\"><div class=\"sk-label sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-7\" type=\"checkbox\" ><label for=\"sk-estimator-id-7\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">baggingclassifier: BaggingClassifier</label><div class=\"sk-toggleable__content\"><pre>BaggingClassifier(bootstrap=False,\n", " estimator=KNeighborsClassifier(n_neighbors=500,\n", " weights=&#x27;distance&#x27;),\n", " max_features=9, n_estimators=100, random_state=1)</pre></div></div></div><div class=\"sk-parallel\"><div class=\"sk-parallel-item\"><div class=\"sk-item\"><div class=\"sk-label-container\"><div class=\"sk-label sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-8\" type=\"checkbox\" ><label for=\"sk-estimator-id-8\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">estimator: KNeighborsClassifier</label><div class=\"sk-toggleable__content\"><pre>KNeighborsClassifier(n_neighbors=500, weights=&#x27;distance&#x27;)</pre></div></div></div><div class=\"sk-serial\"><div class=\"sk-item\"><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-9\" type=\"checkbox\" ><label for=\"sk-estimator-id-9\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">KNeighborsClassifier</label><div class=\"sk-toggleable__content\"><pre>KNeighborsClassifier(n_neighbors=500, weights=&#x27;distance&#x27;)</pre></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>" ], "text/plain": [ "GridSearchCV(estimator=Pipeline(steps=[('standardscaler', StandardScaler()),\n", " ('baggingclassifier',\n", " BaggingClassifier(bootstrap=False,\n", " estimator=KNeighborsClassifier(n_neighbors=500,\n", " weights='distance'),\n", " max_features=9,\n", " n_estimators=100,\n", " random_state=1))]),\n", " param_grid={}, scoring='roc_auc')" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "model = make_pipeline(StandardScaler(),\n", " BaggingClassifier(KNeighborsClassifier(n_neighbors=500,\n", " weights='distance'),\n", " n_estimators=100,\n", " bootstrap=False,\n", " max_features=9,\n", " random_state=1))\n", "\n", "\n", "gcv2 = GridSearchCV(model,\n", " {},\n", " refit=True,\n", " scoring = 'roc_auc')\n", "gcv2.fit(X, y2)" ] }, { "cell_type": "code", "execution_count": 12, "id": "23293917", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:16:58.343713Z", "iopub.status.busy": "2023-07-05T10:16:58.343313Z", "iopub.status.idle": "2023-07-05T10:16:58.350873Z", "shell.execute_reply": "2023-07-05T10:16:58.349411Z" }, "papermill": { "duration": 0.018682, "end_time": "2023-07-05T10:16:58.353189", "exception": false, "start_time": "2023-07-05T10:16:58.334507", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "0.5867603208553923" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gcv2.best_score_" ] }, { "cell_type": "markdown", "id": "99c06741", "metadata": { "papermill": { "duration": 0.00757, "end_time": "2023-07-05T10:16:58.368330", "exception": false, "start_time": "2023-07-05T10:16:58.360760", "status": "completed" }, "tags": [] }, "source": [ "# Submission" ] }, { "cell_type": "code", "execution_count": 13, "id": "d38fee7f", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:16:58.385117Z", "iopub.status.busy": "2023-07-05T10:16:58.384704Z", "iopub.status.idle": "2023-07-05T10:22:10.944470Z", "shell.execute_reply": "2023-07-05T10:22:10.943459Z" }, "papermill": { "duration": 312.571536, "end_time": "2023-07-05T10:22:10.947315", "exception": false, "start_time": "2023-07-05T10:16:58.375779", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "X_test = pd.read_csv('/kaggle/input/playground-series-s3e18/test.csv')\n", "ids = X_test.pop('id')\n", "\n", "y1_test = gcv1.predict_proba(X_test)[:,1]\n", "y2_test = gcv2.predict_proba(X_test)[:,1]" ] }, { "cell_type": "code", "execution_count": 14, "id": "d98dff79", "metadata": { "execution": { "iopub.execute_input": "2023-07-05T10:22:10.965526Z", "iopub.status.busy": "2023-07-05T10:22:10.964836Z", "iopub.status.idle": "2023-07-05T10:22:11.039388Z", "shell.execute_reply": "2023-07-05T10:22:11.038304Z" }, "papermill": { "duration": 0.086839, "end_time": "2023-07-05T10:22:11.041982", "exception": false, "start_time": "2023-07-05T10:22:10.955143", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "submit = pd.DataFrame({'id':ids, 'EC1':y1_test, 'EC2':y2_test})\n", "submit.to_csv('submission.csv', index=False)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.10" }, "papermill": { "default_parameters": {}, "duration": 783.58183, "end_time": "2023-07-05T10:22:12.377083", "environment_variables": {}, "exception": null, "input_path": "__notebook__.ipynb", "output_path": "__notebook__.ipynb", "parameters": {}, "start_time": "2023-07-05T10:09:08.795253", "version": "2.4.0" } }, "nbformat": 4, "nbformat_minor": 5 }
0135/796/135796633.ipynb
s3://data-agents/kaggle-outputs/sharded/031_00135.jsonl.gz
"{\n \"cells\": [\n {\n \"cell_type\": \"code\",\n \"execution_count\": 1,\n \"id\": \"ebc8a1(...TRUNCATED)
0135/796/135796685.ipynb
s3://data-agents/kaggle-outputs/sharded/031_00135.jsonl.gz
"{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"id\": \"359a818d\",\n \"metadata\": (...TRUNCATED)
0135/796/135796891.ipynb
s3://data-agents/kaggle-outputs/sharded/031_00135.jsonl.gz
"{\n \"cells\": [\n {\n \"cell_type\": \"code\",\n \"execution_count\": 1,\n \"id\": \"4f9ce7(...TRUNCATED)
0135/797/135797185.ipynb
s3://data-agents/kaggle-outputs/sharded/031_00135.jsonl.gz
"{\"metadata\":{\"colab\":{\"provenance\":[]},\"kernelspec\":{\"name\":\"python3\",\"display_name\":(...TRUNCATED)
0135/797/135797225.ipynb
s3://data-agents/kaggle-outputs/sharded/031_00135.jsonl.gz
"{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"metadata\": {\n \"papermill\": {\n (...TRUNCATED)
0135/797/135797384.ipynb
s3://data-agents/kaggle-outputs/sharded/031_00135.jsonl.gz
"{\n \"cells\": [\n {\n \"cell_type\": \"code\",\n \"execution_count\": 1,\n \"id\": \"ddee40(...TRUNCATED)
0135/797/135797498.ipynb
s3://data-agents/kaggle-outputs/sharded/031_00135.jsonl.gz
README.md exists but content is empty.
Downloads last month
7