{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import pandas as pd\nimport numpy as np\nimport cv2\nimport matplotlib.pyplot as plt\nimport os\nimport random\nimport sys\nfrom tqdm.autonotebook import tqdm\nimport seaborn as sns\nimport glob","metadata":{"_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","papermill":{"duration":1.074775,"end_time":"2021-05-17T14:34:53.043368","exception":false,"start_time":"2021-05-17T14:34:51.968593","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-06-12T21:20:57.129608Z","iopub.execute_input":"2023-06-12T21:20:57.129955Z","iopub.status.idle":"2023-06-12T21:20:58.906077Z","shell.execute_reply.started":"2023-06-12T21:20:57.129928Z","shell.execute_reply":"2023-06-12T21:20:58.904543Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_data = pd.read_csv('/kaggle/input/hotel-id-2021-fgvc8/train.csv')\ns1 = pd.read_csv('/kaggle/input/hotel-id-2021-fgvc8/sample_submission.csv')","metadata":{"papermill":{"duration":0.240484,"end_time":"2021-05-17T14:34:53.293964","exception":false,"start_time":"2021-05-17T14:34:53.053480","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-06-12T21:21:13.712607Z","iopub.execute_input":"2023-06-12T21:21:13.713535Z","iopub.status.idle":"2023-06-12T21:21:13.866559Z","shell.execute_reply.started":"2023-06-12T21:21:13.713509Z","shell.execute_reply":"2023-06-12T21:21:13.865347Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print('Train samples:', len(train_data))\nprint('Chains =', len(('/kaggle/input/hotel-id-2021-fgvc8/train_images')))","metadata":{"papermill":{"duration":0.018942,"end_time":"2021-05-17T14:34:53.322109","exception":false,"start_time":"2021-05-17T14:34:53.303167","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-06-12T21:21:19.523046Z","iopub.execute_input":"2023-06-12T21:21:19.523451Z","iopub.status.idle":"2023-06-12T21:21:19.528454Z","shell.execute_reply.started":"2023-06-12T21:21:19.523424Z","shell.execute_reply":"2023-06-12T21:21:19.527219Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_data.head()","metadata":{"papermill":{"duration":0.041747,"end_time":"2021-05-17T14:34:53.373472","exception":false,"start_time":"2021-05-17T14:34:53.331725","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-06-12T21:21:23.294823Z","iopub.execute_input":"2023-06-12T21:21:23.295355Z","iopub.status.idle":"2023-06-12T21:21:23.324684Z","shell.execute_reply.started":"2023-06-12T21:21:23.295333Z","shell.execute_reply":"2023-06-12T21:21:23.323431Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_data.info()","metadata":{"papermill":{"duration":0.055291,"end_time":"2021-05-17T14:34:53.438903","exception":false,"start_time":"2021-05-17T14:34:53.383612","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-06-12T21:21:26.993113Z","iopub.execute_input":"2023-06-12T21:21:26.993493Z","iopub.status.idle":"2023-06-12T21:21:27.053471Z","shell.execute_reply.started":"2023-06-12T21:21:26.993468Z","shell.execute_reply":"2023-06-12T21:21:27.051853Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print('Chain IDs = ', len(train_data['chain'].unique()))","metadata":{"papermill":{"duration":0.02379,"end_time":"2021-05-17T14:34:53.474020","exception":false,"start_time":"2021-05-17T14:34:53.450230","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-06-12T21:21:41.888464Z","iopub.execute_input":"2023-06-12T21:21:41.888833Z","iopub.status.idle":"2023-06-12T21:21:41.895542Z","shell.execute_reply.started":"2023-06-12T21:21:41.888811Z","shell.execute_reply":"2023-06-12T21:21:41.894652Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print('Hotel IDs =', len(train_data['hotel_id'].unique()))","metadata":{"papermill":{"duration":0.023455,"end_time":"2021-05-17T14:34:53.509425","exception":false,"start_time":"2021-05-17T14:34:53.485970","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-06-12T21:21:45.066881Z","iopub.execute_input":"2023-06-12T21:21:45.067535Z","iopub.status.idle":"2023-06-12T21:21:45.075384Z","shell.execute_reply.started":"2023-06-12T21:21:45.067503Z","shell.execute_reply":"2023-06-12T21:21:45.074103Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_data.groupby(['chain', 'hotel_id']).count()","metadata":{"papermill":{"duration":0.068356,"end_time":"2021-05-17T14:34:53.590789","exception":false,"start_time":"2021-05-17T14:34:53.522433","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-06-12T21:21:55.055790Z","iopub.execute_input":"2023-06-12T21:21:55.056140Z","iopub.status.idle":"2023-06-12T21:21:55.103568Z","shell.execute_reply.started":"2023-06-12T21:21:55.056093Z","shell.execute_reply":"2023-06-12T21:21:55.102629Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_data['chain'].value_counts()","metadata":{"papermill":{"duration":0.025295,"end_time":"2021-05-17T14:34:53.628438","exception":false,"start_time":"2021-05-17T14:34:53.603143","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-06-12T21:21:58.344820Z","iopub.execute_input":"2023-06-12T21:21:58.346148Z","iopub.status.idle":"2023-06-12T21:21:58.357104Z","shell.execute_reply.started":"2023-06-12T21:21:58.346087Z","shell.execute_reply":"2023-06-12T21:21:58.355176Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pred = s1.copy()\npred['hotel_id'] = 5398\nfile_path = '/kaggle/working/submission.csv'\npred.to_csv(file_path, index=False)\npred","metadata":{"papermill":{"duration":0.029697,"end_time":"2021-05-17T14:34:53.670993","exception":false,"start_time":"2021-05-17T14:34:53.641296","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2023-06-12T21:22:01.584711Z","iopub.execute_input":"2023-06-12T21:22:01.585066Z","iopub.status.idle":"2023-06-12T21:22:01.603353Z","shell.execute_reply.started":"2023-06-12T21:22:01.585038Z","shell.execute_reply":"2023-06-12T21:22:01.602167Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"papermill":{"duration":0.0127,"end_time":"2021-05-17T14:34:53.696981","exception":false,"start_time":"2021-05-17T14:34:53.684281","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]}]}