{"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 os\nimport tensorflow as tf","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-02-17T06:57:37.836589Z","iopub.execute_input":"2022-02-17T06:57:37.836987Z","iopub.status.idle":"2022-02-17T06:57:43.183266Z","shell.execute_reply.started":"2022-02-17T06:57:37.836946Z","shell.execute_reply":"2022-02-17T06:57:43.182073Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## In order to 'Recommend' something first, we need to undertand about the product that we are Recommeding!","metadata":{}},{"cell_type":"code","source":"articles = pd.read_csv('/kaggle/input/h-and-m-personalized-fashion-recommendations/articles.csv')","metadata":{"execution":{"iopub.status.busy":"2022-02-17T06:57:43.184977Z","iopub.execute_input":"2022-02-17T06:57:43.185292Z","iopub.status.idle":"2022-02-17T06:57:44.452892Z","shell.execute_reply.started":"2022-02-17T06:57:43.185250Z","shell.execute_reply":"2022-02-17T06:57:44.451968Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### We see the id and description for products don't sum up lets undertand why?","metadata":{}},{"cell_type":"code","source":"articles.nunique()","metadata":{"execution":{"iopub.status.busy":"2022-02-17T06:57:44.456589Z","iopub.execute_input":"2022-02-17T06:57:44.456868Z","iopub.status.idle":"2022-02-17T06:57:44.636694Z","shell.execute_reply.started":"2022-02-17T06:57:44.456839Z","shell.execute_reply":"2022-02-17T06:57:44.635929Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"articles.head(2)","metadata":{"execution":{"iopub.status.busy":"2022-02-17T07:20:02.249762Z","iopub.execute_input":"2022-02-17T07:20:02.250093Z","iopub.status.idle":"2022-02-17T07:20:02.277874Z","shell.execute_reply.started":"2022-02-17T07:20:02.250062Z","shell.execute_reply":"2022-02-17T07:20:02.277073Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### Let's start with section first, we see there are 57 section_no and 56 section_names i.e. 2 section_no have the sames names ! Lets find out","metadata":{}},{"cell_type":"code","source":"section = articles[['section_no','section_name']].drop_duplicates()\nsection.reset_index(drop=True, inplace = True)\nsection[section.section_name.duplicated()]","metadata":{"execution":{"iopub.status.busy":"2022-02-17T07:08:29.230507Z","iopub.execute_input":"2022-02-17T07:08:29.230858Z","iopub.status.idle":"2022-02-17T07:08:29.255174Z","shell.execute_reply.started":"2022-02-17T07:08:29.230825Z","shell.execute_reply":"2022-02-17T07:08:29.254104Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"section[section.section_name=='Ladies Other']","metadata":{"execution":{"iopub.status.busy":"2022-02-17T07:22:31.666920Z","iopub.execute_input":"2022-02-17T07:22:31.667268Z","iopub.status.idle":"2022-02-17T07:22:31.681191Z","shell.execute_reply.started":"2022-02-17T07:22:31.667234Z","shell.execute_reply":"2022-02-17T07:22:31.680298Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# This section has differnt product types, \narticles[articles.section_name  == 'Ladies Other']","metadata":{"execution":{"iopub.status.busy":"2022-02-17T07:24:35.828903Z","iopub.execute_input":"2022-02-17T07:24:35.829697Z","iopub.status.idle":"2022-02-17T07:24:35.874317Z","shell.execute_reply.started":"2022-02-17T07:24:35.829657Z","shell.execute_reply":"2022-02-17T07:24:35.873462Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"## lets check out others","metadata":{"execution":{"iopub.status.busy":"2022-02-17T07:24:50.762874Z","iopub.execute_input":"2022-02-17T07:24:50.763462Z","iopub.status.idle":"2022-02-17T07:24:50.767678Z","shell.execute_reply.started":"2022-02-17T07:24:50.763425Z","shell.execute_reply":"2022-02-17T07:24:50.766668Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"product = articles[['product_code','prod_name']].drop_duplicates()","metadata":{"execution":{"iopub.status.busy":"2022-02-17T07:08:25.605026Z","iopub.execute_input":"2022-02-17T07:08:25.605374Z","iopub.status.idle":"2022-02-17T07:08:25.643740Z","shell.execute_reply.started":"2022-02-17T07:08:25.605337Z","shell.execute_reply":"2022-02-17T07:08:25.642693Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"product[product.prod_name.duplicated()]","metadata":{"execution":{"iopub.status.busy":"2022-02-17T07:09:19.138031Z","iopub.execute_input":"2022-02-17T07:09:19.138886Z","iopub.status.idle":"2022-02-17T07:09:19.163124Z","shell.execute_reply.started":"2022-02-17T07:09:19.138839Z","shell.execute_reply":"2022-02-17T07:09:19.162467Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"articles[articles.prod_name  == 'ELLA 5-p shaftless']","metadata":{"execution":{"iopub.status.busy":"2022-02-17T07:10:07.642145Z","iopub.execute_input":"2022-02-17T07:10:07.642521Z","iopub.status.idle":"2022-02-17T07:10:07.688674Z","shell.execute_reply.started":"2022-02-17T07:10:07.642485Z","shell.execute_reply":"2022-02-17T07:10:07.687947Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"prodtype = articles[['product_type_no','product_type_name']].drop_duplicates()\nprodtype.reset_index(drop=True, inplace = True)\nprodtype[prodtype.product_type_name.duplicated()]","metadata":{"execution":{"iopub.status.busy":"2022-02-17T07:27:36.156066Z","iopub.execute_input":"2022-02-17T07:27:36.156414Z","iopub.status.idle":"2022-02-17T07:27:36.183435Z","shell.execute_reply.started":"2022-02-17T07:27:36.156376Z","shell.execute_reply":"2022-02-17T07:27:36.182552Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"articles[articles.product_type_name  == 'Umbrella']","metadata":{"execution":{"iopub.status.busy":"2022-02-17T07:28:01.074096Z","iopub.execute_input":"2022-02-17T07:28:01.074406Z","iopub.status.idle":"2022-02-17T07:28:01.133431Z","shell.execute_reply.started":"2022-02-17T07:28:01.074375Z","shell.execute_reply":"2022-02-17T07:28:01.132446Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"department = articles[['department_no','department_name']].drop_duplicates()\ndepartment.reset_index(drop=True, inplace = True)\ndepartment[department.department_name.duplicated()]","metadata":{"execution":{"iopub.status.busy":"2022-02-17T07:35:10.411170Z","iopub.execute_input":"2022-02-17T07:35:10.411529Z","iopub.status.idle":"2022-02-17T07:35:10.444699Z","shell.execute_reply.started":"2022-02-17T07:35:10.411492Z","shell.execute_reply":"2022-02-17T07:35:10.444095Z"},"collapsed":true,"jupyter":{"outputs_hidden":true},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"articles[articles.department_name  == 'Shirt'].nunique()","metadata":{"execution":{"iopub.status.busy":"2022-02-17T07:38:49.428492Z","iopub.execute_input":"2022-02-17T07:38:49.428845Z","iopub.status.idle":"2022-02-17T07:38:49.464641Z","shell.execute_reply.started":"2022-02-17T07:38:49.428808Z","shell.execute_reply":"2022-02-17T07:38:49.463011Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# After above analysis we can see that 'section_no', 'product_code' and 'product_type' , 'department_name' and 'index_group_no' can play an important role while making recommendations","metadata":{}},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}