{"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 numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)","metadata":{"_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","execution":{"iopub.execute_input":"2023-02-04T16:29:10.365272Z","iopub.status.busy":"2023-02-04T16:29:10.364678Z","iopub.status.idle":"2023-02-04T16:29:10.377365Z","shell.execute_reply":"2023-02-04T16:29:10.376505Z"},"papermill":{"duration":0.020512,"end_time":"2023-02-04T16:29:10.379758","exception":false,"start_time":"2023-02-04T16:29:10.359246","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df = pd.read_csv('../input/h-and-m-personalized-fashion-recommendations/articles.csv', dtype=str)","metadata":{"execution":{"iopub.execute_input":"2023-02-04T16:29:10.386768Z","iopub.status.busy":"2023-02-04T16:29:10.385864Z","iopub.status.idle":"2023-02-04T16:29:11.823108Z","shell.execute_reply":"2023-02-04T16:29:11.822173Z"},"papermill":{"duration":1.443337,"end_time":"2023-02-04T16:29:11.825818","exception":false,"start_time":"2023-02-04T16:29:10.382481","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df = df[['article_id', 'product_type_name',\n       'product_group_name', \n       'graphical_appearance_name', 'colour_group_name',\n       'perceived_colour_value_name',\n       'perceived_colour_master_name',\n       'department_name', 'index_name',\n       'index_group_name', 'section_name',\n       'garment_group_name']]","metadata":{"execution":{"iopub.execute_input":"2023-02-04T16:29:11.835222Z","iopub.status.busy":"2023-02-04T16:29:11.834557Z","iopub.status.idle":"2023-02-04T16:29:11.878924Z","shell.execute_reply":"2023-02-04T16:29:11.877593Z"},"papermill":{"duration":0.051229,"end_time":"2023-02-04T16:29:11.881566","exception":false,"start_time":"2023-02-04T16:29:11.830337","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"feature_subset = ['product_group_name', 'product_type_name',\n       'graphical_appearance_name', 'colour_group_name',\n       'perceived_colour_value_name',\n       'perceived_colour_master_name',\n       'department_name', 'index_name',\n       'index_group_name', 'section_name',\n       'garment_group_name']","metadata":{"execution":{"iopub.execute_input":"2023-02-04T16:29:11.888460Z","iopub.status.busy":"2023-02-04T16:29:11.888044Z","iopub.status.idle":"2023-02-04T16:29:11.895188Z","shell.execute_reply":"2023-02-04T16:29:11.894318Z"},"papermill":{"duration":0.012843,"end_time":"2023-02-04T16:29:11.897197","exception":false,"start_time":"2023-02-04T16:29:11.884354","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dum = pd.get_dummies(df, columns=feature_subset)","metadata":{"execution":{"iopub.execute_input":"2023-02-04T16:29:11.903910Z","iopub.status.busy":"2023-02-04T16:29:11.903304Z","iopub.status.idle":"2023-02-04T16:29:12.434485Z","shell.execute_reply":"2023-02-04T16:29:12.433259Z"},"papermill":{"duration":0.537525,"end_time":"2023-02-04T16:29:12.437202","exception":false,"start_time":"2023-02-04T16:29:11.899677","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import pickle \nwith open('article_embeddings_from_features.pickle', 'wb') as f:\n    pickle.dump(dum, f)","metadata":{"execution":{"iopub.execute_input":"2023-02-04T16:29:12.443715Z","iopub.status.busy":"2023-02-04T16:29:12.443327Z","iopub.status.idle":"2023-02-04T16:29:12.559774Z","shell.execute_reply":"2023-02-04T16:29:12.558570Z"},"papermill":{"duration":0.12291,"end_time":"2023-02-04T16:29:12.562692","exception":false,"start_time":"2023-02-04T16:29:12.439782","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]}]}