{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.14","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":31254,"databundleVersionId":3103714,"sourceType":"competition"}],"dockerImageVersionId":30786,"isInternetEnabled":false,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import numpy as np\nimport pandas as pd\nimport os\nfrom tqdm import tqdm\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom wordcloud import WordCloud, STOPWORDS\nfrom datetime import datetime\nfrom PIL import Image","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2024-10-14T16:24:53.489827Z","iopub.execute_input":"2024-10-14T16:24:53.490752Z","iopub.status.idle":"2024-10-14T16:24:56.266023Z","shell.execute_reply.started":"2024-10-14T16:24:53.490707Z","shell.execute_reply":"2024-10-14T16:24:56.264907Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(f\"files and folders: {os.listdir('/kaggle/input/h-and-m-personalized-fashion-recommendations/')}\")\nprint(\"Subfolders in images folder: \", len(list(os.listdir(\"/kaggle/input/h-and-m-personalized-fashion-recommendations/images\"))))","metadata":{"execution":{"iopub.status.busy":"2024-10-14T16:30:08.432732Z","iopub.execute_input":"2024-10-14T16:30:08.4331Z","iopub.status.idle":"2024-10-14T16:30:08.439584Z","shell.execute_reply.started":"2024-10-14T16:30:08.433065Z","shell.execute_reply":"2024-10-14T16:30:08.438546Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"total_folders = total_files = 0\nfolder_info = []\nimages_names = []\nfor base, dirs, files in tqdm(os.walk('/kaggle/input/h-and-m-personalized-fashion-recommendations/')):\n    for directories in dirs:\n        folder_info.append((directories, len(os.listdir(os.path.join(base, directories)))))\n        total_folders += 1\n    for _files in files:\n        total_files += 1\n        if len(_files.split(\".jpg\"))==2:\n            images_names.append(_files.split(\".jpg\")[0])","metadata":{"execution":{"iopub.status.busy":"2024-10-14T16:30:33.174965Z","iopub.execute_input":"2024-10-14T16:30:33.17545Z","iopub.status.idle":"2024-10-14T16:33:07.359834Z","shell.execute_reply.started":"2024-10-14T16:30:33.175402Z","shell.execute_reply":"2024-10-14T16:33:07.358704Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(f\"Total number of folders: {total_folders}\\nTotal number of files: {total_files}\")\nfolder_info_df = pd.DataFrame(folder_info, columns=[\"folder\", \"files count\"])\nfolder_info_df.sort_values([\"files count\"], ascending=False).head()","metadata":{"execution":{"iopub.status.busy":"2024-10-14T16:33:07.362014Z","iopub.execute_input":"2024-10-14T16:33:07.362485Z","iopub.status.idle":"2024-10-14T16:33:07.391502Z","shell.execute_reply.started":"2024-10-14T16:33:07.362434Z","shell.execute_reply":"2024-10-14T16:33:07.390273Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(\"folder names: \", list(folder_info_df.folder.unique()))\n","metadata":{"execution":{"iopub.status.busy":"2024-10-14T16:33:07.392827Z","iopub.execute_input":"2024-10-14T16:33:07.393191Z","iopub.status.idle":"2024-10-14T16:33:07.406251Z","shell.execute_reply.started":"2024-10-14T16:33:07.393154Z","shell.execute_reply":"2024-10-14T16:33:07.405261Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"articles_df = pd.read_csv(\"/kaggle/input/h-and-m-personalized-fashion-recommendations/articles.csv\")\ncustomers_df = pd.read_csv(\"/kaggle/input/h-and-m-personalized-fashion-recommendations/customers.csv\")\nsample_submission_df = pd.read_csv(\"/kaggle/input/h-and-m-personalized-fashion-recommendations/sample_submission.csv\")","metadata":{"execution":{"iopub.status.busy":"2024-10-14T16:33:07.408407Z","iopub.execute_input":"2024-10-14T16:33:07.409287Z","iopub.status.idle":"2024-10-14T16:33:21.248108Z","shell.execute_reply.started":"2024-10-14T16:33:07.409237Z","shell.execute_reply":"2024-10-14T16:33:21.246935Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"transactions_train_df = pd.read_csv(\"/kaggle/input/h-and-m-personalized-fashion-recommendations/transactions_train.csv\")","metadata":{"execution":{"iopub.status.busy":"2024-10-14T16:33:21.249643Z","iopub.execute_input":"2024-10-14T16:33:21.250023Z","iopub.status.idle":"2024-10-14T16:34:40.350896Z","shell.execute_reply.started":"2024-10-14T16:33:21.249974Z","shell.execute_reply":"2024-10-14T16:34:40.350001Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"articles_df.head()\n","metadata":{"execution":{"iopub.status.busy":"2024-10-14T16:34:40.352954Z","iopub.execute_input":"2024-10-14T16:34:40.353323Z","iopub.status.idle":"2024-10-14T16:34:40.375366Z","shell.execute_reply.started":"2024-10-14T16:34:40.353285Z","shell.execute_reply":"2024-10-14T16:34:40.374298Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"customers_df.head()\n","metadata":{"execution":{"iopub.status.busy":"2024-10-14T16:34:40.379865Z","iopub.execute_input":"2024-10-14T16:34:40.380593Z","iopub.status.idle":"2024-10-14T16:34:40.395705Z","shell.execute_reply.started":"2024-10-14T16:34:40.380514Z","shell.execute_reply":"2024-10-14T16:34:40.394682Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sample_submission_df.head()\n","metadata":{"execution":{"iopub.status.busy":"2024-10-14T16:34:40.397092Z","iopub.execute_input":"2024-10-14T16:34:40.397435Z","iopub.status.idle":"2024-10-14T16:34:40.411158Z","shell.execute_reply.started":"2024-10-14T16:34:40.397399Z","shell.execute_reply":"2024-10-14T16:34:40.410273Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"transactions_train_df.head()\n","metadata":{"execution":{"iopub.status.busy":"2024-10-14T16:34:40.4124Z","iopub.execute_input":"2024-10-14T16:34:40.412836Z","iopub.status.idle":"2024-10-14T16:34:40.426328Z","shell.execute_reply.started":"2024-10-14T16:34:40.412799Z","shell.execute_reply":"2024-10-14T16:34:40.425163Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Tiền xử lý dữ liệu","metadata":{}},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# EDA dữ liệu","metadata":{}},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Test mô hình","metadata":{}},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}