{"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":"markdown","source":"<div style='background-color:#0071dc;text-align: center;padding:10px;'>\n    <h1 style='color:white; font-family: Verdana'> <img alt='Walmart' src='https://i5.wal.co/dfw/63fd9f59-b3e1/7a569e53-f29a-4c3d-bfaf-6f7a158bfadd/v1/walmartLogo.svg'> Store Sales Forecasting </h1>\n</div>","metadata":{"_uuid":"e5ce483f-1dcc-485b-a22d-2936ca1aff29","_cell_guid":"b2ab8b89-bcf0-44fb-9eb7-cc8017a34bb1","trusted":true}},{"cell_type":"markdown","source":"<h2 style='color:#ffc220; font-family: Verdana'> Imports </h2>","metadata":{"_uuid":"17914c31-e7aa-44e3-9261-c9ed7206dae7","_cell_guid":"cb37c63c-e126-4e0c-8e8a-c3fe3121d428","trusted":true}},{"cell_type":"code","source":"from os import listdir\nfrom os.path import isfile, join","metadata":{"_uuid":"3eebafd3-7798-4a8c-8557-1821ca234e75","_cell_guid":"b939a082-a5d6-4563-a9e2-f19793ca7067","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T01:11:12.927389Z","start_time":"2022-07-01T01:11:12.920391Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:32.821460Z","iopub.execute_input":"2022-07-06T23:36:32.821966Z","iopub.status.idle":"2022-07-06T23:36:32.853769Z","shell.execute_reply.started":"2022-07-06T23:36:32.821867Z","shell.execute_reply":"2022-07-06T23:36:32.852754Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import zipfile\nimport time","metadata":{"_uuid":"0953816e-3157-4cc1-91f8-b59cd9e8a2c9","_cell_guid":"17048c34-3c1c-4d6a-a376-00d13ec21d8e","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T01:11:13.409585Z","start_time":"2022-07-01T01:11:13.398584Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:33.176830Z","iopub.execute_input":"2022-07-06T23:36:33.177483Z","iopub.status.idle":"2022-07-06T23:36:33.183707Z","shell.execute_reply.started":"2022-07-06T23:36:33.177433Z","shell.execute_reply":"2022-07-06T23:36:33.181928Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import pandas as pd\npd.set_option('display.max_columns', None)\nimport numpy as np\nfrom scipy.stats import randint, loguniform\n\nimport matplotlib.pyplot as plt\nimport plotly.express as px\nfrom plotly.offline import plot, iplot, init_notebook_mode\nimport plotly.graph_objs as go\ninit_notebook_mode(connected=True)\nfrom matplotlib.ticker import FuncFormatter\nimport matplotlib.dates as mdates\nimport seaborn as sns\n%matplotlib inline\nsns.set_style('darkgrid')","metadata":{"_uuid":"b5cb357f-27ed-4385-845c-d4d4ebd000a5","_cell_guid":"7eb704ac-7aff-468d-93b0-af0a404c50a8","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T01:11:19.302773Z","start_time":"2022-07-01T01:11:19.291772Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:33.507282Z","iopub.execute_input":"2022-07-06T23:36:33.508648Z","iopub.status.idle":"2022-07-06T23:36:35.459313Z","shell.execute_reply.started":"2022-07-06T23:36:33.508593Z","shell.execute_reply":"2022-07-06T23:36:35.458316Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import shap","metadata":{"_uuid":"b2ab316d-b1a6-46f4-85ce-755c931d87de","_cell_guid":"dc7203af-d3b1-4ebe-a89c-e6c8ea63cef3","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:35.461352Z","iopub.execute_input":"2022-07-06T23:36:35.461695Z","iopub.status.idle":"2022-07-06T23:36:39.068674Z","shell.execute_reply.started":"2022-07-06T23:36:35.461664Z","shell.execute_reply":"2022-07-06T23:36:39.067531Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import datetime","metadata":{"_uuid":"1ce20a62-3659-4847-94ca-04cc1cd14d53","_cell_guid":"f6d17c03-749c-4093-b4bc-7265896f606a","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T01:11:19.678457Z","start_time":"2022-07-01T01:11:19.659136Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:39.070351Z","iopub.execute_input":"2022-07-06T23:36:39.071801Z","iopub.status.idle":"2022-07-06T23:36:39.076968Z","shell.execute_reply.started":"2022-07-06T23:36:39.071749Z","shell.execute_reply":"2022-07-06T23:36:39.075832Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h2 style='color:#ffc220; font-family: Verdana'> Reading the files </h2>","metadata":{"_uuid":"e3a8a7e6-d3f3-4e4a-9088-9cb27bb1241f","_cell_guid":"91dd5491-2d05-46bb-9183-6e741aa227db","trusted":true}},{"cell_type":"markdown","source":"<span style='color:#0071dc; font-family: Verdana'> Looping over all provided files. <span>","metadata":{"_uuid":"791e22cc-1197-4c7a-931a-83209256f204","_cell_guid":"aea4d144-8b79-4727-99a4-ac3a7a2b75a6","trusted":true}},{"cell_type":"code","source":"import os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))","metadata":{"_uuid":"0494eec4-3d08-4bfd-96f7-5c5bd259f07e","_cell_guid":"ddddd1c7-b913-45df-83ff-25edee0fd008","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:39.080257Z","iopub.execute_input":"2022-07-06T23:36:39.081091Z","iopub.status.idle":"2022-07-06T23:36:39.095175Z","shell.execute_reply.started":"2022-07-06T23:36:39.081045Z","shell.execute_reply":"2022-07-06T23:36:39.093988Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"filespath=r'/kaggle/input/walmart-recruiting-store-sales-forecasting/'","metadata":{"_uuid":"65809f73-c053-45af-a36c-915ae83de07a","_cell_guid":"1af21a85-a976-4f41-aac3-017f2dcb44c3","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T01:11:21.988146Z","start_time":"2022-07-01T01:11:21.97614Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:39.097275Z","iopub.execute_input":"2022-07-06T23:36:39.098100Z","iopub.status.idle":"2022-07-06T23:36:39.103498Z","shell.execute_reply.started":"2022-07-06T23:36:39.098055Z","shell.execute_reply":"2022-07-06T23:36:39.102450Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"files_list = [f for f in listdir(filespath) if isfile(join(filespath, f))]\nprint(files_list)","metadata":{"_uuid":"4187438d-3fba-4d3c-b795-f31eaf624791","_cell_guid":"3a2a741a-09f2-4650-bc10-57cda86b9d01","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T01:11:22.822073Z","start_time":"2022-07-01T01:11:22.806028Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:39.105409Z","iopub.execute_input":"2022-07-06T23:36:39.106198Z","iopub.status.idle":"2022-07-06T23:36:39.119916Z","shell.execute_reply.started":"2022-07-06T23:36:39.106154Z","shell.execute_reply":"2022-07-06T23:36:39.118691Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dict_dfs={}\nfor file in files_list:\n    if 'zip' in file:\n        with zipfile.ZipFile(join(filespath, file),'r') as z:\n            print(file)\n            dict_dfs[file.split('.')[0]]=pd.read_csv(z.open('.'.join(file.split('.')[:2])))\n    else:\n        print(file)\n        dict_dfs[file.split('.')[0]]=pd.read_csv(join(filespath, file))","metadata":{"_uuid":"4eeff48e-915c-42eb-9532-bf72c6760c34","_cell_guid":"e50028f2-2480-4e09-a4f3-0611d56d07c4","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T01:11:23.96639Z","start_time":"2022-07-01T01:11:23.54812Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:39.121477Z","iopub.execute_input":"2022-07-06T23:36:39.122474Z","iopub.status.idle":"2022-07-06T23:36:39.677194Z","shell.execute_reply.started":"2022-07-06T23:36:39.122432Z","shell.execute_reply":"2022-07-06T23:36:39.675997Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"for name in dict_dfs:\n    print(name)\n    print(dict_dfs[name].head(),'\\n')","metadata":{"_uuid":"499173e1-6e32-4c67-9980-d120add0e386","_cell_guid":"b4d4b2b4-1f81-47f7-ae8e-8b592af31129","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T01:11:25.979641Z","start_time":"2022-07-01T01:11:25.952611Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:39.678596Z","iopub.execute_input":"2022-07-06T23:36:39.678907Z","iopub.status.idle":"2022-07-06T23:36:39.703889Z","shell.execute_reply.started":"2022-07-06T23:36:39.678879Z","shell.execute_reply":"2022-07-06T23:36:39.702719Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'>\n    <ul>\n        <li>Two core datasets with weekly sales one for training one for testing.</li>\n        <li>Features dataset to merge and bring extra row features.</li>\n        <li>One stores dataset containing features per store number.</li>\n    </ul>\n</span>\n<h5 style='color:gray; font-family: Verdana'>Decision here to try merging both feature datasets with both train and test datasets.</h5>","metadata":{"_uuid":"56883880-282b-4193-9e0b-e437cdd1d420","_cell_guid":"cb5e8889-fe6c-4d53-9d6e-d02ff0a24f5c","ExecuteTime":{"end_time":"2022-07-01T01:15:46.547576Z","start_time":"2022-07-01T01:15:46.521448Z"},"trusted":true}},{"cell_type":"markdown","source":"<h2 style='color:#ffc220; font-family: Verdana'> Exploratory Data Analysis </h2>","metadata":{"_uuid":"f95f597a-2d98-4a04-bfe6-0f4d259c4d6e","_cell_guid":"5f97b19a-9f74-42d7-a23a-72a1136062bf","ExecuteTime":{"end_time":"2022-06-27T04:10:03.866501Z","start_time":"2022-06-27T04:10:03.848505Z"},"trusted":true}},{"cell_type":"markdown","source":"<h3 style='color:#0071dc; font-family: Verdana'> Merge with extra features dataset </h3>","metadata":{"_uuid":"bb9a494e-0533-4bbc-a2d1-1fa7658e9bdb","_cell_guid":"481dbf6c-e589-458d-a931-c1a5985e3f3b","trusted":true}},{"cell_type":"markdown","source":"<span style='color:#0071dc; font-family: Verdana'> Can the Features dataset be joined with train and test csv ? <span>","metadata":{"_uuid":"ad13722f-4101-4b26-b345-9a1653ff06ac","_cell_guid":"906b92b4-cb21-451d-9872-4456b4dffb09","ExecuteTime":{"end_time":"2022-06-28T03:30:52.939718Z","start_time":"2022-06-28T03:30:52.922681Z"},"trusted":true}},{"cell_type":"code","source":"df_trainoteste=pd.DataFrame(pd.concat([dict_dfs['train'],\ndict_dfs['test']]))\ndf_trainoteste=pd.DataFrame(df_trainoteste.drop_duplicates(['Date','Store']).Date.str[2:7])\ndf_trainoteste['dataset']='Treino_e_teste'\ndf_featuresdates=pd.DataFrame(dict_dfs['features'].Date.str[2:7])\ndf_featuresdates['dataset']='Features'","metadata":{"_uuid":"8e93ba6d-b052-4688-b0ba-86139682db0d","_cell_guid":"9afdb50f-2883-4a00-91bb-66feff11920c","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T02:04:51.029135Z","start_time":"2022-07-01T02:04:50.939856Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:39.705276Z","iopub.execute_input":"2022-07-06T23:36:39.705594Z","iopub.status.idle":"2022-07-06T23:36:39.834629Z","shell.execute_reply.started":"2022-07-06T23:36:39.705554Z","shell.execute_reply":"2022-07-06T23:36:39.833410Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dfplotdatas=pd.concat([df_trainoteste,df_featuresdates])","metadata":{"_uuid":"90d2b17c-eb64-4ae8-8313-8ec1097ab934","_cell_guid":"fd831842-67bd-436f-a129-b56a9a03ed82","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T02:04:51.310628Z","start_time":"2022-07-01T02:04:51.292618Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:39.839400Z","iopub.execute_input":"2022-07-06T23:36:39.839744Z","iopub.status.idle":"2022-07-06T23:36:39.847358Z","shell.execute_reply.started":"2022-07-06T23:36:39.839715Z","shell.execute_reply":"2022-07-06T23:36:39.846280Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dfplotdatas=dfplotdatas.groupby(['Date','dataset'],as_index=False).agg(Date=('Date','last'),Count=('Date','count'),dataset=('dataset','last'))","metadata":{"_uuid":"534158fe-8136-499e-bb39-a477cd84fe4a","_cell_guid":"b8849c5e-eeea-4e7b-b43c-549ae44eebb2","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:39.848898Z","iopub.execute_input":"2022-07-06T23:36:39.849359Z","iopub.status.idle":"2022-07-06T23:36:39.882397Z","shell.execute_reply.started":"2022-07-06T23:36:39.849317Z","shell.execute_reply":"2022-07-06T23:36:39.881507Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dfplotdatas.plot.bar(x='Date',y='Count',template='ggplot2',color=\"dataset\",barmode='group',title='Merge features evaluation', color_discrete_sequence=[\"#ffc220\", \"#0071dc\"],backend='plotly')","metadata":{"_uuid":"eb29bc92-e8d0-4ac5-aaa2-30ddcb0a75cb","_cell_guid":"5dc142b6-ab7c-4c8b-9f1e-84b4dfb85f6d","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:39.884362Z","iopub.execute_input":"2022-07-06T23:36:39.884789Z","iopub.status.idle":"2022-07-06T23:36:41.002400Z","shell.execute_reply.started":"2022-07-06T23:36:39.884739Z","shell.execute_reply":"2022-07-06T23:36:41.001107Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'> By looking at date ranges for all the data sets we want to merge, the features data set has the necessary dates to merge withouts missings. <span>","metadata":{"_uuid":"8f1948e4-5dae-45b7-a964-96c4db084d07","_cell_guid":"1b57fadf-da8d-408e-ac00-c6834383a4da","ExecuteTime":{"end_time":"2022-06-28T03:32:34.558488Z","start_time":"2022-06-28T03:32:34.539489Z"},"trusted":true}},{"cell_type":"markdown","source":"<span style='color:#0071dc; font-family: Verdana'> Looking for the keys to join the datasets <span>","metadata":{"_uuid":"253d2faf-5244-417f-b810-1d9daabddaf6","_cell_guid":"aaedc27d-1248-4f4d-b654-31b3a1f2ef55","trusted":true}},{"cell_type":"code","source":"dict_dfs['features'].head()","metadata":{"_uuid":"07f6d49e-c44a-4975-9a14-732629628a9f","_cell_guid":"8c6eb9b1-9dde-45f3-a54e-693ad5b4c546","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T02:32:09.105304Z","start_time":"2022-07-01T02:32:09.085305Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:41.004667Z","iopub.execute_input":"2022-07-06T23:36:41.005126Z","iopub.status.idle":"2022-07-06T23:36:41.027950Z","shell.execute_reply.started":"2022-07-06T23:36:41.005079Z","shell.execute_reply":"2022-07-06T23:36:41.026643Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dict_dfs['test'].head()","metadata":{"_uuid":"a2604e06-5ba3-4f76-ae93-04414720cece","_cell_guid":"d913e066-e460-4bfb-9a76-127c0bfa7d60","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T02:32:11.076584Z","start_time":"2022-07-01T02:32:11.056542Z"},"scrolled":true,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:41.029412Z","iopub.execute_input":"2022-07-06T23:36:41.029786Z","iopub.status.idle":"2022-07-06T23:36:41.042311Z","shell.execute_reply.started":"2022-07-06T23:36:41.029754Z","shell.execute_reply":"2022-07-06T23:36:41.041146Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'> Found both store and Date as keys to use to join. <span>","metadata":{"_uuid":"e726bd61-1281-4f30-8fff-1cef716f3500","_cell_guid":"c145c581-02a9-4fb2-903e-77c73feee6d8","trusted":true}},{"cell_type":"code","source":"dict_dfs['test']=dict_dfs['test'].merge(dict_dfs['features'],how='left',on=['Store','Date'])","metadata":{"_uuid":"4170cf97-a2ef-45b8-8ed8-37b4cd1bb15f","_cell_guid":"ad18b76f-da39-4d80-84da-4a2500bcf475","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T02:32:14.975561Z","start_time":"2022-07-01T02:32:14.941537Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:41.043675Z","iopub.execute_input":"2022-07-06T23:36:41.044338Z","iopub.status.idle":"2022-07-06T23:36:41.086489Z","shell.execute_reply.started":"2022-07-06T23:36:41.044296Z","shell.execute_reply":"2022-07-06T23:36:41.085253Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dict_dfs['train']=dict_dfs['train'].merge(dict_dfs['features'],how='left',on=['Store','Date'])","metadata":{"_uuid":"77aa495e-6edf-4846-b476-dc8aa7ae8606","_cell_guid":"5ddec159-8ee0-47dc-8faa-1153cb163c10","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T02:32:15.807701Z","start_time":"2022-07-01T02:32:15.673418Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:41.088055Z","iopub.execute_input":"2022-07-06T23:36:41.088791Z","iopub.status.idle":"2022-07-06T23:36:41.223150Z","shell.execute_reply.started":"2022-07-06T23:36:41.088741Z","shell.execute_reply":"2022-07-06T23:36:41.221946Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:#0071dc; font-family: Verdana'> Seeing if the IsHoliday feature that repeat in both datasets are the same <span>","metadata":{"_uuid":"ff3b673e-252b-4692-a8a9-325bc25a4112","_cell_guid":"e9ce6d5d-83e0-4b27-8405-ad42bd44e004","trusted":true}},{"cell_type":"code","source":"dict_dfs['train'][dict_dfs['train']['IsHoliday_x']!=dict_dfs['train']['IsHoliday_y']]","metadata":{"_uuid":"0ccb1a00-3731-4c6a-84c7-919d34763006","_cell_guid":"9449bbfb-929a-4735-acf9-1c0b40507304","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T02:32:17.800594Z","start_time":"2022-07-01T02:32:17.751303Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:41.224876Z","iopub.execute_input":"2022-07-06T23:36:41.225362Z","iopub.status.idle":"2022-07-06T23:36:41.270741Z","shell.execute_reply.started":"2022-07-06T23:36:41.225315Z","shell.execute_reply":"2022-07-06T23:36:41.269488Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dict_dfs['test'][dict_dfs['test']['IsHoliday_x']!=dict_dfs['test']['IsHoliday_y']]","metadata":{"_uuid":"909767fd-a9fa-48a2-a93b-dd8fc9c79bde","_cell_guid":"61dd1504-9849-4898-9ab1-026b3077d7f3","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T02:32:18.337751Z","start_time":"2022-07-01T02:32:18.323723Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:41.272115Z","iopub.execute_input":"2022-07-06T23:36:41.272504Z","iopub.status.idle":"2022-07-06T23:36:41.287975Z","shell.execute_reply.started":"2022-07-06T23:36:41.272473Z","shell.execute_reply":"2022-07-06T23:36:41.286644Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'> IsHoliday is the same in both datasets, so one of the columns need to be droped <span>","metadata":{"_uuid":"b91a2414-eceb-4587-9b81-d1adad365b80","_cell_guid":"53513efc-9d75-46ac-8cfd-3daa9ecd9665","ExecuteTime":{"end_time":"2022-06-28T03:28:03.693308Z","start_time":"2022-06-28T03:28:03.648076Z"},"trusted":true}},{"cell_type":"code","source":"dict_dfs['test']=dict_dfs['test'].drop('IsHoliday_y',axis=1)","metadata":{"_uuid":"0b73a55e-7559-4cad-b7c3-b7288dba6715","_cell_guid":"f224ba0d-0a2f-49c6-ab3a-689961cbe169","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T02:32:19.853959Z","start_time":"2022-07-01T02:32:19.832966Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:41.289554Z","iopub.execute_input":"2022-07-06T23:36:41.289986Z","iopub.status.idle":"2022-07-06T23:36:41.299757Z","shell.execute_reply.started":"2022-07-06T23:36:41.289944Z","shell.execute_reply":"2022-07-06T23:36:41.298879Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dict_dfs['test']=dict_dfs['test'].rename(columns={'IsHoliday_x':'IsHoliday'})","metadata":{"_uuid":"155cd683-47ca-43f1-a425-b59ec8fef707","_cell_guid":"b9d0d2c0-52c4-45bb-b8e8-039b460594aa","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T02:32:20.436523Z","start_time":"2022-07-01T02:32:20.415513Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:41.300955Z","iopub.execute_input":"2022-07-06T23:36:41.301692Z","iopub.status.idle":"2022-07-06T23:36:41.311543Z","shell.execute_reply.started":"2022-07-06T23:36:41.301660Z","shell.execute_reply":"2022-07-06T23:36:41.310420Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dict_dfs['train']=dict_dfs['train'].drop('IsHoliday_y',axis=1)","metadata":{"_uuid":"15103eba-37e2-42c8-9904-1e559fc1266c","_cell_guid":"ecc64c72-8a36-4c8c-92e9-88a50ca4c6a9","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T02:32:20.966476Z","start_time":"2022-07-01T02:32:20.936481Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:41.315076Z","iopub.execute_input":"2022-07-06T23:36:41.315666Z","iopub.status.idle":"2022-07-06T23:36:41.338794Z","shell.execute_reply.started":"2022-07-06T23:36:41.315631Z","shell.execute_reply":"2022-07-06T23:36:41.337869Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dict_dfs['train']=dict_dfs['train'].rename(columns={'IsHoliday_x':'IsHoliday'})","metadata":{"_uuid":"6d4772f7-db0d-43ad-b79d-80eaa7b81cfa","_cell_guid":"072d0f8f-9b8a-401b-9a29-10b19cf3c8a5","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T02:32:22.133034Z","start_time":"2022-07-01T02:32:22.101788Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:41.340233Z","iopub.execute_input":"2022-07-06T23:36:41.340774Z","iopub.status.idle":"2022-07-06T23:36:41.366897Z","shell.execute_reply.started":"2022-07-06T23:36:41.340741Z","shell.execute_reply":"2022-07-06T23:36:41.366088Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h3 style='color:#0071dc; font-family: Verdana'> Merge with extra store features </h3>","metadata":{"_uuid":"9442a74b-a424-40e5-a878-009373641fdd","_cell_guid":"5e2c0278-b80d-4848-b9d0-74577447b8db","trusted":true}},{"cell_type":"code","source":"dict_dfs['stores'].head()","metadata":{"_uuid":"8fba6c24-39da-484d-b12c-7b786496a086","_cell_guid":"0765f1e4-d426-4821-a12f-bf347d41fa2b","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T02:32:25.369702Z","start_time":"2022-07-01T02:32:25.341956Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:41.368309Z","iopub.execute_input":"2022-07-06T23:36:41.368852Z","iopub.status.idle":"2022-07-06T23:36:41.378393Z","shell.execute_reply.started":"2022-07-06T23:36:41.368810Z","shell.execute_reply":"2022-07-06T23:36:41.377425Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dict_dfs['train']=dict_dfs['train'].merge(dict_dfs['stores'],how='left',on='Store')","metadata":{"_uuid":"855c61df-2ed4-4ae5-843e-ba59f07654ac","_cell_guid":"bdfc1b37-641c-420b-bdfe-cbb5f48a0852","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T02:32:26.319907Z","start_time":"2022-07-01T02:32:26.175667Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:41.379726Z","iopub.execute_input":"2022-07-06T23:36:41.380255Z","iopub.status.idle":"2022-07-06T23:36:41.488381Z","shell.execute_reply.started":"2022-07-06T23:36:41.380211Z","shell.execute_reply":"2022-07-06T23:36:41.486979Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dict_dfs['test']=dict_dfs['test'].merge(dict_dfs['stores'],how='left',on='Store')","metadata":{"_uuid":"7ca17ac6-1d18-4162-b776-9d34fb8c75d6","_cell_guid":"e9ec473b-b91d-43cf-8724-d783837673ee","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T02:32:26.866833Z","start_time":"2022-07-01T02:32:26.833832Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:41.491612Z","iopub.execute_input":"2022-07-06T23:36:41.492346Z","iopub.status.idle":"2022-07-06T23:36:41.515995Z","shell.execute_reply.started":"2022-07-06T23:36:41.492301Z","shell.execute_reply":"2022-07-06T23:36:41.514698Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h3 style='color:#0071dc; font-family: Verdana'> Sales evaluations </h3>","metadata":{"_uuid":"1558d09a-dfc5-47ba-9cd9-3f714b82102a","_cell_guid":"d4baaffc-ae62-4593-814e-40af8831d1d1","trusted":true}},{"cell_type":"code","source":"fig,ax=plt.subplots(figsize=(16, 8))\nsns.histplot(dict_dfs['train']['Weekly_Sales'], color='#ffc220', bins=200,ax=ax,kde=True)\nax.set_xticks([i for i in range(0,700000,50000)])\nax.set_xlim([-10000,650000])\nplt.show()","metadata":{"_uuid":"62ff9466-b58e-4b85-b0f6-60cc88031526","_cell_guid":"214aa5e6-10f0-426e-853b-7ed6f09af923","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T02:32:33.267199Z","start_time":"2022-07-01T02:32:29.196166Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:41.776921Z","iopub.execute_input":"2022-07-06T23:36:41.777382Z","iopub.status.idle":"2022-07-06T23:36:44.484777Z","shell.execute_reply.started":"2022-07-06T23:36:41.777346Z","shell.execute_reply":"2022-07-06T23:36:44.483531Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'> Weekly sales are accumulated under 50k. <span>","metadata":{"_uuid":"fe4eb630-de0d-413c-b5af-57ecf63e216a","_cell_guid":"19cc1eed-fc2d-4802-8c13-5ac64986dd5a","trusted":true}},{"cell_type":"code","source":"px.violin(dict_dfs['train'],x='Weekly_Sales', box=True)","metadata":{"_uuid":"1834fadd-fbc3-4b58-a719-0956e9c881cf","_cell_guid":"87caa235-6371-4fee-99bf-4155fdf32fd2","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:44.486757Z","iopub.execute_input":"2022-07-06T23:36:44.487067Z","iopub.status.idle":"2022-07-06T23:36:46.970680Z","shell.execute_reply.started":"2022-07-06T23:36:44.487040Z","shell.execute_reply":"2022-07-06T23:36:46.969815Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'>\n    <ul>\n        <li>Weekly sales median is around 7500. </li>\n        <li>Odd behavior of negative weekly sales, but with very low volume of events. </li>\n        <li>Weekly Sales indeed accumulated on low values, with some outliers.</li>\n    </ul>\n<span>","metadata":{"_uuid":"4af620e0-0e4a-4cca-9a53-0b3f1f428a45","_cell_guid":"9da513da-1ed5-45ae-9984-efbd37ee8f4e","ExecuteTime":{"end_time":"2022-06-29T02:48:07.63004Z","start_time":"2022-06-29T02:48:07.612031Z"},"trusted":true}},{"cell_type":"markdown","source":"<span style='color:#0071dc; font-family: Verdana'> Evaluating sales behavior over the year. <span>","metadata":{"_uuid":"4bdcee16-fcdc-4a19-998a-12cde410182f","_cell_guid":"dee0f49f-4e91-46d9-9a43-94c9059102a0","trusted":true}},{"cell_type":"code","source":"dfplot=dict_dfs['train']\ndfplot['Week']=pd.to_datetime(dfplot.Date).dt.isocalendar().week\ndfplot['Year']=pd.to_datetime(dfplot.Date).dt.isocalendar().year","metadata":{"_uuid":"f281d784-66da-48f4-9bda-2ac5885a0461","_cell_guid":"85009e7f-95a6-4a63-a681-c839aa3f8641","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:46.971762Z","iopub.execute_input":"2022-07-06T23:36:46.972267Z","iopub.status.idle":"2022-07-06T23:36:47.443481Z","shell.execute_reply.started":"2022-07-06T23:36:46.972235Z","shell.execute_reply":"2022-07-06T23:36:47.442620Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dfplot=dfplot.groupby(['Week','Year'],as_index=False).Weekly_Sales.mean()","metadata":{"_uuid":"0dd60331-9cfb-4e61-b38d-c99c542e28cc","_cell_guid":"94a030a2-cd99-46fc-804c-d1293665fc19","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:47.445603Z","iopub.execute_input":"2022-07-06T23:36:47.446073Z","iopub.status.idle":"2022-07-06T23:36:47.519522Z","shell.execute_reply.started":"2022-07-06T23:36:47.446043Z","shell.execute_reply":"2022-07-06T23:36:47.518671Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"px.line(dfplot.sort_values(['Year','Week']),x='Week',title='Weekly sales X Years',y='Weekly_Sales',color='Year')","metadata":{"_uuid":"715240d9-2f31-43fa-baf4-6378e4d9f378","_cell_guid":"2d60800a-d319-4be7-80f9-253b128b2f01","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:47.520703Z","iopub.execute_input":"2022-07-06T23:36:47.521184Z","iopub.status.idle":"2022-07-06T23:36:47.618876Z","shell.execute_reply.started":"2022-07-06T23:36:47.521153Z","shell.execute_reply":"2022-07-06T23:36:47.617691Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'>The Weekly_Sales average is similar in all years, so there is no outlier year that we need to worry about..<span>","metadata":{"_uuid":"ed97b2ce-5eb0-4d99-96ab-0c30d2d94781","_cell_guid":"b08159f0-bc30-44ea-89a8-75dffd8e9160","trusted":true}},{"cell_type":"code","source":"dfplot=dict_dfs['train']\ndfplot['Week']=pd.to_datetime(dfplot.Date).dt.isocalendar().week\ndfplot=dfplot.groupby(['Week'],as_index=False).agg(Mean_Weekly_Sales=('Weekly_Sales','mean'))\n# dfplot['Group']='Mean_Weekly_Sales'","metadata":{"_uuid":"25cab8a7-3c69-4653-8160-965fc48a2c3b","_cell_guid":"5043f241-c7cf-461c-8b89-66a376abf908","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:47.620641Z","iopub.execute_input":"2022-07-06T23:36:47.621324Z","iopub.status.idle":"2022-07-06T23:36:47.869881Z","shell.execute_reply.started":"2022-07-06T23:36:47.621288Z","shell.execute_reply":"2022-07-06T23:36:47.869012Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dfplot2=dict_dfs['train']\ndfplot2['Week']=pd.to_datetime(dfplot2.Date).dt.isocalendar().week\ndfplot2=dfplot2.groupby(['Week'],as_index=False).agg(Median_Weekly_Sales=('Weekly_Sales','median'))\n# dfplot2['Group']='Median_Weekly_Sales'","metadata":{"_uuid":"dfecf4ce-2713-4aa5-b6a1-1a823d6cde26","_cell_guid":"59da7a61-53e3-473d-820c-b66dd1f8af59","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:47.871425Z","iopub.execute_input":"2022-07-06T23:36:47.871777Z","iopub.status.idle":"2022-07-06T23:36:48.133700Z","shell.execute_reply.started":"2022-07-06T23:36:47.871744Z","shell.execute_reply":"2022-07-06T23:36:48.132524Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dfplotf=dfplot.merge(dfplot2,how='left',on='Week')","metadata":{"_uuid":"3221e206-374a-4519-ad15-66c91a514b1c","_cell_guid":"154d5928-d7c7-4739-9cfe-a8fb0f7dbf81","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:48.135176Z","iopub.execute_input":"2022-07-06T23:36:48.135506Z","iopub.status.idle":"2022-07-06T23:36:48.143904Z","shell.execute_reply.started":"2022-07-06T23:36:48.135477Z","shell.execute_reply":"2022-07-06T23:36:48.142820Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"px.line(dfplotf.sort_values(['Week']),x='Week',y=['Mean_Weekly_Sales','Median_Weekly_Sales'],title='Weekly sales: Mean X Median',color_discrete_sequence=['#ffb81c','#0072ce'])","metadata":{"_uuid":"181efc3d-6672-450d-aca9-28c1dea539c0","_cell_guid":"f49eb52b-d91a-4413-9ad3-79d243633c32","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:48.145418Z","iopub.execute_input":"2022-07-06T23:36:48.145747Z","iopub.status.idle":"2022-07-06T23:36:48.227729Z","shell.execute_reply.started":"2022-07-06T23:36:48.145717Z","shell.execute_reply":"2022-07-06T23:36:48.226674Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'>\n    <ul>\n        <li>Mean and Median are distant from each other, that suggests there are some discrepancy between some stores and/or departments.</li>\n        <li>Very near the end of the year the sales sky rocket twice, might be because of the holidays.</li>\n        <li>Brief time before end of the year peak they actually fall, probably because of people saving to buy at the holidays.</li>\n        <li>As the year starts the sales reach rock bottom, maybe because people spent too much on holidays and don't have more money to spend.</li>\n    </ul>\n   <span>\n<h5>Decision here to create week feature to evaluate the holiday weeks and year too match the holidays if they chance by year.</h5>","metadata":{"_uuid":"5df99e1d-f6d5-4dd7-ad7f-77cfd7a513cf","_cell_guid":"2ad83942-c658-47e6-8fbb-f9de196bd106","trusted":true}},{"cell_type":"code","source":"dict_dfs['train']['Week']=pd.to_datetime(dict_dfs['train'].Date).dt.isocalendar().week\ndict_dfs['train']['Year']=pd.to_datetime(dict_dfs['train'].Date).dt.isocalendar().year","metadata":{"_uuid":"5c07879b-d9a1-49d4-95e1-7d19396de1c2","_cell_guid":"a947dc03-2061-45c2-817a-4ffc504de2de","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T02:59:58.383441Z","start_time":"2022-07-01T02:59:58.201501Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:48.232615Z","iopub.execute_input":"2022-07-06T23:36:48.232955Z","iopub.status.idle":"2022-07-06T23:36:48.700338Z","shell.execute_reply.started":"2022-07-06T23:36:48.232924Z","shell.execute_reply":"2022-07-06T23:36:48.699280Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dict_dfs['test']['Week']=pd.to_datetime(dict_dfs['test'].Date).dt.isocalendar().week\ndict_dfs['test']['Year']=pd.to_datetime(dict_dfs['test'].Date).dt.isocalendar().year","metadata":{"_uuid":"e6bf3a41-0bb6-4347-ab6a-5fae004d8281","_cell_guid":"653dc8c0-d624-44ee-b091-b836a71d20fa","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T03:35:53.510118Z","start_time":"2022-07-01T03:35:53.444854Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:48.704425Z","iopub.execute_input":"2022-07-06T23:36:48.704759Z","iopub.status.idle":"2022-07-06T23:36:48.838488Z","shell.execute_reply.started":"2022-07-06T23:36:48.704730Z","shell.execute_reply":"2022-07-06T23:36:48.837289Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h3 style='color:#0071dc; font-family: Verdana'> Evaluating features </h3>","metadata":{"_uuid":"89913a6f-279a-4f03-8c58-8d27c03ca512","_cell_guid":"6be952bd-f87d-4f16-a273-fc849b3c7862","ExecuteTime":{"end_time":"2022-06-28T03:37:15.191913Z","start_time":"2022-06-28T03:37:15.172875Z"},"trusted":true}},{"cell_type":"markdown","source":"<span style='color:#0071dc; font-family: Verdana'> Evaluating column types and counts. <span>","metadata":{"_uuid":"380dfffe-3880-4ae0-b86b-7a36e1682adc","_cell_guid":"23f84b57-488e-4009-b85b-f4e70b08cae3","trusted":true}},{"cell_type":"code","source":"dict_dfs['train'].info()","metadata":{"_uuid":"c18e2e18-a3b3-4210-ad27-5e6b437743fb","_cell_guid":"d3b83768-a5fb-427c-a18d-465608ec2f81","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T03:00:01.747158Z","start_time":"2022-07-01T03:00:01.673161Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:48.839959Z","iopub.execute_input":"2022-07-06T23:36:48.840404Z","iopub.status.idle":"2022-07-06T23:36:48.956667Z","shell.execute_reply.started":"2022-07-06T23:36:48.840369Z","shell.execute_reply":"2022-07-06T23:36:48.955505Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dict_dfs['train'].describe()","metadata":{"_uuid":"900cf218-bb07-4002-9207-93ed6a034d98","_cell_guid":"f7660814-824d-4105-b81a-d79dc4df3401","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:48.957959Z","iopub.execute_input":"2022-07-06T23:36:48.958274Z","iopub.status.idle":"2022-07-06T23:36:50.142462Z","shell.execute_reply.started":"2022-07-06T23:36:48.958245Z","shell.execute_reply":"2022-07-06T23:36:50.141139Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:#0071dc; font-family: Verdana'> Evaluating null counts. <span>","metadata":{"_uuid":"3b8ae182-50b3-447f-bc19-477c216354fc","_cell_guid":"798644d2-b435-4a47-9375-cd04eda6b17b","ExecuteTime":{"end_time":"2022-06-28T03:53:06.385434Z","start_time":"2022-06-28T03:53:06.376433Z"},"trusted":true}},{"cell_type":"code","source":"fig,ax=plt.subplots(figsize=(18,8))\nsns.heatmap(dict_dfs['train'].sort_values('Date').isna(),ax=ax,cbar=False,yticklabels=False,cmap=['#0071dc','white'])\nplt.xticks(rotation=0)\nplt.title('Missing values plot',fontdict={'fontsize':14,'fontfamily': 'Verdana'})\nplt.tight_layout()\nplt.show()","metadata":{"_uuid":"af633822-137c-4a6c-ab80-2c114b30b285","_cell_guid":"5cf7bea5-dff3-434f-8bb2-7448e27fa6a4","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T03:04:55.309233Z","start_time":"2022-07-01T03:04:49.018231Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:50.144136Z","iopub.execute_input":"2022-07-06T23:36:50.145252Z","iopub.status.idle":"2022-07-06T23:36:57.907102Z","shell.execute_reply.started":"2022-07-06T23:36:50.145185Z","shell.execute_reply":"2022-07-06T23:36:57.905912Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dict_dfs['train'][(dict_dfs['train']['MarkDown1'].isna())&\n                  (dict_dfs['train']['MarkDown2'].isna())&\n                  (dict_dfs['train']['MarkDown3'].isna())&\n                  (dict_dfs['train']['MarkDown4'].isna())&\n                  (dict_dfs['train']['MarkDown5'].isna())].Date.str[:7].value_counts().sort_index()","metadata":{"_uuid":"9988cd53-2d2b-47f3-8c4e-74af451e58b3","_cell_guid":"482fb254-e423-40ec-abf3-91d53f49740b","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T03:15:54.997852Z","start_time":"2022-07-01T03:15:54.853415Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:57.908603Z","iopub.execute_input":"2022-07-06T23:36:57.908915Z","iopub.status.idle":"2022-07-06T23:36:58.138542Z","shell.execute_reply.started":"2022-07-06T23:36:57.908887Z","shell.execute_reply":"2022-07-06T23:36:58.137459Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dict_dfs['train'][dict_dfs['train']['MarkDown1'].notna()].Date.min()","metadata":{"_uuid":"2b7e5f66-0165-4d4f-96fa-3848ca0b697d","_cell_guid":"65a4bd15-baa2-49c0-b249-edfcd67fbccc","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T03:09:57.03695Z","start_time":"2022-07-01T03:09:56.987402Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:58.140154Z","iopub.execute_input":"2022-07-06T23:36:58.140605Z","iopub.status.idle":"2022-07-06T23:36:58.190066Z","shell.execute_reply.started":"2022-07-06T23:36:58.140564Z","shell.execute_reply":"2022-07-06T23:36:58.188898Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'>\n    <ul>\n        <li>MarkDown columns have no values before 2011-11-11.</li>\n        <li>Only markdown1 and markdown5 have no missing values.</li>\n        <li>Markdown2 has a little bit more missings than the others.</li>\n    </ul>\n    <h5>Decision here might be to drop the markdowns for an MVP, but let's evaluate them further.</h5>\n<span>","metadata":{"_uuid":"0e615ee9-d230-412d-8018-caaef01315d0","_cell_guid":"3cf825c9-0d12-45ee-8ebe-04d8a33ecdd3","ExecuteTime":{"end_time":"2022-06-28T03:53:06.385434Z","start_time":"2022-06-28T03:53:06.376433Z"},"trusted":true}},{"cell_type":"code","source":"fig,ax=plt.subplots(figsize=(18,8))\nsns.heatmap(dict_dfs['test'].sort_values('Date').isna(),ax=ax,cbar=False,yticklabels=False,cmap=['#0071dc','white'])\nplt.xticks(rotation=0)\nplt.title('Missing values plot',fontdict={'fontsize':14,'fontfamily': 'Verdana'})\nplt.tight_layout()\nplt.show()","metadata":{"_uuid":"66b134f4-34f4-401c-9848-38bc88d398b3","_cell_guid":"686b0866-2bdc-45fa-8113-1093cdcfc21a","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:36:58.191471Z","iopub.execute_input":"2022-07-06T23:36:58.191801Z","iopub.status.idle":"2022-07-06T23:37:00.361859Z","shell.execute_reply.started":"2022-07-06T23:36:58.191772Z","shell.execute_reply":"2022-07-06T23:37:00.360614Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print('Max date without nulls of CPI an Unemployment of the test dataset:',dict_dfs['test'][dict_dfs['test'].CPI.notna()].reset_index().Date.max())\nprint('Max date of the test dataset:',dict_dfs['test'].Date.max())\nprint('Percentage of nulls of CPI and Unemployment:',round(dict_dfs['test'][dict_dfs['test'].CPI.isna()].shape[0]*100/dict_dfs['test'].shape[0],2),'%')","metadata":{"_uuid":"ecc7b0b6-f493-4a99-8a0c-b9355ead2d1b","_cell_guid":"a58bbaf8-c235-4c72-b5a2-78f0a24400c9","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:37:00.363247Z","iopub.execute_input":"2022-07-06T23:37:00.363591Z","iopub.status.idle":"2022-07-06T23:37:00.423438Z","shell.execute_reply.started":"2022-07-06T23:37:00.363560Z","shell.execute_reply":"2022-07-06T23:37:00.422263Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'>\n    <ul>\n        <li>That are a lot of missings of CPI and Unemplyment at the test dataset.</li>\n        <li>That are no values of Unemployment and CPI after 26 of April 2013.</li>\n    </ul>\n<span>\n<h5> Because of this quantity of missings of that features it might be suitable to drop them, even more because they have many missings afeter a certain period of time and not just reandom missings over the year so it would be hard to input them with like traditional rolling methods that work very well inputing missings for time series.</h5>","metadata":{"_uuid":"c04677bb-b97d-4844-8737-292bfb6aaa91","_cell_guid":"7d8ad5a9-0af0-4618-8222-36ce9c4b3333","trusted":true}},{"cell_type":"markdown","source":"<span style='color:#0071dc; font-family: Verdana'> Evaluating the markdowns. <span>","metadata":{"_uuid":"c924083a-efca-4978-bd8b-c64c4cbb6548","_cell_guid":"632b13f8-7562-47ca-895e-58c9aa92c008","trusted":true}},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'> Markdowns are events of price reduction, so it is expected that the markdowns affect the sales. <span>","metadata":{"_uuid":"beed8661-45f3-4239-9e0c-c72f9f1c1f0a","_cell_guid":"d8789f54-8f2f-4321-a759-88e79b8bebf6","ExecuteTime":{"end_time":"2022-06-29T04:28:16.006825Z","start_time":"2022-06-29T04:28:15.98581Z"},"trusted":true}},{"cell_type":"code","source":"dfplot=dict_dfs['train'][dict_dfs['train'].Date>='2011-11-11'].reset_index(drop=True).copy()\ndfplot['Week']=pd.to_datetime(dfplot.Date).dt.isocalendar().week","metadata":{"_uuid":"28cdb216-3eb9-4d48-a539-76f8d1737e32","_cell_guid":"c06162eb-6399-4734-920a-f532079b626f","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:37:00.424819Z","iopub.execute_input":"2022-07-06T23:37:00.425147Z","iopub.status.idle":"2022-07-06T23:37:00.601655Z","shell.execute_reply.started":"2022-07-06T23:37:00.425119Z","shell.execute_reply":"2022-07-06T23:37:00.600545Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dfplot=dfplot[['Week','Weekly_Sales','MarkDown1','MarkDown2','MarkDown3','MarkDown4','MarkDown5']].melt(id_vars=[\"Week\"], \n        var_name=\"Variable\", \n        value_name=\"Value\")","metadata":{"_uuid":"3030c095-0dfb-4192-8afe-240a60677eb6","_cell_guid":"8bffa402-f48c-40f1-8a92-0bb1e337bb3b","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:37:00.603393Z","iopub.execute_input":"2022-07-06T23:37:00.603803Z","iopub.status.idle":"2022-07-06T23:37:00.653824Z","shell.execute_reply.started":"2022-07-06T23:37:00.603760Z","shell.execute_reply":"2022-07-06T23:37:00.652704Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dfplot=dfplot.groupby(['Week','Variable'],as_index=False).mean()","metadata":{"_uuid":"77e5fed0-b33d-40aa-8d65-d847ddeccad5","_cell_guid":"2e92407d-0b6c-49c0-8689-72ed5f7c9025","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:37:00.655217Z","iopub.execute_input":"2022-07-06T23:37:00.655582Z","iopub.status.idle":"2022-07-06T23:37:00.778265Z","shell.execute_reply.started":"2022-07-06T23:37:00.655539Z","shell.execute_reply":"2022-07-06T23:37:00.776976Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"px.line(dfplot.sort_values('Week'),x='Week',title='Weekly sales X Markdowns',y='Value',color='Variable')","metadata":{"_uuid":"22d240be-7c78-453d-9b50-cd91b9c0c629","_cell_guid":"1c9f2515-e2c3-4ca7-afd4-7a06288967fd","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:37:00.785579Z","iopub.execute_input":"2022-07-06T23:37:00.785948Z","iopub.status.idle":"2022-07-06T23:37:00.881077Z","shell.execute_reply.started":"2022-07-06T23:37:00.785915Z","shell.execute_reply":"2022-07-06T23:37:00.879918Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'>\n    <ul>\n        <li>Markdowns usually follows drops in sales, probably because the stores are trying to pump the sales back to the top.</li>\n        <li>Shortly after markdowns there are some drops again, likely because people wait to buy on markdowns and than they wait for the next ones.</li>\n        <li>Markdown columns affect a little bit the prices as seeing in the graph but the highest impacts are actually near the end of the year and as further evaluation that impact surely come from the holidays.</li>\n    </ul>\n<span>\n<h5> Because Markdowns has too much missings and the strongest correlation that might be there, in fact is not most from this feature, it will be decided to drop them.</h5>","metadata":{"_uuid":"be0946d7-b207-4514-9568-e9077ee62ac6","_cell_guid":"1afd0aca-2b5d-44b3-9c66-ce1de8b252ec","trusted":true}},{"cell_type":"code","source":"dropmarks=[coluna for coluna in dict_dfs['features'].columns if 'markdown' in coluna.lower()]\ndict_dfs['train'].drop(dropmarks,axis=1,inplace=True)\ndict_dfs['test'].drop(dropmarks,axis=1,inplace=True)","metadata":{"_uuid":"b920daae-b71d-4dd4-b569-47450de13e8e","_cell_guid":"2ef52a1b-cbe5-48da-ac23-95f8823786ba","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T03:35:02.10495Z","start_time":"2022-07-01T03:35:01.948008Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:37:00.882612Z","iopub.execute_input":"2022-07-06T23:37:00.882924Z","iopub.status.idle":"2022-07-06T23:37:00.906834Z","shell.execute_reply.started":"2022-07-06T23:37:00.882896Z","shell.execute_reply":"2022-07-06T23:37:00.905812Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:#0071dc; font-family: Verdana'> Evaluating Holidays. <span>","metadata":{"_uuid":"9bcb2998-c22d-43f3-8720-13b62c8282bc","_cell_guid":"df9f39f5-f8bb-4e80-99f4-fe5bf8c7024b","ExecuteTime":{"end_time":"2022-06-30T21:03:39.44347Z","start_time":"2022-06-30T21:03:39.428472Z"},"trusted":true}},{"cell_type":"code","source":"dict_holidays={'Super Bowl':  ['12-Feb-10', '11-Feb-11', '10-Feb-12', '08-Feb-13'],\n'Labor Day':    ['10-Sep-10', '09-Sep-11', '07-Sep-12', '06-Sep-13'],\n'Thanksgiving': ['26-Nov-10', '25-Nov-11', '23-Nov-12', '29-Nov-13'],\n'Christmas':    ['31-Dec-10', '30-Dec-11', '28-Dec-12', '27-Dec-13'],\n#Adding relevant Holidays to evaluate their influence on sales\n'Valentines Day': ['14-Feb-10', '14-Feb-11', '14-Feb-12', '14-Feb-13'],\n'Mothers Day': ['09-May-10', '08-May-11', '13-May-12', '12-May-13'],\n'Fathers Day': ['20-Jun-10', '19-Jun-11', '17-Jun-12', '16-Jun-13'],\n'Easter': ['04-Apr-10', '24-Apr-11', '08-Apr-12', '31-Mar-13'],\n'Black Friday': ['26-Nov-10', '25-Nov-11', '23-Nov-12', '29-Nov-13']}","metadata":{"_uuid":"b50a275e-1b11-4d8c-92ff-f40eba9a9f82","_cell_guid":"4c7dedfe-6c66-4ef6-ab3b-b0e0a6cc6e34","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T03:36:03.488275Z","start_time":"2022-07-01T03:36:03.477295Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:37:00.908347Z","iopub.execute_input":"2022-07-06T23:37:00.908642Z","iopub.status.idle":"2022-07-06T23:37:00.915625Z","shell.execute_reply.started":"2022-07-06T23:37:00.908616Z","shell.execute_reply":"2022-07-06T23:37:00.914595Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dict_holidays={i:[datetime.datetime.strptime(x,'%d-%b-%y') for x in dict_holidays[i]] for i in dict_holidays.keys()}","metadata":{"_uuid":"951f2377-1019-41f9-bd67-3561a88fdd5e","_cell_guid":"0d47d327-fd81-4385-9f2a-9bdd70ecdced","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T03:36:04.74233Z","start_time":"2022-07-01T03:36:04.721318Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:37:00.916877Z","iopub.execute_input":"2022-07-06T23:37:00.917193Z","iopub.status.idle":"2022-07-06T23:37:00.929626Z","shell.execute_reply.started":"2022-07-06T23:37:00.917165Z","shell.execute_reply":"2022-07-06T23:37:00.928721Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dfplot=dict_dfs['train']\ndfplot['Week']=pd.to_datetime(dfplot.Date).dt.isocalendar().week\ndfplot['Year']=pd.to_datetime(dfplot.Date).dt.isocalendar().year\ndfplot['Date']=pd.to_datetime(dfplot.Date)","metadata":{"_uuid":"c76f2ab7-face-425e-b4c9-ddc044b25b20","_cell_guid":"77e8a4cd-381b-4938-920e-e541f5dc5147","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T03:36:05.589773Z","start_time":"2022-07-01T03:36:05.369953Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:37:00.930945Z","iopub.execute_input":"2022-07-06T23:37:00.931929Z","iopub.status.idle":"2022-07-06T23:37:01.485162Z","shell.execute_reply.started":"2022-07-06T23:37:00.931890Z","shell.execute_reply":"2022-07-06T23:37:01.484058Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_superbowl=pd.DataFrame(dict_holidays['Super Bowl'],columns=['Date']).merge(dfplot.groupby('Date',as_index=False).mean()[['Date','Weekly_Sales']],how='left')\ndf_laborday=pd.DataFrame(dict_holidays['Labor Day'],columns=['Date']).merge(dfplot.groupby('Date',as_index=False).mean()[['Date','Weekly_Sales']],how='left')\ndf_thanksgiving=pd.DataFrame(dict_holidays['Thanksgiving'],columns=['Date']).merge(dfplot.groupby('Date',as_index=False).mean()[['Date','Weekly_Sales']],how='left')\ndf_christmas=pd.DataFrame(dict_holidays['Christmas'],columns=['Date']).merge(dfplot.groupby('Date',as_index=False).mean()[['Date','Weekly_Sales']],how='left')","metadata":{"_uuid":"18f385a3-c869-4776-bc84-658662cb3004","_cell_guid":"f36c9797-9a0a-4284-a6ed-17850d2ef7ea","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T03:36:06.4223Z","start_time":"2022-07-01T03:36:06.201173Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:37:01.486810Z","iopub.execute_input":"2022-07-06T23:37:01.487172Z","iopub.status.idle":"2022-07-06T23:37:01.689555Z","shell.execute_reply.started":"2022-07-06T23:37:01.487141Z","shell.execute_reply":"2022-07-06T23:37:01.688530Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_ValentinesDay=pd.DataFrame([[i.isocalendar()[1],i.isocalendar()[0]] for i in dict_holidays['Valentines Day']],columns=['Week','Year']).merge(dfplot.groupby(['Week','Year'],as_index=False).agg({'Date':'last','Weekly_Sales':'mean'})[['Week','Year','Date','Weekly_Sales']],how='left')\ndf_MothersDay=pd.DataFrame([[i.isocalendar()[1],i.isocalendar()[0]] for i in dict_holidays['Mothers Day']],columns=['Week','Year']).merge(dfplot.groupby(['Week','Year'],as_index=False).agg({'Date':'last','Weekly_Sales':'mean'})[['Week','Year','Date','Weekly_Sales']],how='left')\ndf_FathersDay=pd.DataFrame([[i.isocalendar()[1],i.isocalendar()[0]] for i in dict_holidays['Fathers Day']],columns=['Week','Year']).merge(dfplot.groupby(['Week','Year'],as_index=False).agg({'Date':'last','Weekly_Sales':'mean'})[['Week','Year','Date','Weekly_Sales']],how='left')\ndf_Easter=pd.DataFrame([[i.isocalendar()[1],i.isocalendar()[0]] for i in dict_holidays['Easter']],columns=['Week','Year']).merge(dfplot.groupby(['Week','Year'],as_index=False).agg({'Date':'last','Weekly_Sales':'mean'})[['Week','Year','Date','Weekly_Sales']],how='left')\ndf_BlackFriday=pd.DataFrame([[i.isocalendar()[1],i.isocalendar()[0]] for i in dict_holidays['Black Friday']],columns=['Week','Year']).merge(dfplot.groupby(['Week','Year'],as_index=False).agg({'Date':'last','Weekly_Sales':'mean'})[['Week','Year','Date','Weekly_Sales']],how='left')","metadata":{"_uuid":"5b10f1b8-07c6-4448-8eb9-c577ca1c41e6","_cell_guid":"6687a232-ca1c-4366-9a93-938711498432","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:37:01.691143Z","iopub.execute_input":"2022-07-06T23:37:01.692112Z","iopub.status.idle":"2022-07-06T23:37:01.858393Z","shell.execute_reply.started":"2022-07-06T23:37:01.692066Z","shell.execute_reply":"2022-07-06T23:37:01.857165Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig,ax=plt.subplots(figsize=(22,6))\nsns.lineplot(data=dfplot,x='Date',y='Weekly_Sales',color='#ffc220',ax=ax,label='Weekly_Sales')\nax.set_ylabel('Weekly_Sales')\nax.vlines(dfplot[dfplot.IsHoliday==True].groupby('Date',as_index=False).mean().Date,dfplot[dfplot.IsHoliday==True].groupby('Date',as_index=False).mean().Weekly_Sales.min()-1000,dfplot[dfplot.IsHoliday==True].groupby('Date',as_index=False).mean().Weekly_Sales.max()+1000,label='IsHoliday', linestyles='dashed', color='skyblue')\nax.vlines(df_BlackFriday.Date,df_BlackFriday.Weekly_Sales.min()-1000,df_BlackFriday.Weekly_Sales.max()+1000,label='Black Friday', linestyles='dashed', colors='dimgray')\n# sns.scatterplot(data=dfplot[dfplot.IsHoliday==True].groupby('Date',as_index=False).mean(),x='Date',y='Weekly_Sales', marker='o', s=100,label='IsHoliday',ax=ax)\nsns.scatterplot(data=df_superbowl,x='Date',y='Weekly_Sales', marker='o', s=100,label='Super Bowl',ax=ax)\nsns.scatterplot(data=df_laborday,x='Date',y='Weekly_Sales', marker='o', s=100,label='Labor Day',ax=ax)\nsns.scatterplot(data=df_thanksgiving,x='Date',y='Weekly_Sales', marker='o', s=100,label='Thanks Giving',ax=ax)\nsns.scatterplot(data=df_christmas,x='Date',y='Weekly_Sales', marker='o', s=100,label='Christmas',ax=ax)\nsns.scatterplot(data=df_ValentinesDay,x='Date',y='Weekly_Sales', marker='o', s=100,label='Valentines Day',ax=ax)\nsns.scatterplot(data=df_MothersDay,x='Date',y='Weekly_Sales', marker='o', s=100,label='Mothers Day',ax=ax)\nsns.scatterplot(data=df_FathersDay,x='Date',y='Weekly_Sales', marker='o', s=100,label='Fathers Day',ax=ax)\nsns.scatterplot(data=df_Easter,x='Date',y='Weekly_Sales', marker='o', s=100,label='Easter',ax=ax)\nplt.legend()\nlocator = mdates.AutoDateLocator(minticks=12, maxticks=24)\nformatter = mdates.ConciseDateFormatter(locator)\nax.xaxis.set_major_locator(locator)\nax.xaxis.set_major_formatter(formatter)\nplt.title('Holiday plot')\nplt.show()","metadata":{"_uuid":"da2dceb4-78c5-4d0e-819a-8c8c3ff9312c","_cell_guid":"b4da5b03-7416-4316-bafc-5a4e4a08212b","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T03:36:38.845779Z","start_time":"2022-07-01T03:36:32.396153Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:37:01.859853Z","iopub.execute_input":"2022-07-06T23:37:01.860301Z","iopub.status.idle":"2022-07-06T23:37:11.479282Z","shell.execute_reply.started":"2022-07-06T23:37:01.860258Z","shell.execute_reply":"2022-07-06T23:37:11.478522Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'>\n    <ul>\n        <li>It is possible to notice that at Thanks Giving and Super Bowl that are rises in sales but after that, they plummet.</li>\n        <li>Also before Christmas that are huge rises too but at the holiday, they already hit rock bottom different from the other two.</li>\n        <li>The only one that doesn not reflect too much on rising sales is Labor Day, but as the other three after the holiday it falls a bit.</li>\n        <li>Best insight to focus is that both Thanks Giving and Christmas has a lot of impact on sales.</li>\n        <li>All Holidays that appears on IsHoliday are actually in the holliday dates in the exercise description.</li> \n        <li>All Holidays manually added holidays except fathers day are at some peak sales of the month.</li> \n        <li>Black Friday matches Thanks Giving, so no need to add it.</li> \n    </ul>\n<span>\n    <h5> Decision here to add new holidays except Black Friday and use some kind of flag too see the sales before and after holidays.</h5>","metadata":{"_uuid":"7bee806c-5f0b-48ce-a8fb-da99fa0a19e1","_cell_guid":"c2fc6f7a-0f6c-40f6-8b40-cff7ef217a35","trusted":true}},{"cell_type":"code","source":"dict_holidays.pop('Black Friday')","metadata":{"_uuid":"bd8d82cd-b3a5-4984-b351-0706b5045286","_cell_guid":"0eb748c3-4ff4-440c-8608-3399a5cec81a","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:37:11.480292Z","iopub.execute_input":"2022-07-06T23:37:11.481161Z","iopub.status.idle":"2022-07-06T23:37:11.487976Z","shell.execute_reply.started":"2022-07-06T23:37:11.481127Z","shell.execute_reply":"2022-07-06T23:37:11.486918Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"for holiday in dict_holidays.keys():\n    dict_dfs['train'][holiday]=0\n    holbefcol=holiday+'_before'\n    dict_dfs['train'][holbefcol]=0\n    holaftcol=holiday+'_aft'\n    dict_dfs['train'][holaftcol]=0\n    dfholidaytemp=pd.Series(dict_holidays[holiday]).dt.isocalendar().iloc[:,:2]\n    dfholidaytempbef=(pd.Series(dict_holidays[holiday])-pd.Timedelta(weeks=1)).dt.isocalendar().iloc[:,:2]\n    dfholidaytempaft=(pd.Series(dict_holidays[holiday])+pd.Timedelta(weeks=1)).dt.isocalendar().iloc[:,:2]\n    for nmr in range(len(dfholidaytemp)):\n        dict_dfs['train'].loc[(dict_dfs['train'].Week==dfholidaytemp.iloc[nmr,1])&(dict_dfs['train'].Year==dfholidaytemp.iloc[nmr,0]),holiday]=1\n        \n        dict_dfs['train'].loc[(dict_dfs['train'].Week==dfholidaytempbef.iloc[nmr,1])&(dict_dfs['train'].Year==dfholidaytempbef.iloc[nmr,0]),holbefcol]=1\n        \n        dict_dfs['train'].loc[(dict_dfs['train'].Week==dfholidaytempaft.iloc[nmr,1])&(dict_dfs['train'].Year==dfholidaytempaft.iloc[nmr,0]),holaftcol]=1","metadata":{"_uuid":"c18a7034-7138-413e-b2d3-1b8939cc067f","_cell_guid":"200b909a-2c81-4465-9e0e-8ec6dd13b0af","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:37:11.489657Z","iopub.execute_input":"2022-07-06T23:37:11.490328Z","iopub.status.idle":"2022-07-06T23:37:11.940433Z","shell.execute_reply.started":"2022-07-06T23:37:11.490284Z","shell.execute_reply":"2022-07-06T23:37:11.939520Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"for holiday in dict_holidays.keys():\n    dict_dfs['test'][holiday]=0\n    holbefcol=holiday+'_before'\n    dict_dfs['test'][holbefcol]=0\n    holaftcol=holiday+'_aft'\n    dict_dfs['test'][holaftcol]=0\n    dfholidaytemp=pd.Series(dict_holidays[holiday]).dt.isocalendar().iloc[:,:2]\n    dfholidaytempbef=(pd.Series(dict_holidays[holiday])-pd.Timedelta(weeks=1)).dt.isocalendar().iloc[:,:2]\n    dfholidaytempaft=(pd.Series(dict_holidays[holiday])+pd.Timedelta(weeks=1)).dt.isocalendar().iloc[:,:2]\n    for nmr in range(len(dfholidaytemp)):\n        dict_dfs['test'].loc[(dict_dfs['test'].Week==dfholidaytemp.iloc[nmr,1])&(dict_dfs['test'].Year==dfholidaytemp.iloc[nmr,0]),holiday]=1\n        \n        dict_dfs['test'].loc[(dict_dfs['test'].Week==dfholidaytempbef.iloc[nmr,1])&(dict_dfs['test'].Year==dfholidaytempbef.iloc[nmr,0]),holbefcol]=1\n        \n        dict_dfs['test'].loc[(dict_dfs['test'].Week==dfholidaytempaft.iloc[nmr,1])&(dict_dfs['test'].Year==dfholidaytempaft.iloc[nmr,0]),holaftcol]=1","metadata":{"_uuid":"d712997a-8ba0-4a0e-9f47-ce462bbd547e","_cell_guid":"6fe5ec73-283e-489d-b6a4-7f130dbbc579","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:37:11.941934Z","iopub.execute_input":"2022-07-06T23:37:11.942539Z","iopub.status.idle":"2022-07-06T23:37:12.176794Z","shell.execute_reply.started":"2022-07-06T23:37:11.942498Z","shell.execute_reply":"2022-07-06T23:37:12.175630Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dict_dfs['test']","metadata":{"_uuid":"cda5fe4d-7619-46a9-a701-3ed5449bd970","_cell_guid":"d04d35fc-3b9f-44d1-8702-66df48b5fc31","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:37:12.178048Z","iopub.execute_input":"2022-07-06T23:37:12.178396Z","iopub.status.idle":"2022-07-06T23:37:12.219158Z","shell.execute_reply.started":"2022-07-06T23:37:12.178366Z","shell.execute_reply":"2022-07-06T23:37:12.217958Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:#0071dc; font-family: Verdana'> Hist plots <span>","metadata":{"_uuid":"379ec51c-3651-4093-909c-68b8d91384a2","_cell_guid":"a0afc017-15a2-41cf-b31e-bd443a1dce37","trusted":true}},{"cell_type":"code","source":"dict_dfs['train'][dict_dfs['train'].columns[dict_dfs['train'].dtypes!='object']].iloc[:,:10].hist(figsize=(16, 10), bins=50, xlabelsize=8, ylabelsize=8,color='#6cace4')\nplt.tight_layout()\nplt.show()","metadata":{"_uuid":"f3761db6-c3a6-4df3-b14b-6a87995b0ca1","_cell_guid":"787d89f5-b8bf-4bdb-b3dc-e42c7a63e6a7","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T03:38:05.643191Z","start_time":"2022-07-01T03:38:03.555177Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:37:12.220564Z","iopub.execute_input":"2022-07-06T23:37:12.220872Z","iopub.status.idle":"2022-07-06T23:37:15.467441Z","shell.execute_reply.started":"2022-07-06T23:37:12.220843Z","shell.execute_reply":"2022-07-06T23:37:15.466447Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'>\n    <ul>\n        <li>Some variables are very far for normal distributions.</li>\n    </ul>\n<span>\n    <h5> Decision here to not use lienar regressors as it would be hard to normalize the variables and mayba not use some of them.</h5>","metadata":{"_uuid":"51f1425d-54c7-4369-83c2-9c867ce683c6","_cell_guid":"dfdc44a4-1110-43b8-924f-1934376bea98","execution":{"iopub.status.busy":"2022-07-04T03:35:37.987984Z","iopub.execute_input":"2022-07-04T03:35:37.98867Z","iopub.status.idle":"2022-07-04T03:35:38.106058Z","shell.execute_reply.started":"2022-07-04T03:35:37.988527Z","shell.execute_reply":"2022-07-04T03:35:38.104646Z"},"trusted":true}},{"cell_type":"markdown","source":"<span style='color:#0071dc; font-family: Verdana'> Seeing correlation with target. <span>","metadata":{"_uuid":"08179e7e-d06c-44cf-8773-d292d040586d","_cell_guid":"c2c11cca-5346-4532-adb7-e5079774e16d","trusted":true}},{"cell_type":"code","source":"for i in range(0, len(dict_dfs['train'][dict_dfs['train'].columns[dict_dfs['train'].dtypes!='object']].drop(['Weekly_Sales','Date'],axis=1).columns), 3):\n    sns.pairplot(data=dict_dfs['train'][dict_dfs['train'].columns[dict_dfs['train'].dtypes!='object']],\n                x_vars=dict_dfs['train'][dict_dfs['train'].columns[dict_dfs['train'].dtypes!='object']].drop(['Weekly_Sales','Date'],axis=1).columns[i:i+3],\n                y_vars=['Weekly_Sales'],\n                 \n                 plot_kws={'color': '#6cace4'},height=3,aspect=1.8)\nplt.tight_layout()","metadata":{"_uuid":"6e56157e-b22d-44e8-b14c-666f5ce32a31","_cell_guid":"e07873d6-2104-43ef-96c0-a414feaa4bbf","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T03:40:32.646761Z","start_time":"2022-07-01T03:40:23.756262Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:37:15.469155Z","iopub.execute_input":"2022-07-06T23:37:15.469489Z","iopub.status.idle":"2022-07-06T23:37:56.897997Z","shell.execute_reply.started":"2022-07-06T23:37:15.469460Z","shell.execute_reply":"2022-07-06T23:37:56.896267Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'>\n    <ul>\n        <li>It is possible to notice that some variables like temperature and IsHolliday have the biggest sales accumulated at some ranges, but not much of linear relationships.</li>\n        <li>Also the flags created for the holidays shows a little bit of difference in the distribution, most clear to see are after christmas and at Thanksgiving\n    </ul>\n<span>\n    <h5> Decision here to maintain Holiday flags.</h5>","metadata":{"_uuid":"2b64dd0c-8b9c-4558-93de-0cf014853ec4","_cell_guid":"bc2a3797-a11c-4ac0-aa0d-43ac11b863f1","ExecuteTime":{"end_time":"2022-06-29T01:24:54.608129Z","start_time":"2022-06-29T01:24:54.59313Z"},"trusted":true}},{"cell_type":"code","source":"dict_dfs['train'].IsHoliday=dict_dfs['train'].IsHoliday.astype(int)\ndict_dfs['test'].IsHoliday=dict_dfs['test'].IsHoliday.astype(int)","metadata":{"_uuid":"42d6c6c4-667e-4c5e-8685-0efc7f0eaa99","_cell_guid":"9d92586d-0000-47f5-995b-88903ba9521b","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:37:56.900114Z","iopub.execute_input":"2022-07-06T23:37:56.901570Z","iopub.status.idle":"2022-07-06T23:37:56.912787Z","shell.execute_reply.started":"2022-07-06T23:37:56.901518Z","shell.execute_reply":"2022-07-06T23:37:56.911575Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:#0071dc; font-family: Verdana'> Seeing Pearson's linear correlation with target. <span>","metadata":{"_uuid":"58812a78-9ff3-4e40-95d3-65bad4b68596","_cell_guid":"551ade04-3833-4cee-868c-d58fd905ebd3","ExecuteTime":{"end_time":"2022-06-29T01:27:01.15211Z","start_time":"2022-06-29T01:27:01.146117Z"},"trusted":true}},{"cell_type":"code","source":"fig,ax=plt.subplots(figsize=(20,10))\nsns.heatmap(dict_dfs['train'].corr(),cmap='YlGnBu',annot=True, fmt=\".0%\")\nplt.show()","metadata":{"_uuid":"b9997bc5-7db2-4020-8cab-ea4ce55a8157","_cell_guid":"9d8d30e8-6dc8-464a-8dc5-2974a9b8950d","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T03:58:21.085294Z","start_time":"2022-07-01T03:58:20.450763Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:37:56.914552Z","iopub.execute_input":"2022-07-06T23:37:56.915437Z","iopub.status.idle":"2022-07-06T23:38:03.211435Z","shell.execute_reply.started":"2022-07-06T23:37:56.915384Z","shell.execute_reply":"2022-07-06T23:38:03.210440Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'>\n    <ul>\n        <li>Size is the variable that has a little bit more of linear correlation with the Sales target and it makes sense because, usually the bigger the store is, more sales they have.</li>\n        <li>CPI and Unemployment has not very much correlation with Weekly_Sales\n    </ul>\n<span>\n    <h5> As seen in the missings plot and on the analysis above it will be decided to drop CPI and Unemployment.</h5>\n<span style='color:gray; font-family: Verdana'>  <span>","metadata":{"_uuid":"ea297780-fa4a-4ba3-994d-8f182dffa7ec","_cell_guid":"77a0d5c9-d8d6-4c7c-bb9e-305510a5b195","ExecuteTime":{"end_time":"2022-06-29T02:56:56.578947Z","start_time":"2022-06-29T02:56:56.56995Z"},"trusted":true}},{"cell_type":"code","source":"dict_dfs['train']=dict_dfs['train'].drop(['CPI', 'Unemployment'],axis=1)\ndict_dfs['test']=dict_dfs['test'].drop(['CPI', 'Unemployment'],axis=1)","metadata":{"_uuid":"04763948-2631-4663-baa8-9722d100ee3c","_cell_guid":"b1ba6656-2c83-4070-8b3c-77d5cc492cc2","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:03.212702Z","iopub.execute_input":"2022-07-06T23:38:03.213030Z","iopub.status.idle":"2022-07-06T23:38:03.357339Z","shell.execute_reply.started":"2022-07-06T23:38:03.212999Z","shell.execute_reply":"2022-07-06T23:38:03.356253Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:#0071dc; font-family: Verdana'> Plotting categorical Store Type variable. <span>","metadata":{"_uuid":"47d77b2b-1fd1-411e-b158-5b7467874b56","_cell_guid":"3b01d8e8-dfb3-496a-96e7-98d995df6c17","trusted":true}},{"cell_type":"code","source":"fig,ax=plt.subplots(figsize = (16, 8))\nsns.stripplot(x='Type', y='Weekly_Sales', data=dict_dfs['train'],ax=ax,size=5,jitter=True,alpha=0.5)\nplt.setp(ax.artists, alpha=.5, linewidth=2, edgecolor=\"k\")\nplt.show()","metadata":{"_uuid":"799099f0-d737-4c50-9d96-c27b23ed3d9e","_cell_guid":"3e01f879-1da8-4f34-a269-9961ad1527bd","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T03:48:37.828606Z","start_time":"2022-07-01T03:48:35.496476Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:03.358804Z","iopub.execute_input":"2022-07-06T23:38:03.359131Z","iopub.status.idle":"2022-07-06T23:38:06.105052Z","shell.execute_reply.started":"2022-07-06T23:38:03.359101Z","shell.execute_reply":"2022-07-06T23:38:06.103914Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'> B has the highest weekly sales, A comes next and C has the least high weekly sales. <span>","metadata":{"_uuid":"7af52c56-366e-40a0-b2ef-61f8c3a787c5","_cell_guid":"06a1fe10-2f5b-48ae-8df2-325c47de4ddb","trusted":true}},{"cell_type":"code","source":"fig,ax=plt.subplots(figsize = (16, 12))\nsns.stripplot(y='Type', x='Weekly_Sales', data=dict_dfs['train'],ax=ax,size=6,jitter=True,alpha=0.01)\nsns.violinplot(y='Type', x='Weekly_Sales', data=dict_dfs['train'],ax=ax)\nplt.setp(ax.artists, alpha=.5, linewidth=2, edgecolor=\"k\")\nax.set_xticks([i for i in range(-10000,100000,5000)])\nax.set_xlim([-10000,100000])\nplt.show()","metadata":{"_uuid":"acdcb6ba-48d7-49da-ae0c-f4ec7f5c98d7","_cell_guid":"1a152e8e-c9ba-4dce-8ccf-4ea6c4389ed8","collapsed":false,"ExecuteTime":{"end_time":"2022-07-01T03:47:23.603596Z","start_time":"2022-07-01T03:47:19.294636Z"},"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:06.106515Z","iopub.execute_input":"2022-07-06T23:38:06.106815Z","iopub.status.idle":"2022-07-06T23:38:10.438369Z","shell.execute_reply.started":"2022-07-06T23:38:06.106787Z","shell.execute_reply":"2022-07-06T23:38:10.437060Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'> Looking at density, store types A and B are similar, but store A have a little bit more accumulated high weekly sales counts and store B have some outliers of high weekly sales. Store C have more low weekly sales accumulation. \n    <span>\n            <h5 style='color:gray; font-family: Verdana'>Therefore store type may help us determine weekly sales.</h5>","metadata":{"_uuid":"3c97ca7e-b333-4681-89b4-ac3a2ad916c6","_cell_guid":"ee9ee2fb-9353-4ee9-aa9e-aa537af8bab5","ExecuteTime":{"end_time":"2022-06-29T03:27:27.413873Z","start_time":"2022-06-29T03:27:27.40684Z"},"trusted":true}},{"cell_type":"code","source":"dict_dfs['train']=dict_dfs['train'].join(pd.get_dummies(dict_dfs['train'].Type))\ndict_dfs['train']=dict_dfs['train'].drop('Type',axis=1)\ndict_dfs['test']=dict_dfs['test'].join(pd.get_dummies(dict_dfs['test'].Type))\ndict_dfs['test']=dict_dfs['test'].drop('Type',axis=1)","metadata":{"_uuid":"9e60d737-bdf7-48bc-87d4-275b73a0620c","_cell_guid":"f5f73599-42d5-489e-b88d-1724c3a319a1","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:10.440030Z","iopub.execute_input":"2022-07-06T23:38:10.440459Z","iopub.status.idle":"2022-07-06T23:38:10.746444Z","shell.execute_reply.started":"2022-07-06T23:38:10.440410Z","shell.execute_reply":"2022-07-06T23:38:10.745287Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:#0071dc; font-family: Verdana'> Plotting Stores vs Departments. <span>","metadata":{"_uuid":"a4473011-1ec4-43a9-a633-d04bdecf9c15","_cell_guid":"1e1f6009-6e0c-47f2-b18a-dfec110d6f3e","trusted":true}},{"cell_type":"code","source":"px.scatter(dict_dfs['train'],x='Dept',y='Store',title='Stores X Departments',color='Size',color_continuous_scale=px.colors.sequential.Bluyl)","metadata":{"_uuid":"569399f6-637c-4ed9-9a62-d4d6907a6348","_cell_guid":"60d9118b-d6a5-4e89-a2b2-1e1c6fa7d217","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:10.747828Z","iopub.execute_input":"2022-07-06T23:38:10.748172Z","iopub.status.idle":"2022-07-06T23:38:13.691587Z","shell.execute_reply.started":"2022-07-06T23:38:10.748142Z","shell.execute_reply":"2022-07-06T23:38:13.690582Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig=px.bar(dict_dfs['train'].groupby('Store',as_index=False).agg({'Dept':'nunique','Size':'last'}),x='Store',y='Dept',title='Stores X Departments',color='Size',color_continuous_scale=px.colors.sequential.Bluyl)\nfig.update_layout(\nxaxis_type = 'category'\n)\nfig.update_xaxes(categoryorder='array', categoryarray=dict_dfs['train'].groupby('Store',as_index=False).agg({'Dept':'nunique','Size':'last'}).sort_values('Size').Store.to_list())\nfig.show()","metadata":{"_uuid":"e37aa0c8-cc52-4eb0-b52f-152202528c63","_cell_guid":"eb7deabf-c741-4e89-b3bc-481c6e6f168f","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:13.692942Z","iopub.execute_input":"2022-07-06T23:38:13.693303Z","iopub.status.idle":"2022-07-06T23:38:13.832536Z","shell.execute_reply.started":"2022-07-06T23:38:13.693269Z","shell.execute_reply":"2022-07-06T23:38:13.831695Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'> As seen above the smallest stores seems to have the least number of departments and not all sotres have all departments. <span>","metadata":{"_uuid":"d652a7fe-f0d3-4cbb-9911-ae48155257c9","_cell_guid":"ca0569d8-80ec-476f-94bd-95dcce4821be","trusted":true}},{"cell_type":"markdown","source":"<span style='color:#0071dc; font-family: Verdana'> Plotting departments average week sales. <span>","metadata":{"_uuid":"f7ac94c7-cde2-41de-a922-2e1e73b6b1cb","_cell_guid":"983a3d98-6cce-44f6-b976-9fd433219ceb","trusted":true}},{"cell_type":"code","source":"df_plot_depts=dict_dfs['train'].groupby('Dept')['Weekly_Sales'].mean().reset_index()\ndf_plot_depts.Dept=df_plot_depts.Dept.astype(str)","metadata":{"_uuid":"c79299ac-d898-4281-9c41-650ddf7101cb","_cell_guid":"8b39c546-b24d-4967-ab92-647887f1c9fb","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:13.833785Z","iopub.execute_input":"2022-07-06T23:38:13.834542Z","iopub.status.idle":"2022-07-06T23:38:13.850418Z","shell.execute_reply.started":"2022-07-06T23:38:13.834510Z","shell.execute_reply":"2022-07-06T23:38:13.849275Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"px.bar(df_plot_depts,x='Dept',y='Weekly_Sales',color='Dept',color_discrete_sequence=px.colors.qualitative.Vivid)","metadata":{"_uuid":"160876e4-4eed-4d87-be03-688f43d1962a","_cell_guid":"3287a7be-eb8e-4dfd-bb61-7ffe67953ecb","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:13.851866Z","iopub.execute_input":"2022-07-06T23:38:13.852762Z","iopub.status.idle":"2022-07-06T23:38:14.281115Z","shell.execute_reply.started":"2022-07-06T23:38:13.852728Z","shell.execute_reply":"2022-07-06T23:38:14.280029Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'> Some departments average more sales than others. <span>","metadata":{"_uuid":"902819d3-668d-4a56-bfbf-5c1186786fb3","_cell_guid":"26340f15-f9f4-4db2-88a4-2ffd83f6b1e5","ExecuteTime":{"end_time":"2022-06-30T23:54:20.224043Z","start_time":"2022-06-30T23:54:20.216018Z"},"trusted":true}},{"cell_type":"markdown","source":"<span style='color:#0071dc; font-family: Verdana'> Plotting stores average of week sales. <span>","metadata":{"_uuid":"c63dc7b4-2334-42fa-877e-680dca13f6cd","_cell_guid":"b11cc7cf-4e1e-40eb-a5df-f3ee73dacae2","trusted":true}},{"cell_type":"code","source":"df_plot_stores=dict_dfs['train'].groupby('Store')['Weekly_Sales'].mean().reset_index()\ndf_plot_stores.Store=df_plot_stores.Store.astype(str)","metadata":{"_uuid":"bbde60ef-0f2b-4ad6-913a-6c034695a73b","_cell_guid":"a374e2f0-0c54-422c-9e40-d52bd89e589c","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:14.282490Z","iopub.execute_input":"2022-07-06T23:38:14.282808Z","iopub.status.idle":"2022-07-06T23:38:14.299117Z","shell.execute_reply.started":"2022-07-06T23:38:14.282779Z","shell.execute_reply":"2022-07-06T23:38:14.298353Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"px.bar(df_plot_stores,x='Store',y='Weekly_Sales',color='Store',color_discrete_sequence=px.colors.qualitative.Vivid)","metadata":{"_uuid":"ce038d98-5f1a-49b8-906e-72a6603a68af","_cell_guid":"401424e3-8109-49aa-afa4-7c2a216228a8","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:14.300779Z","iopub.execute_input":"2022-07-06T23:38:14.301069Z","iopub.status.idle":"2022-07-06T23:38:14.574931Z","shell.execute_reply.started":"2022-07-06T23:38:14.301043Z","shell.execute_reply":"2022-07-06T23:38:14.574210Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'> There are clearly stores with more average sales than others. <span>\n        <h5 style='color:gray; font-family: Verdana'>So Department and store number can be useful to predict weekly sales.</h5>","metadata":{"_uuid":"71036f7d-295f-4841-9220-182f6f627332","_cell_guid":"fe99dc13-e58f-4ba9-8c1c-94b87c18b072","trusted":true}},{"cell_type":"markdown","source":"<h2 style='color:#ffc220; font-family: Verdana'> Handling the models </h2>","metadata":{"_uuid":"b8f13cdf-ac70-4457-b303-96050eaf792e","_cell_guid":"e8c025e7-8425-4ddf-b2b9-e8993e933b82","trusted":true}},{"cell_type":"code","source":"from sklearn.compose import make_column_transformer\nfrom sklearn.impute import SimpleImputer\nfrom sklearn.pipeline import make_pipeline, Pipeline\nfrom sklearn.preprocessing import  OrdinalEncoder, StandardScaler\nfrom sklearn.base import BaseEstimator, TransformerMixin\n\n\nfrom sklearn.model_selection import train_test_split,RandomizedSearchCV,KFold\nfrom sklearn.metrics import make_scorer,mean_absolute_error\nfrom boruta import BorutaPy\n\nfrom lightgbm import LGBMRegressor\nfrom sklearn.ensemble import RandomForestRegressor,AdaBoostRegressor\nfrom xgboost import XGBRegressor\nfrom sklearn.linear_model import ElasticNet\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.preprocessing import OneHotEncoder","metadata":{"_uuid":"2db67df3-a06e-43c1-9da7-084d40a88cd9","_cell_guid":"dc1ad830-8876-4844-bddd-af047c33b6aa","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:14.575974Z","iopub.execute_input":"2022-07-06T23:38:14.576862Z","iopub.status.idle":"2022-07-06T23:38:14.968746Z","shell.execute_reply.started":"2022-07-06T23:38:14.576831Z","shell.execute_reply":"2022-07-06T23:38:14.967749Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h4 style='color:#0071dc; font-family: Verdana'> Reading again the datasets but this time for the models</h4>","metadata":{"_uuid":"948c446d-dbfd-4895-97d1-d00caba136f5","_cell_guid":"f5bd87fb-115d-438c-a4ee-b69de4069b3b","trusted":true}},{"cell_type":"code","source":"with zipfile.ZipFile(join(filespath, 'train.csv.zip'),'r') as z:\n    train=pd.read_csv(z.open('train.csv'))\nwith zipfile.ZipFile(join(filespath, 'test.csv.zip'),'r') as z:\n    test=pd.read_csv(z.open('test.csv'))\nwith zipfile.ZipFile(join(filespath, 'features.csv.zip'),'r') as z:\n    features=pd.read_csv(z.open('features.csv'))\nstores=pd.read_csv(join(filespath, 'stores.csv'))","metadata":{"_uuid":"99eeca2a-848d-4cd0-bb3b-0e102422f9ed","_cell_guid":"412c10bf-a79f-4c28-ac73-7350dd46174b","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:14.970493Z","iopub.execute_input":"2022-07-06T23:38:14.971335Z","iopub.status.idle":"2022-07-06T23:38:15.317801Z","shell.execute_reply.started":"2022-07-06T23:38:14.971287Z","shell.execute_reply":"2022-07-06T23:38:15.316919Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h4 style='color:#0071dc; font-family: Verdana'> Merging datasets for the models</h4>","metadata":{"_uuid":"6e30c86c-61a5-4ced-b0ee-99a5c1c6c3d4","_cell_guid":"95b698a4-ba57-4674-89fb-2bdec83c47d4","trusted":true}},{"cell_type":"code","source":"train=train.merge(features,how='left',on=['Store','Date','IsHoliday'])\ntrain=train.merge(stores,how='left',on=['Store'])","metadata":{"_uuid":"1bed1b8a-9f58-4ec2-b93b-e780d184b447","_cell_guid":"e7ded262-9ab7-4699-ba98-1f6eb937f475","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:15.319353Z","iopub.execute_input":"2022-07-06T23:38:15.319898Z","iopub.status.idle":"2022-07-06T23:38:15.510617Z","shell.execute_reply.started":"2022-07-06T23:38:15.319855Z","shell.execute_reply":"2022-07-06T23:38:15.509482Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test=test.merge(features,how='left',on=['Store','Date','IsHoliday'])\ntest=test.merge(stores,how='left',on=['Store'])","metadata":{"_uuid":"103bb5b4-0c07-4c46-a7c6-520e85067b51","_cell_guid":"94eef287-4af6-4363-ae11-e686618bc694","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:15.511891Z","iopub.execute_input":"2022-07-06T23:38:15.512197Z","iopub.status.idle":"2022-07-06T23:38:15.570618Z","shell.execute_reply.started":"2022-07-06T23:38:15.512169Z","shell.execute_reply":"2022-07-06T23:38:15.569420Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h4 style='color:#0071dc; font-family: Verdana'> Making pipelines for the predictions</h4>","metadata":{"_uuid":"83813a87-eebf-41ae-a8d3-c5148a1ee039","_cell_guid":"2033ecf5-2a38-4112-b899-d8d056e91985","trusted":true}},{"cell_type":"markdown","source":"<h5 style='color:#ffc220; font-family: Verdana'> Pipeline for numerics </h5>","metadata":{"_uuid":"dd16828b-6434-47af-b8c4-d1f13f1dfac9","_cell_guid":"8d087d6e-cef1-4ada-ae8d-0458b5bc1c23","trusted":true}},{"cell_type":"code","source":"numerics = train.columns[((train.dtypes == 'float64')|(train.dtypes == 'int64'))&(train.columns!='Weekly_Sales')&(train.columns!='Store')&(train.columns!='Dept')]\nnumerics=list(numerics.drop(['MarkDown1','MarkDown2','MarkDown3','MarkDown4','MarkDown5','CPI','Unemployment']))","metadata":{"_uuid":"fd2b05fa-4614-48fd-8624-1203343ad90b","_cell_guid":"8842f6e4-1066-4d08-a235-e07f037daa01","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:15.572335Z","iopub.execute_input":"2022-07-06T23:38:15.572652Z","iopub.status.idle":"2022-07-06T23:38:15.580850Z","shell.execute_reply.started":"2022-07-06T23:38:15.572623Z","shell.execute_reply":"2022-07-06T23:38:15.579904Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"numerics","metadata":{"execution":{"iopub.status.busy":"2022-07-06T23:38:15.582027Z","iopub.execute_input":"2022-07-06T23:38:15.582460Z","iopub.status.idle":"2022-07-06T23:38:15.593096Z","shell.execute_reply.started":"2022-07-06T23:38:15.582426Z","shell.execute_reply":"2022-07-06T23:38:15.591873Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pipe_numerics = make_pipeline(\n    SimpleImputer(strategy='mean'),\n#     StandardScaler()\n)","metadata":{"_uuid":"c63f59a8-090d-45e6-be8a-92854cd589f9","_cell_guid":"7f3e9152-05c7-4167-abca-ed0cff881bfc","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:15.595994Z","iopub.execute_input":"2022-07-06T23:38:15.596405Z","iopub.status.idle":"2022-07-06T23:38:15.607333Z","shell.execute_reply.started":"2022-07-06T23:38:15.596370Z","shell.execute_reply":"2022-07-06T23:38:15.606146Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'> Inputing the median as filling the empty values, because we don't want to be affected by outliers using like the average, using the standard scaler is not necessary for tree models but it is necessary to use with a linear regression baseline model if we want to test it </span>","metadata":{"_uuid":"53971553-e83a-4b6e-96ea-7f9b6a68cedb","_cell_guid":"3c49a176-9f1d-4faf-a6ed-ce45fe3ec425","trusted":true}},{"cell_type":"markdown","source":"<h5 style='color:#ffc220; font-family: Verdana'> Pipeline for categoricals </h5>","metadata":{"_uuid":"72b36192-6c49-4c02-b554-7d4ee0317b36","_cell_guid":"3cb05453-dea9-4b09-aad1-166cf2e12381","trusted":true}},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'>Store dept and type are actually categories and so it would be better to rank them if we want to use them as numerics so dicts will be created ranking them by weekly sales</span>","metadata":{}},{"cell_type":"code","source":"df_test=train.groupby('Store',as_index=False).Weekly_Sales.mean().sort_values('Weekly_Sales',ascending=False).drop('Weekly_Sales',axis=1)\ndf_test=df_test.reset_index(drop=True).reset_index()","metadata":{"execution":{"iopub.status.busy":"2022-07-06T23:38:15.609017Z","iopub.execute_input":"2022-07-06T23:38:15.609483Z","iopub.status.idle":"2022-07-06T23:38:15.662292Z","shell.execute_reply.started":"2022-07-06T23:38:15.609439Z","shell.execute_reply":"2022-07-06T23:38:15.661112Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"{int(i.split(':')[0]):int(i.split(':')[1]) for i in list(df_test.Store.astype(str)+':'+df_test.index.astype(str))}","metadata":{"execution":{"iopub.status.busy":"2022-07-06T23:38:15.663935Z","iopub.execute_input":"2022-07-06T23:38:15.664400Z","iopub.status.idle":"2022-07-06T23:38:15.675709Z","shell.execute_reply.started":"2022-07-06T23:38:15.664354Z","shell.execute_reply":"2022-07-06T23:38:15.674746Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_test=train.groupby('Type',as_index=False).Weekly_Sales.mean().sort_values('Weekly_Sales',ascending=False).drop('Weekly_Sales',axis=1)\ndf_test=df_test.reset_index(drop=True).reset_index()","metadata":{"execution":{"iopub.status.busy":"2022-07-06T23:38:15.689721Z","iopub.execute_input":"2022-07-06T23:38:15.690648Z","iopub.status.idle":"2022-07-06T23:38:15.734443Z","shell.execute_reply.started":"2022-07-06T23:38:15.690608Z","shell.execute_reply":"2022-07-06T23:38:15.733297Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"{i.split(':')[0]:int(i.split(':')[1]) for i in list(df_test.Type.astype(str)+':'+df_test.index.astype(str))}","metadata":{"execution":{"iopub.status.busy":"2022-07-06T23:38:15.735926Z","iopub.execute_input":"2022-07-06T23:38:15.737033Z","iopub.status.idle":"2022-07-06T23:38:15.745422Z","shell.execute_reply.started":"2022-07-06T23:38:15.736994Z","shell.execute_reply":"2022-07-06T23:38:15.744603Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_test=train.groupby('Dept',as_index=False).Weekly_Sales.mean().sort_values('Weekly_Sales',ascending=False).drop('Weekly_Sales',axis=1)\ndf_test=df_test.reset_index(drop=True).reset_index()","metadata":{"execution":{"iopub.status.busy":"2022-07-06T23:38:15.746893Z","iopub.execute_input":"2022-07-06T23:38:15.747747Z","iopub.status.idle":"2022-07-06T23:38:15.770326Z","shell.execute_reply.started":"2022-07-06T23:38:15.747713Z","shell.execute_reply":"2022-07-06T23:38:15.769267Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"{int(i.split(':')[0]):int(i.split(':')[1]) for i in list(df_test.Dept.astype(str)+':'+df_test.index.astype(str))}","metadata":{"execution":{"iopub.status.busy":"2022-07-06T23:38:15.771610Z","iopub.execute_input":"2022-07-06T23:38:15.771908Z","iopub.status.idle":"2022-07-06T23:38:15.783551Z","shell.execute_reply.started":"2022-07-06T23:38:15.771880Z","shell.execute_reply":"2022-07-06T23:38:15.782700Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"class Store_dept_type(BaseEstimator, TransformerMixin):\n    def fit(self, X, y=None):\n        return self\n    def transform(self, X, y=None):\n        dict_dept={92: 0, 95: 1, 38: 2, 72: 3, 65: 4, 90: 5, 40: 6, 2: 7, 91: 8, 94: 9, 13: 10, 8: 11, 93: 12, 4: 13, 7: 14, 23: 15, 79: 16, 5: 17, 9: 18, 46: 19, 1: 20, 10: 21, 34: 22, 81: 23, 82: 24, 96: 25, 14: 26, 11: 27, 97: 28, 16: 29, 74: 30, 87: 31, 80: 32, 3: 33, 22: 34, 55: 35, 17: 36, 25: 37, 49: 38, 26: 39, 67: 40, 18: 41, 32: 42, 98: 43, 33: 44, 24: 45, 71: 46, 29: 47, 20: 48, 42: 49, 21: 50, 6: 51, 44: 52, 12: 53, 30: 54, 56: 55, 58: 56, 83: 57, 37: 58, 35: 59, 50: 60, 31: 61, 85: 62, 36: 63, 41: 64, 52: 65, 19: 66, 27: 67, 48: 68, 59: 69, 28: 70, 99: 71, 60: 72, 77: 73, 54: 74, 45: 75, 51: 76, 39: 77, 78: 78, 43: 79, 47: 80}\n        dict_type={'A': 0, 'B': 1, 'C': 2}\n        dict_stores={20: 0,  4: 1,  14: 2,  13: 3,  2: 4,  10: 5,  27: 6,  6: 7,  1: 8,  39: 9,  19: 10,  23: 11,  31: 12,  11: 13,  24: 14,  28: 15,  41: 16,  32: 17,  18: 18,  22: 19,  12: 20,  26: 21,  35: 22,  40: 23,  34: 24,  43: 25,  8: 26,  17: 27,  45: 28,  42: 29,  21: 30,  25: 31,  37: 32,  15: 33,  9: 34,  30: 35,  36: 36,  7: 37,  29: 38,  16: 39,  38: 40,  3: 41,  44: 42,  33: 43,  5: 44}\n        dfz=X.copy(deep=True)\n        dfz.Store=dfz.Store.replace(dict_stores)\n        dfz.Dept=dfz.Dept.replace(dict_dept)\n        dfz.Type=dfz.Type.replace(dict_type)\n        return dfz","metadata":{"execution":{"iopub.status.busy":"2022-07-06T23:38:15.784872Z","iopub.execute_input":"2022-07-06T23:38:15.785206Z","iopub.status.idle":"2022-07-06T23:38:15.804321Z","shell.execute_reply.started":"2022-07-06T23:38:15.785178Z","shell.execute_reply":"2022-07-06T23:38:15.803452Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"categoricals = train.columns[train.columns.isin(['Store','Dept','Type'])]","metadata":{"_uuid":"6cd82938-660a-4ece-a518-6a4ce839d0f5","_cell_guid":"20d46f1f-2574-4c00-8c06-40d9c4d27cff","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:15.805875Z","iopub.execute_input":"2022-07-06T23:38:15.806524Z","iopub.status.idle":"2022-07-06T23:38:15.821858Z","shell.execute_reply.started":"2022-07-06T23:38:15.806490Z","shell.execute_reply":"2022-07-06T23:38:15.820672Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pipe_cats = make_pipeline(\n    Store_dept_type()\n)","metadata":{"_uuid":"9fede20d-cc38-4817-a31b-d2b28e524c53","_cell_guid":"d9e7702b-a10b-4591-a742-7b3bd2dc3cfb","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:15.823825Z","iopub.execute_input":"2022-07-06T23:38:15.824426Z","iopub.status.idle":"2022-07-06T23:38:15.833968Z","shell.execute_reply.started":"2022-07-06T23:38:15.824389Z","shell.execute_reply":"2022-07-06T23:38:15.833200Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h5 style='color:#ffc220; font-family: Verdana'> Pipeline for Date </h5>","metadata":{"_uuid":"0fd8400f-8aeb-4130-b9f2-b340af0581f4","_cell_guid":"a8fe6699-55e2-403c-82b1-87b6fde73355","trusted":true}},{"cell_type":"code","source":"class Date_Transformer(BaseEstimator, TransformerMixin):\n    def fit(self, X, y=None):\n        return self\n    def transform(self, X, y=None):\n        dict_holidays={\n        'Super Bowl':  ['12-Feb-10', '11-Feb-11', '10-Feb-12', '08-Feb-13'],\n        'Labor Day':    ['10-Sep-10', '09-Sep-11', '07-Sep-12', '06-Sep-13'],\n        'Thanksgiving': ['26-Nov-10', '25-Nov-11', '23-Nov-12', '29-Nov-13'],\n        'Christmas':    ['31-Dec-10', '30-Dec-11', '28-Dec-12', '27-Dec-13'],\n        'Valentines Day': ['14-Feb-10', '14-Feb-11', '14-Feb-12', '14-Feb-13'],\n        'Mothers Day': ['09-May-10', '08-May-11', '13-May-12', '12-May-13'],\n        'Fathers Day': ['20-Jun-10', '19-Jun-11', '17-Jun-12', '16-Jun-13'],\n        'Easter': ['04-Apr-10', '24-Apr-11', '08-Apr-12', '31-Mar-13'],\n        'Black Friday': ['26-Nov-10', '25-Nov-11', '23-Nov-12', '29-Nov-13']\n        }\n        dict_holidays={i:[datetime.datetime.strptime(x,'%d-%b-%y') for x in dict_holidays[i]] for i in dict_holidays.keys()}\n        dfz=X.copy(deep=True)\n        dfz[\"Week\"] = pd.to_datetime(dfz.Date).dt.isocalendar().week\n        dfz[\"Year\"] = pd.to_datetime(dfz.Date).dt.isocalendar().year\n        dfz[\"Month\"] = pd.to_datetime(dfz.Date).dt.month\n        dfz[\"Day\"] = pd.to_datetime(dfz.Date).dt.day\n        for holiday in dict_holidays.keys():\n            dfz[holiday]=0\n            holbefcol=holiday+'_before'\n            dfz[holbefcol]=0\n            holaftcol=holiday+'_aft'\n            dfz[holaftcol]=0\n            dfholidaytemp=pd.Series(dict_holidays[holiday]).dt.isocalendar().iloc[:,:2]\n            dfholidaytempbef=(pd.Series(dict_holidays[holiday])-pd.Timedelta(weeks=1)).dt.isocalendar().iloc[:,:2]\n            dfholidaytempaft=(pd.Series(dict_holidays[holiday])+pd.Timedelta(weeks=1)).dt.isocalendar().iloc[:,:2]\n            for nmr in range(len(dfholidaytemp)):\n                dfz.loc[(dict_dfs['train'].Week==dfholidaytemp.iloc[nmr,1])&(dfz.Year==dfholidaytemp.iloc[nmr,0]),holiday]=1\n\n                dfz.loc[(dict_dfs['train'].Week==dfholidaytempbef.iloc[nmr,1])&(dfz.Year==dfholidaytempbef.iloc[nmr,0]),holbefcol]=1\n\n                dfz.loc[(dict_dfs['train'].Week==dfholidaytempaft.iloc[nmr,1])&(dfz.Year==dfholidaytempaft.iloc[nmr,0]),holaftcol]=1\n        return dfz.drop('Date',axis=1)","metadata":{"_uuid":"ef6630a7-4ff4-407f-9c27-2e3f6d2d6958","_cell_guid":"039f1505-a6f7-46a8-ab9f-89aa01d2d584","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:15.835572Z","iopub.execute_input":"2022-07-06T23:38:15.835981Z","iopub.status.idle":"2022-07-06T23:38:15.857364Z","shell.execute_reply.started":"2022-07-06T23:38:15.835873Z","shell.execute_reply":"2022-07-06T23:38:15.856247Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dict_holidays={\n    'Super Bowl':  ['12-Feb-10', '11-Feb-11', '10-Feb-12', '08-Feb-13'],\n'Labor Day':    ['10-Sep-10', '09-Sep-11', '07-Sep-12', '06-Sep-13'],\n'Thanksgiving': ['26-Nov-10', '25-Nov-11', '23-Nov-12', '29-Nov-13'],\n'Christmas':    ['31-Dec-10', '30-Dec-11', '28-Dec-12', '27-Dec-13'],\n'Valentines Day': ['14-Feb-10', '14-Feb-11', '14-Feb-12', '14-Feb-13'],\n'Mothers Day': ['09-May-10', '08-May-11', '13-May-12', '12-May-13'],\n'Fathers Day': ['20-Jun-10', '19-Jun-11', '17-Jun-12', '16-Jun-13'],\n'Easter': ['04-Apr-10', '24-Apr-11', '08-Apr-12', '31-Mar-13'],\n'Black Friday': ['26-Nov-10', '25-Nov-11', '23-Nov-12', '29-Nov-13']\n}\ndict_holidays={i:[datetime.datetime.strptime(x,'%d-%b-%y') for x in dict_holidays[i]] for i in dict_holidays.keys()}\nlist_columns_date=[]\nlist_columns_date.append('Week')\nlist_columns_date.append('Year')\nlist_columns_date.append('Month')\nlist_columns_date.append('Day')\nX=train.copy(deep=True)\nX[\"Week\"] = pd.to_datetime(X.Date).dt.isocalendar().week\nX[\"Year\"] = pd.to_datetime(X.Date).dt.isocalendar().year\nfor holiday in dict_holidays.keys():\n    holbefcol=holiday+'_before'\n    holaftcol=holiday+'_aft'\n    list_columns_date.append(holiday)\n    list_columns_date.append(holbefcol)\n    list_columns_date.append(holaftcol)","metadata":{"execution":{"iopub.status.busy":"2022-07-06T23:38:15.859108Z","iopub.execute_input":"2022-07-06T23:38:15.860116Z","iopub.status.idle":"2022-07-06T23:38:16.354153Z","shell.execute_reply.started":"2022-07-06T23:38:15.860072Z","shell.execute_reply":"2022-07-06T23:38:16.352659Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pipe_date = make_pipeline(\n    Date_Transformer()\n)","metadata":{"_uuid":"6f85b856-532a-4850-a121-bb8decec6e30","_cell_guid":"f39839a4-9ae6-40c9-8e04-db5705add76a","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:16.355712Z","iopub.execute_input":"2022-07-06T23:38:16.356163Z","iopub.status.idle":"2022-07-06T23:38:16.361916Z","shell.execute_reply.started":"2022-07-06T23:38:16.356119Z","shell.execute_reply":"2022-07-06T23:38:16.360782Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h5 style='color:#ffc220; font-family: Verdana'> Pipe bools</h5>","metadata":{"_uuid":"783c4c89-eeb0-49e5-800f-59bc25359df0","_cell_guid":"551325df-421a-484c-92c4-8e879454e01b","trusted":true}},{"cell_type":"code","source":"bools = train.columns[(train.dtypes == bool)]","metadata":{"_uuid":"c4fcddbd-9a73-47b3-bec2-8d49f66e29f2","_cell_guid":"cee5a735-f1bc-47a1-ae96-0fde81498d19","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:16.363404Z","iopub.execute_input":"2022-07-06T23:38:16.363839Z","iopub.status.idle":"2022-07-06T23:38:16.373964Z","shell.execute_reply.started":"2022-07-06T23:38:16.363798Z","shell.execute_reply":"2022-07-06T23:38:16.373115Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"class bool_transformer(BaseEstimator, TransformerMixin):\n    def fit(self, X, y=None):\n        return self\n    def transform(self, X, y=None):\n        dfz=X.copy(deep=True)\n        dfz=dfz.astype(int)\n        return dfz","metadata":{"_uuid":"b5574c43-2b0c-49ed-ad17-0ece3259dc66","_cell_guid":"d96a88e9-15d2-4186-9aac-66e91ca55e04","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:16.375022Z","iopub.execute_input":"2022-07-06T23:38:16.375719Z","iopub.status.idle":"2022-07-06T23:38:16.386354Z","shell.execute_reply.started":"2022-07-06T23:38:16.375672Z","shell.execute_reply":"2022-07-06T23:38:16.385322Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pipe_bools = make_pipeline(\n    bool_transformer()\n)","metadata":{"_uuid":"dba4791e-6379-4fc5-8f9e-2625b852e261","_cell_guid":"5230f642-bf67-4726-b36f-db3ca6d2312c","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:16.387678Z","iopub.execute_input":"2022-07-06T23:38:16.387994Z","iopub.status.idle":"2022-07-06T23:38:16.400545Z","shell.execute_reply.started":"2022-07-06T23:38:16.387965Z","shell.execute_reply":"2022-07-06T23:38:16.399277Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h5 style='color:#ffc220; font-family: Verdana'> Merge Pipelines</h5>","metadata":{"_uuid":"b03cf10b-f998-4dc5-b47b-f066a93efb73","_cell_guid":"8e47fb0b-0948-4da7-b2a9-a2071523581e","trusted":true}},{"cell_type":"code","source":"pipe_prep =make_column_transformer(\n    (pipe_numerics, numerics),\n    (pipe_cats, categoricals),\n    (pipe_date, ['Date']),\n    (pipe_bools, bools)\n)","metadata":{"_uuid":"0b7bd342-ba21-493b-b711-b153e587d4b1","_cell_guid":"a3b9cc2d-a6e1-4a13-b035-0ae65f2f4b13","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:16.402146Z","iopub.execute_input":"2022-07-06T23:38:16.402906Z","iopub.status.idle":"2022-07-06T23:38:16.412079Z","shell.execute_reply.started":"2022-07-06T23:38:16.402856Z","shell.execute_reply":"2022-07-06T23:38:16.410823Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h4 style='color:#0071dc; font-family: Verdana'> Creating the evaluating methods</h4>","metadata":{"_uuid":"5be98fe7-3567-4d9e-af9f-0905b7b398cc","_cell_guid":"d22b5365-c748-4c8c-8346-9c15bcf2c5d5","trusted":true}},{"cell_type":"markdown","source":"<h5 style='color:#ffc220; font-family: Verdana'> Creating the weighted mean average as suggested by the exercise description</h5>","metadata":{"_uuid":"2de51235-7b70-496c-b6a1-b3ce11808415","_cell_guid":"45a0f9f3-bc50-4ec0-9d31-866e6b29d0b6","trusted":true}},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'> Matric for the train X test evaluation<span>","metadata":{"_uuid":"1fbf646b-935d-40ce-8923-427a21bf2ed6","_cell_guid":"153ca2e2-58da-415b-8fc1-d2b3909cb90d","trusted":true}},{"cell_type":"code","source":"def Custom_WMAE(weights, y_true,y_pred):\n    return np.average(np.abs(y_true - y_pred), weights=weights, axis=0)","metadata":{"_uuid":"653535fe-23a7-4516-929f-b2d3a938e0cd","_cell_guid":"7ee1d1d6-6679-4b4a-a490-4a4a9d467885","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:16.413925Z","iopub.execute_input":"2022-07-06T23:38:16.414776Z","iopub.status.idle":"2022-07-06T23:38:16.425843Z","shell.execute_reply.started":"2022-07-06T23:38:16.414723Z","shell.execute_reply":"2022-07-06T23:38:16.424696Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'> Metric for the crossvalidation score when tuning the parameters</span>","metadata":{"_uuid":"e091653d-4a5c-4283-b50b-b419d2b40e31","_cell_guid":"38d03286-fa63-4f9f-8fb6-462fd350611b","execution":{"iopub.status.busy":"2022-07-05T01:17:11.260899Z","iopub.execute_input":"2022-07-05T01:17:11.261389Z","iopub.status.idle":"2022-07-05T01:17:11.269861Z","shell.execute_reply.started":"2022-07-05T01:17:11.261354Z","shell.execute_reply":"2022-07-05T01:17:11.268207Z"},"trusted":true}},{"cell_type":"code","source":"def Custom_WMAE_train(y_true,y_pred):\n    return np.average(np.abs(y_true - y_pred), weights=train.iloc[y_true.index].IsHoliday.astype(int)*4+1, axis=0)\nCustom_WMAE_train_scorer=make_scorer(Custom_WMAE_train)","metadata":{"_uuid":"8626734c-ff32-452c-9013-1c57e06a3f75","_cell_guid":"8b1481ea-7974-4671-bfa3-bbde6c42824a","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:16.427170Z","iopub.execute_input":"2022-07-06T23:38:16.428404Z","iopub.status.idle":"2022-07-06T23:38:16.439776Z","shell.execute_reply.started":"2022-07-06T23:38:16.428357Z","shell.execute_reply":"2022-07-06T23:38:16.438715Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h5 style='color:#ffc220; font-family: Verdana'> Train test split </h5>","metadata":{"_uuid":"cda37b10-d130-4dd1-a4e7-254173b00ae1","_cell_guid":"088b6389-9d3f-46f9-b6a3-287284fdbe24","trusted":true}},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'> Divinding the dataset in train and test by 'out-of-time' method, it means the train have a range of dates and the test another range, since in crossvalidation we already uses the other commonly used method 'out-of-sample'. <span>","metadata":{"_uuid":"5906133e-f610-4cd2-b7e5-05c13aa722d3","_cell_guid":"cf43e912-ef18-4e05-9a1a-a3bcf2b313fc","trusted":true}},{"cell_type":"code","source":"train.Date.astype(str).str[:7].value_counts().sort_index()","metadata":{"_uuid":"48aa0de3-956a-47e2-9e3d-963a5fc2a95a","_cell_guid":"110f4f65-e8b7-4c7e-afcb-9d8519b021ed","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:16.441114Z","iopub.execute_input":"2022-07-06T23:38:16.441461Z","iopub.status.idle":"2022-07-06T23:38:16.754494Z","shell.execute_reply.started":"2022-07-06T23:38:16.441422Z","shell.execute_reply":"2022-07-06T23:38:16.753316Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'> As 2012 doesn't have the last weeks of the year that are very important and 2010 doesn't have the start of the year, the decision will be to split 2010 and 2011 until october for training and the rest for testing<span>","metadata":{"_uuid":"32f197b4-5d78-4197-b621-d45fca30e567","_cell_guid":"992a90f0-b67c-4fee-a472-561b02b54f11","execution":{"iopub.status.busy":"2022-07-04T04:40:13.95261Z","iopub.execute_input":"2022-07-04T04:40:13.953015Z","iopub.status.idle":"2022-07-04T04:40:13.962026Z","shell.execute_reply.started":"2022-07-04T04:40:13.95298Z","shell.execute_reply":"2022-07-04T04:40:13.960071Z"},"trusted":true}},{"cell_type":"code","source":"pd.to_datetime(train[pd.to_datetime(train.Date).dt.isocalendar().year==2012].Date).dt.isocalendar().week.max()","metadata":{"_uuid":"a4dc7065-b36a-4491-99a7-959d2049bdd7","_cell_guid":"36c35ea7-b901-4f5e-b102-23dee5c7acbc","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:16.755857Z","iopub.execute_input":"2022-07-06T23:38:16.756184Z","iopub.status.idle":"2022-07-06T23:38:17.087219Z","shell.execute_reply.started":"2022-07-06T23:38:16.756155Z","shell.execute_reply":"2022-07-06T23:38:17.085944Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train[(pd.to_datetime(train.Date).dt.isocalendar().year==2011)&(pd.to_datetime(train.Date).dt.isocalendar().week==43)].Date","metadata":{"_uuid":"b50c6c6d-4163-44a7-8280-fd1ec2b4498b","_cell_guid":"b304ac3b-d5ab-46d3-aa40-e648c0a0c2d3","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:17.090708Z","iopub.execute_input":"2022-07-06T23:38:17.091040Z","iopub.status.idle":"2022-07-06T23:38:17.568907Z","shell.execute_reply.started":"2022-07-06T23:38:17.091011Z","shell.execute_reply":"2022-07-06T23:38:17.568048Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X_train=pipe_prep.fit_transform(train[train.Date<='2011-10-28'].drop('Weekly_Sales',axis=1).reset_index(drop=True))","metadata":{"_uuid":"fb58aaad-8533-4bdc-8dfa-191623dbf26d","_cell_guid":"1aeee729-d9ee-47d2-be66-fb2533118dbf","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:17.569973Z","iopub.execute_input":"2022-07-06T23:38:17.570650Z","iopub.status.idle":"2022-07-06T23:38:36.432514Z","shell.execute_reply.started":"2022-07-06T23:38:17.570618Z","shell.execute_reply":"2022-07-06T23:38:36.431497Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X_test=pipe_prep.transform(train[train.Date>'2011-10-28'].drop('Weekly_Sales',axis=1).reset_index(drop=True))","metadata":{"execution":{"iopub.status.busy":"2022-07-06T23:38:36.433877Z","iopub.execute_input":"2022-07-06T23:38:36.434216Z","iopub.status.idle":"2022-07-06T23:38:53.105439Z","shell.execute_reply.started":"2022-07-06T23:38:36.434186Z","shell.execute_reply":"2022-07-06T23:38:53.104451Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"y_train=train[train.Date<='2011-10-28']['Weekly_Sales'].reset_index(drop=True)\ny_test=train[train.Date>'2011-10-28']['Weekly_Sales'].reset_index(drop=True)","metadata":{"execution":{"iopub.status.busy":"2022-07-06T23:38:53.106515Z","iopub.execute_input":"2022-07-06T23:38:53.107438Z","iopub.status.idle":"2022-07-06T23:38:53.259584Z","shell.execute_reply.started":"2022-07-06T23:38:53.107403Z","shell.execute_reply":"2022-07-06T23:38:53.258537Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X_train_raw=train[train.Date<='2011-10-28'].drop('Weekly_Sales',axis=1).reset_index(drop=True)\nX_test_raw=train[train.Date>'2011-10-28'].drop('Weekly_Sales',axis=1).reset_index(drop=True)","metadata":{"execution":{"iopub.status.busy":"2022-07-06T23:38:53.260983Z","iopub.execute_input":"2022-07-06T23:38:53.261331Z","iopub.status.idle":"2022-07-06T23:38:53.440310Z","shell.execute_reply.started":"2022-07-06T23:38:53.261300Z","shell.execute_reply":"2022-07-06T23:38:53.439184Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X_train_weights=train[train.Date<='2011-10-28'].IsHoliday.astype(int)*4+1\nX_train_weights=X_train_weights.reset_index(drop=True)\nX_test_weights=train[train.Date>'2011-10-28'].IsHoliday.astype(int)*4+1\nX_test_weights=X_test_weights.reset_index(drop=True)","metadata":{"_uuid":"8f0397df-d216-4655-8b1b-8de2dbddc455","_cell_guid":"0dd3c6ec-af63-4491-8440-4bef35728d4d","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:53.442360Z","iopub.execute_input":"2022-07-06T23:38:53.443037Z","iopub.status.idle":"2022-07-06T23:38:53.600393Z","shell.execute_reply.started":"2022-07-06T23:38:53.442992Z","shell.execute_reply":"2022-07-06T23:38:53.599274Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h5 style='color:#ffc220; font-family: Verdana'> Function to test models </h5>","metadata":{"_uuid":"90dceda7-8ba6-47c2-9a0f-c581ecafee0e","_cell_guid":"b5b664e7-9108-4e10-b0c9-e21df1fac347","trusted":true}},{"cell_type":"code","source":"dict_models={'lgbm':LGBMRegressor(n_jobs=-1,random_state=42),\n             'rf':RandomForestRegressor(n_jobs=-1,random_state=42),\n             'xgb':XGBRegressor(n_jobs=-1,random_state=42),\n             'en':ElasticNet(random_state=42),\n             'lr':LinearRegression(n_jobs=-1)}","metadata":{"_uuid":"d282e2af-a377-4605-9dc6-1ed9dc9cdde9","_cell_guid":"d5de4563-370c-42f7-a13d-8e378d518707","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:53.601788Z","iopub.execute_input":"2022-07-06T23:38:53.602128Z","iopub.status.idle":"2022-07-06T23:38:53.608099Z","shell.execute_reply.started":"2022-07-06T23:38:53.602088Z","shell.execute_reply":"2022-07-06T23:38:53.606961Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'> Function to test models without tuning the hyperparameters<span>","metadata":{"_uuid":"60fd629d-a1cc-4e8b-86c0-a0dfd1580686","_cell_guid":"6e92aae0-6410-416d-8e0c-7dac990a6ade","trusted":true}},{"cell_type":"code","source":"def models_baseline_evaluation(model,X_train,y_train,X_test,y_test,X_train_weights,X_test_weights):\n    start_time = time.time()\n    model.fit(X_train,y_train)\n    y_pred_train=model.predict(X_train)\n    y_pred_test=model.predict(X_test)\n    wmae_train=Custom_WMAE(X_train_weights,y_train,y_pred_train)\n    wmae_test=Custom_WMAE(X_test_weights,y_test,y_pred_test)\n    return print('Model:',str(model).split('(')[0],'Train Score:',wmae_train,'Test Score:',wmae_test,'Time:', (time.time() - start_time),'seconds')","metadata":{"_uuid":"9a0ec0b1-c277-450c-8fac-065072af2e7e","_cell_guid":"bcf73cb1-8af7-4943-90cd-28eef3a59de5","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:38:53.609721Z","iopub.execute_input":"2022-07-06T23:38:53.610016Z","iopub.status.idle":"2022-07-06T23:38:53.623844Z","shell.execute_reply.started":"2022-07-06T23:38:53.609990Z","shell.execute_reply":"2022-07-06T23:38:53.622727Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'> Function to test models with tuning the hyperparameters<span>","metadata":{"_uuid":"75d4db96-6d44-4875-9320-eec548f08988","_cell_guid":"efa990ef-e956-448a-83d2-087221a674cc","trusted":true}},{"cell_type":"code","source":"def models_with_tuning_evaluation(model,param,X_train,y_train,X_test,y_test,X_train_weights,X_test_weights):\n\n    kfold = KFold(n_splits=3)\n    random_search = RandomizedSearchCV(\n        estimator=model,\n        param_distributions= random_grid,\n        cv = kfold,\n        verbose = 10,\n        n_iter=30,\n        n_jobs=1,\n        return_train_score=True,\n        scoring=Custom_WMAE_train_scorer)\n    \n    random_search.fit(X_train, y_train)\n    df_results_cv=pd.DataFrame(random_search.cv_results_).sort_values('mean_test_score')\n    df_results_cv['Overfit']=df_results_cv.mean_train_score/df_results_cv.mean_test_score\n    \n    return df_results_cv","metadata":{"_uuid":"6a745986-7d07-4bc5-9770-1d63d1d9493c","_cell_guid":"d397eb4d-67f2-475c-9fc4-259813287296","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-06T23:52:35.756973Z","iopub.execute_input":"2022-07-06T23:52:35.757995Z","iopub.status.idle":"2022-07-06T23:52:35.768481Z","shell.execute_reply.started":"2022-07-06T23:52:35.757939Z","shell.execute_reply":"2022-07-06T23:52:35.767203Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'> Function plot the models X the true values<span>","metadata":{}},{"cell_type":"code","source":"def model_evaluator(model,name):\n    model_train_predict=model.predict(X_train_raw)\n    model_test_predict=model.predict(X_test_raw)\n    print('Train WMAE:',Custom_WMAE(X_train_weights, y_train, model_train_predict))\n    print('Test WMAE:',Custom_WMAE(X_test_weights, y_test, model_test_predict))\n    model_predicted_week_sales=pd.DataFrame(list(model_train_predict)+list(model_test_predict),columns=[f'Weekly_Sales_{name}'])\n    df_plot=pd.concat([train[['Date','Weekly_Sales']],model_predicted_week_sales],axis=1)\n    df_plot=df_plot.groupby('Date',as_index=False).mean()\n    return pd.concat([X_train_raw.join(pd.Series(model_train_predict,name='pred')).join(pd.Series(y_train,name='true')).sort_values('Date').groupby('Date').mean()[['true']],X_test_raw.join(pd.Series(model_test_predict,name='pred')).join(pd.Series(y_test,name='true')).sort_values('Date').groupby('Date').mean()[['pred']]],axis=0).plot.line(figsize=(16,8))","metadata":{"execution":{"iopub.status.busy":"2022-07-06T23:38:53.640451Z","iopub.execute_input":"2022-07-06T23:38:53.640947Z","iopub.status.idle":"2022-07-06T23:38:53.653119Z","shell.execute_reply.started":"2022-07-06T23:38:53.640917Z","shell.execute_reply":"2022-07-06T23:38:53.651975Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def plot_feature_importance(model):\n    features=[x for i in model.named_steps['prep'].get_params()['transformers'] for x  in list(i[2]) ]\n    features.remove('Date')\n    features=features+list_columns_date+['IsHoliday']\n    features.remove('IsHoliday')\n    fig1=px.bar(pd.DataFrame(model['model'].feature_importances_,index=features,columns=['FI']).sort_values('FI',ascending=False),orientation='h',title='Importances by split',height=600)\n    fig1.show()\n    if 'lgbm' in str(model['model']).lower():\n        fig2=px.bar(pd.DataFrame(model['model'].booster_.feature_importance(importance_type='gain'),index=features,columns=['FI']).sort_values('FI',ascending=False),orientation='h',title='Importances by gain',height=600)\n        fig2.show()","metadata":{"execution":{"iopub.status.busy":"2022-07-07T00:17:50.444382Z","iopub.execute_input":"2022-07-07T00:17:50.444815Z","iopub.status.idle":"2022-07-07T00:17:50.456360Z","shell.execute_reply.started":"2022-07-07T00:17:50.444779Z","shell.execute_reply":"2022-07-07T00:17:50.455065Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h4 style='color:#0071dc; font-family: Verdana'> Evaluating models</h4>","metadata":{"_uuid":"5447c30b-3103-4355-bdea-3ac1642970e7","_cell_guid":"218451ba-5b01-4141-9370-3fbc107e74f2","execution":{"iopub.status.busy":"2022-07-04T12:55:13.298793Z","iopub.execute_input":"2022-07-04T12:55:13.299195Z","iopub.status.idle":"2022-07-04T12:55:15.13661Z","shell.execute_reply.started":"2022-07-04T12:55:13.29916Z","shell.execute_reply":"2022-07-04T12:55:15.135578Z"},"trusted":true}},{"cell_type":"markdown","source":"<h5 style='color:#ffc220; font-family: Verdana'> Evaluating baselines</h5>","metadata":{"_uuid":"5947988d-66ff-4016-a304-11ab1ee6aa17","_cell_guid":"eff0caf4-b603-4b53-a160-d9847b4bda55","execution":{"iopub.status.busy":"2022-07-04T12:55:15.137915Z","iopub.execute_input":"2022-07-04T12:55:15.138448Z","iopub.status.idle":"2022-07-04T12:55:17.908302Z","shell.execute_reply.started":"2022-07-04T12:55:15.138399Z","shell.execute_reply":"2022-07-04T12:55:17.906949Z"},"trusted":true}},{"cell_type":"code","source":"for model in dict_models.keys():\n    models_baseline_evaluation(dict_models[model],X_train,y_train,X_test,y_test,X_train_weights,X_test_weights)","metadata":{"execution":{"iopub.status.busy":"2022-07-06T23:38:53.671334Z","iopub.execute_input":"2022-07-06T23:38:53.672334Z","iopub.status.idle":"2022-07-06T23:40:49.922602Z","shell.execute_reply.started":"2022-07-06T23:38:53.672289Z","shell.execute_reply":"2022-07-06T23:40:49.921115Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'> As said before, the linear models did not predict very well our target, probably because we do not have many strong linear relationships. Also, XGBRegressor wont be tested mainly because of time consuming and lgbm is similar but faster.\nDecision here to focus on the LGBMRegressor and or Randim Forest as an MVP.<span>","metadata":{"_uuid":"22d57fb9-e62d-4dd2-a6b4-37165311abb4","_cell_guid":"230ec55a-c4be-4f63-8ea4-7d3cef0a042e","execution":{"iopub.status.busy":"2022-07-04T12:55:17.925622Z","iopub.execute_input":"2022-07-04T12:55:17.926747Z","iopub.status.idle":"2022-07-04T12:55:17.937794Z","shell.execute_reply.started":"2022-07-04T12:55:17.926701Z","shell.execute_reply":"2022-07-04T12:55:17.936528Z"},"trusted":true}},{"cell_type":"markdown","source":"<h5 style='color:#ffc220; font-family: Verdana'> Evaluating models with tuning search </h5>","metadata":{"_uuid":"0182c6e8-b391-4af8-b1b7-e9afc07403af","_cell_guid":"e3c7b5db-0dee-496f-898b-5d04f4ff4225","trusted":true}},{"cell_type":"markdown","source":"<span style='color:#0071dc; font-family: Verdana'> Random Search for hyperparameters tuning for the Lgbm<span>","metadata":{"_uuid":"b6c4d772-ef69-4dce-96e8-65802bef813e","_cell_guid":"df859374-64f2-4637-9edf-02b9db66711c","trusted":true}},{"cell_type":"code","source":"max_bin  = [int(x) for x in range(20, 500,50)]\nnum_leaves = [int(x) for x in range(20, 500,50)]\nnum_iterations = [i for i in range(20, 500,50)]\nlearning_rate = [i for i in np.arange(0.02, 0.3, 0.03)]\n\nrandom_grid = {\n'max_bin': max_bin,\n'num_leaves': num_leaves,\n'learning_rate' :learning_rate,\n'num_iterations' :num_iterations\n}","metadata":{"_uuid":"9aba2a77-0fa3-45d4-9975-6fe2e230a832","_cell_guid":"befcb189-564d-49a7-946b-6a9bba10ab92","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-07T01:53:00.978549Z","iopub.execute_input":"2022-07-07T01:53:00.978966Z","iopub.status.idle":"2022-07-07T01:53:00.986794Z","shell.execute_reply.started":"2022-07-07T01:53:00.978931Z","shell.execute_reply":"2022-07-07T01:53:00.985524Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_results_cv_lgb=models_with_tuning_evaluation(dict_models['lgbm'],random_grid,X_train,y_train,X_test,y_test,X_train_weights,X_test_weights)","metadata":{"_uuid":"7e0fd279-ce68-4c2a-9f2a-f514572981fa","_cell_guid":"64b1ab3c-c921-4b19-a294-10b69c53b820","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-07T01:53:03.002036Z","iopub.execute_input":"2022-07-07T01:53:03.002468Z","iopub.status.idle":"2022-07-07T02:05:51.832059Z","shell.execute_reply.started":"2022-07-07T01:53:03.002434Z","shell.execute_reply":"2022-07-07T02:05:51.830751Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:#0071dc; font-family: Verdana'> Choosing the best parameters for performance X overfiting <span>","metadata":{}},{"cell_type":"code","source":"df_results_cv_lgb.sort_values(\"mean_train_score\")","metadata":{"execution":{"iopub.status.busy":"2022-07-07T02:07:30.797101Z","iopub.execute_input":"2022-07-07T02:07:30.798429Z","iopub.status.idle":"2022-07-07T02:07:30.857775Z","shell.execute_reply.started":"2022-07-07T02:07:30.798388Z","shell.execute_reply":"2022-07-07T02:07:30.856144Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_results_cv_lgb.sort_values(\"mean_train_score\").iloc[0].params","metadata":{"execution":{"iopub.status.busy":"2022-07-07T02:08:00.117621Z","iopub.execute_input":"2022-07-07T02:08:00.118069Z","iopub.status.idle":"2022-07-07T02:08:00.128498Z","shell.execute_reply.started":"2022-07-07T02:08:00.118035Z","shell.execute_reply":"2022-07-07T02:08:00.127566Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"px.scatter_matrix(df_results_cv_lgb[['mean_train_score','Overfit']].join(df_results_cv_lgb.params.apply(pd.Series)),height=600,width=1100)","metadata":{"execution":{"iopub.status.busy":"2022-07-07T02:08:05.363339Z","iopub.execute_input":"2022-07-07T02:08:05.363723Z","iopub.status.idle":"2022-07-07T02:08:05.446909Z","shell.execute_reply.started":"2022-07-07T02:08:05.363694Z","shell.execute_reply":"2022-07-07T02:08:05.445548Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'> Choosing params that are more correlated to small errors <span>","metadata":{}},{"cell_type":"markdown","source":"<span style='color:#0071dc; font-family: Verdana'> Fiting the best overfit x performance model <span>","metadata":{}},{"cell_type":"code","source":"{'num_leaves': 470,\n 'num_iterations': 270,\n 'max_bin': 120,\n 'learning_rate': 0.23}","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"lgb=LGBMRegressor(random_state=42,n_jobs=-1, num_leaves= 470, learning_rate = 0.23,num_iterations=270, max_bin=120) ","metadata":{"execution":{"iopub.status.busy":"2022-07-07T02:10:10.552725Z","iopub.execute_input":"2022-07-07T02:10:10.553157Z","iopub.status.idle":"2022-07-07T02:10:10.560682Z","shell.execute_reply.started":"2022-07-07T02:10:10.553123Z","shell.execute_reply":"2022-07-07T02:10:10.559522Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pkl_lgb=Pipeline(steps=[('prep',pipe_prep),('model',lgb)])","metadata":{"execution":{"iopub.status.busy":"2022-07-07T02:10:12.801528Z","iopub.execute_input":"2022-07-07T02:10:12.801993Z","iopub.status.idle":"2022-07-07T02:10:12.808720Z","shell.execute_reply.started":"2022-07-07T02:10:12.801958Z","shell.execute_reply":"2022-07-07T02:10:12.807308Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:#0071dc; font-family: Verdana'> Adding weights <span>","metadata":{"execution":{"iopub.status.busy":"2022-07-06T19:35:27.035061Z","iopub.execute_input":"2022-07-06T19:35:27.035514Z","iopub.status.idle":"2022-07-06T19:35:27.042749Z","shell.execute_reply.started":"2022-07-06T19:35:27.035482Z","shell.execute_reply":"2022-07-06T19:35:27.041341Z"}}},{"cell_type":"code","source":"coldt=pd.to_datetime(X_train_raw.Date)\nweightmultiplier=pd.Series((coldt.dt.isocalendar().week==47)|(coldt.dt.isocalendar().week==51)).astype(int)*9+1","metadata":{"execution":{"iopub.status.busy":"2022-07-07T02:10:17.827128Z","iopub.execute_input":"2022-07-07T02:10:17.827546Z","iopub.status.idle":"2022-07-07T02:10:18.093296Z","shell.execute_reply.started":"2022-07-07T02:10:17.827514Z","shell.execute_reply":"2022-07-07T02:10:18.092106Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'> Because Thanksgiving and Christmas are huge outliers in sales, the model usually have a hard time predicting them so, weights are beeing added to the fitting parameters.<span>","metadata":{}},{"cell_type":"code","source":"pkl_lgb.fit(X_train_raw,y_train,**{'model__sample_weight': X_train_weights*weightmultiplier})","metadata":{"execution":{"iopub.status.busy":"2022-07-07T02:10:21.553344Z","iopub.execute_input":"2022-07-07T02:10:21.553734Z","iopub.status.idle":"2022-07-07T02:10:48.537740Z","shell.execute_reply.started":"2022-07-07T02:10:21.553705Z","shell.execute_reply":"2022-07-07T02:10:48.536613Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:#0071dc; font-family: Verdana'> Evaluating the model<span>","metadata":{"execution":{"iopub.status.busy":"2022-07-05T16:43:03.079259Z","iopub.execute_input":"2022-07-05T16:43:03.079882Z","iopub.status.idle":"2022-07-05T16:43:03.08933Z","shell.execute_reply.started":"2022-07-05T16:43:03.079832Z","shell.execute_reply":"2022-07-05T16:43:03.087655Z"}}},{"cell_type":"code","source":"model_evaluator(pkl_lgb,'LightGBM')","metadata":{"execution":{"iopub.status.busy":"2022-07-07T02:11:29.695480Z","iopub.execute_input":"2022-07-07T02:11:29.695890Z","iopub.status.idle":"2022-07-07T02:12:13.991402Z","shell.execute_reply.started":"2022-07-07T02:11:29.695859Z","shell.execute_reply":"2022-07-07T02:12:13.990003Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'> It is possible to see that the model was abel to fit very well specially when dealing with the outliers of christmas and thanksgiving, because of the weights added to them.<span>","metadata":{}},{"cell_type":"markdown","source":"<span style='color:#0071dc; font-family: Verdana'> Evaluating the importance of the features by the model.<span>","metadata":{}},{"cell_type":"code","source":"plot_feature_importance(pkl_lgb)","metadata":{"execution":{"iopub.status.busy":"2022-07-07T02:22:24.407892Z","iopub.execute_input":"2022-07-07T02:22:24.408294Z","iopub.status.idle":"2022-07-07T02:22:24.569444Z","shell.execute_reply.started":"2022-07-07T02:22:24.408262Z","shell.execute_reply":"2022-07-07T02:22:24.567936Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'> \n   <ul style='color:gray; font-family: Verdana'>\n    <li>As seen on the charts that were made above about stores and departments, that is a big differente in sales for some of them and that might have helped to make it important. </li>\n        <li> Also a variable like week is very important too and that because as said above the number of the week can diferentiate high and low sales periods.</li>\n                <li>As expected the holiday variables did not get so much importance, it was expected becuase variables like week can already explain them.</li>\n    </ul>\n<span>","metadata":{}},{"cell_type":"markdown","source":"<span style='color:#0071dc; font-family: Verdana'> Random Search for hyperparameters tuning for the RandomForest<span>","metadata":{"_uuid":"b6c4d772-ef69-4dce-96e8-65802bef813e","_cell_guid":"df859374-64f2-4637-9edf-02b9db66711c","trusted":true}},{"cell_type":"code","source":"n_estimators = [50,150]\nmax_depth = [None]+[int(x) for x in range(2, 15, 3)]\nmax_features = [i/10 for i in range(4, 9, 1)]\n\nrandom_grid = {\n'n_estimators': n_estimators,\n'max_depth': max_depth,\n'max_features' : max_features,\n}","metadata":{"_uuid":"9aba2a77-0fa3-45d4-9975-6fe2e230a832","_cell_guid":"befcb189-564d-49a7-946b-6a9bba10ab92","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-07T00:18:19.876575Z","iopub.execute_input":"2022-07-07T00:18:19.877006Z","iopub.status.idle":"2022-07-07T00:18:19.884287Z","shell.execute_reply.started":"2022-07-07T00:18:19.876973Z","shell.execute_reply":"2022-07-07T00:18:19.883402Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_results_cv_rf=models_with_tuning_evaluation(dict_models['rf'],random_grid,X_train,y_train,X_test,y_test,X_train_weights,X_test_weights)","metadata":{"_uuid":"7e0fd279-ce68-4c2a-9f2a-f514572981fa","_cell_guid":"64b1ab3c-c921-4b19-a294-10b69c53b820","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-07T00:18:22.027849Z","iopub.execute_input":"2022-07-07T00:18:22.028636Z","iopub.status.idle":"2022-07-07T00:50:26.499117Z","shell.execute_reply.started":"2022-07-07T00:18:22.028596Z","shell.execute_reply":"2022-07-07T00:50:26.497781Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_results_cv_rf.sort_values(\"mean_train_score\")","metadata":{"execution":{"iopub.status.busy":"2022-07-07T00:52:04.486356Z","iopub.execute_input":"2022-07-07T00:52:04.486770Z","iopub.status.idle":"2022-07-07T00:52:04.540145Z","shell.execute_reply.started":"2022-07-07T00:52:04.486736Z","shell.execute_reply":"2022-07-07T00:52:04.539448Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_results_cv_rf.sort_values(\"mean_train_score\").iloc[0].params","metadata":{"execution":{"iopub.status.busy":"2022-07-07T00:52:18.205823Z","iopub.execute_input":"2022-07-07T00:52:18.206258Z","iopub.status.idle":"2022-07-07T00:52:18.214743Z","shell.execute_reply.started":"2022-07-07T00:52:18.206212Z","shell.execute_reply":"2022-07-07T00:52:18.213524Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"px.scatter_matrix(df_results_cv_rf[['mean_test_score','Overfit']].join(df_results_cv_rf.params.apply(pd.Series)),height=600,width=1100)","metadata":{"execution":{"iopub.status.busy":"2022-07-07T00:52:21.861681Z","iopub.execute_input":"2022-07-07T00:52:21.862126Z","iopub.status.idle":"2022-07-07T00:52:21.941785Z","shell.execute_reply.started":"2022-07-07T00:52:21.862090Z","shell.execute_reply":"2022-07-07T00:52:21.940482Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'> Choosing params that are more correlated to small errors <span>","metadata":{}},{"cell_type":"markdown","source":"<span style='color:#0071dc; font-family: Verdana'> Fiting the best overfit x performance model <span>","metadata":{}},{"cell_type":"code","source":"rf=RandomForestRegressor(random_state=42, n_jobs=-1, n_estimators = 150, max_features = 0.7, max_depth =None) ","metadata":{"execution":{"iopub.status.busy":"2022-07-07T00:53:03.570238Z","iopub.execute_input":"2022-07-07T00:53:03.570691Z","iopub.status.idle":"2022-07-07T00:53:03.577157Z","shell.execute_reply.started":"2022-07-07T00:53:03.570656Z","shell.execute_reply":"2022-07-07T00:53:03.575717Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pkl_rf=Pipeline([('prep',pipe_prep),('model',rf)])","metadata":{"execution":{"iopub.status.busy":"2022-07-07T00:53:05.485380Z","iopub.execute_input":"2022-07-07T00:53:05.486243Z","iopub.status.idle":"2022-07-07T00:53:05.492004Z","shell.execute_reply.started":"2022-07-07T00:53:05.486162Z","shell.execute_reply":"2022-07-07T00:53:05.491142Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"coldt=pd.to_datetime(X_train_raw.Date)\nweightmultiplier=pd.Series((coldt.dt.isocalendar().week==47)|(coldt.dt.isocalendar().week==51)).astype(int)*9+1","metadata":{"execution":{"iopub.status.busy":"2022-07-07T00:53:07.016153Z","iopub.execute_input":"2022-07-07T00:53:07.017620Z","iopub.status.idle":"2022-07-07T00:53:07.283788Z","shell.execute_reply.started":"2022-07-07T00:53:07.017561Z","shell.execute_reply":"2022-07-07T00:53:07.282485Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pkl_rf.fit(X_train_raw,y_train,**{'model__sample_weight': X_train_weights*weightmultiplier})","metadata":{"execution":{"iopub.status.busy":"2022-07-07T00:53:08.303698Z","iopub.execute_input":"2022-07-07T00:53:08.304564Z","iopub.status.idle":"2022-07-07T00:54:44.368405Z","shell.execute_reply.started":"2022-07-07T00:53:08.304517Z","shell.execute_reply":"2022-07-07T00:54:44.367124Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:#0071dc; font-family: Verdana'> Evaluating the model<span>","metadata":{"execution":{"iopub.status.busy":"2022-07-05T16:43:03.079259Z","iopub.execute_input":"2022-07-05T16:43:03.079882Z","iopub.status.idle":"2022-07-05T16:43:03.08933Z","shell.execute_reply.started":"2022-07-05T16:43:03.079832Z","shell.execute_reply":"2022-07-05T16:43:03.087655Z"}}},{"cell_type":"code","source":"model_evaluator(pkl_rf,'Random Forest')","metadata":{"execution":{"iopub.status.busy":"2022-07-07T00:54:44.370302Z","iopub.execute_input":"2022-07-07T00:54:44.370629Z","iopub.status.idle":"2022-07-07T00:55:27.981066Z","shell.execute_reply.started":"2022-07-07T00:54:44.370599Z","shell.execute_reply":"2022-07-07T00:55:27.979609Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'> <ul style='color:gray; font-family: Verdana'>  Random Forest generally has a little bit more bias then the lgbm and that is the main distinction between boosting and just bagging models like random forest,boosting tends to overfit a little bit more whereas models with just bagging tends to add more bias, which is good sometimes but maybe not too much for the case here because sales are ciclic as seen by the charts and are very similar through their dates in the year. However in both cases it is possible to tune the model parameters to get the results expected.\n<span>","metadata":{}},{"cell_type":"markdown","source":"<span style='color:#0071dc; font-family: Verdana'> Evaluating the feaures<span>","metadata":{"execution":{"iopub.status.busy":"2022-07-05T16:43:03.079259Z","iopub.execute_input":"2022-07-05T16:43:03.079882Z","iopub.status.idle":"2022-07-05T16:43:03.08933Z","shell.execute_reply.started":"2022-07-05T16:43:03.079832Z","shell.execute_reply":"2022-07-05T16:43:03.087655Z"}}},{"cell_type":"code","source":"plot_feature_importance(pkl_rf)","metadata":{"execution":{"iopub.status.busy":"2022-07-07T01:02:36.041849Z","iopub.execute_input":"2022-07-07T01:02:36.042309Z","iopub.status.idle":"2022-07-07T01:02:36.423531Z","shell.execute_reply.started":"2022-07-07T01:02:36.042270Z","shell.execute_reply":"2022-07-07T01:02:36.422094Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'> <ul style='color:gray; font-family: Verdana'> The feature importance is very similar to the one from the lgbm so the same comments from the lgbm applies to this one.\n<span>","metadata":{}},{"cell_type":"markdown","source":"<h2 style='color:#ffc220; font-family: Verdana'> Conclusions</h2>","metadata":{"_uuid":"b8f13cdf-ac70-4457-b303-96050eaf792e","_cell_guid":"e8c025e7-8425-4ddf-b2b9-e8993e933b82","trusted":true}},{"cell_type":"markdown","source":"<span style='color:gray; font-family: Verdana'> <ul style='color:gray; font-family: Verdana'>\n    <li>It is a bit hard to tune the parameters for the models because one of them tends to overfit and the other to underfit.</li>\n    <li>As expected the parameters of Store and Dept ranked by their sales had the best importances on the model because it actually reflects how high the sales should be by row.</li>\n    <li>Also, clearly at some times of the year like at the end, start of the year and at holidays, there are some huge outliers, so using the weights helped a lot to not bias in that times of the year.</li>\n    <li>Actually it seems that as the sales are very ciclic it is good to overfit a little the models.</li>\n<span>","metadata":{"_uuid":"3343e553-fda3-4a76-9c01-6b2eddf6fca1","_cell_guid":"f8bb7a61-7768-42ac-bb91-b28e5607e256","trusted":true}},{"cell_type":"markdown","source":"<h2 style='color:#ffc220; font-family: Verdana'> Final results</h2>","metadata":{"_uuid":"b8f13cdf-ac70-4457-b303-96050eaf792e","_cell_guid":"e8c025e7-8425-4ddf-b2b9-e8993e933b82","trusted":true}},{"cell_type":"markdown","source":"<h3 style='color:#0071dc; font-family: Verdana'> Making predictions to submit </h3>","metadata":{"_uuid":"e9b90fd1-14d9-44de-8058-38776caeb409","_cell_guid":"0e303c92-6240-4052-9b81-2e6bf7b9f95d","trusted":true}},{"cell_type":"code","source":"Xfinal=test","metadata":{"_uuid":"0b827e8d-e396-4fb1-899b-3a1a7784faf3","_cell_guid":"a702bf24-0fc0-4186-9ca2-5509cdda173e","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-07T02:22:52.963913Z","iopub.execute_input":"2022-07-07T02:22:52.964316Z","iopub.status.idle":"2022-07-07T02:22:52.970523Z","shell.execute_reply.started":"2022-07-07T02:22:52.964283Z","shell.execute_reply":"2022-07-07T02:22:52.969016Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"preditos=pkl_lgb.predict(Xfinal)","metadata":{"_uuid":"325bd33b-b85e-4dc6-a3e2-7304edc74681","_cell_guid":"04606cb5-233a-4c3f-a09a-98f8015f2d27","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-07T02:22:53.749885Z","iopub.execute_input":"2022-07-07T02:22:53.750392Z","iopub.status.idle":"2022-07-07T02:23:11.575866Z","shell.execute_reply.started":"2022-07-07T02:22:53.750353Z","shell.execute_reply":"2022-07-07T02:23:11.574855Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"preditos=pd.Series(preditos)","metadata":{"_uuid":"ee99e7cd-6bc2-4b50-9e75-d3129ec967a1","_cell_guid":"c5b2f43f-07a8-44c6-997d-94bd18b6d646","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-07T02:23:11.578165Z","iopub.execute_input":"2022-07-07T02:23:11.578877Z","iopub.status.idle":"2022-07-07T02:23:11.584600Z","shell.execute_reply.started":"2022-07-07T02:23:11.578829Z","shell.execute_reply":"2022-07-07T02:23:11.583437Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ids=dict_dfs['test']['Store'].apply(lambda x: str(x)+'_')+dict_dfs['test']['Dept'].apply(lambda x: str(x)+'_')+dict_dfs['test']['Date'].astype(str)","metadata":{"_uuid":"31c7bc13-b54e-497a-8ed4-319cbaedc304","_cell_guid":"073292ab-b728-4d2b-bbcd-393ffae86887","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-07T02:23:11.586268Z","iopub.execute_input":"2022-07-07T02:23:11.587152Z","iopub.status.idle":"2022-07-07T02:23:11.774199Z","shell.execute_reply.started":"2022-07-07T02:23:11.587103Z","shell.execute_reply":"2022-07-07T02:23:11.773289Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"tabela_final=pd.concat([ids,preditos],axis=1)\ntabela_final=tabela_final.rename(columns={0:'Id',1:'Weekly_Sales'})","metadata":{"_uuid":"bf059f0f-405b-48da-a6b5-39599a4b4306","_cell_guid":"848b7d94-0d92-49e9-868b-2a8b043559fb","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-07T02:23:11.778949Z","iopub.execute_input":"2022-07-07T02:23:11.779503Z","iopub.status.idle":"2022-07-07T02:23:11.791955Z","shell.execute_reply.started":"2022-07-07T02:23:11.779455Z","shell.execute_reply":"2022-07-07T02:23:11.790623Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"tabela_final","metadata":{"_uuid":"bac08d1b-cb1c-437e-9f2f-1d585203f360","_cell_guid":"b8452c2a-3547-46b7-873f-49454121004a","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-07T02:23:11.793834Z","iopub.execute_input":"2022-07-07T02:23:11.794520Z","iopub.status.idle":"2022-07-07T02:23:11.810810Z","shell.execute_reply.started":"2022-07-07T02:23:11.794474Z","shell.execute_reply":"2022-07-07T02:23:11.809582Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"tabela_final.to_csv('Reposta_Walmart.csv',index=False)","metadata":{"_uuid":"39d3a0b8-2080-4e8f-a784-c15b63a9179e","_cell_guid":"97f9768e-6e40-435a-a552-23d2963d58ca","collapsed":false,"jupyter":{"outputs_hidden":false},"execution":{"iopub.status.busy":"2022-07-07T02:23:11.812402Z","iopub.execute_input":"2022-07-07T02:23:11.813691Z","iopub.status.idle":"2022-07-07T02:23:12.300625Z","shell.execute_reply.started":"2022-07-07T02:23:11.813646Z","shell.execute_reply":"2022-07-07T02:23:12.299201Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h3 style='color:#0071dc; font-family: Verdana'> Final score </h3>","metadata":{"_uuid":"e9b90fd1-14d9-44de-8058-38776caeb409","_cell_guid":"0e303c92-6240-4052-9b81-2e6bf7b9f95d","trusted":true}},{"cell_type":"markdown","source":"![image.png](attachment:fc4ff9fe-2704-430d-9c49-ad908bd8a942.png)","metadata":{},"attachments":{"fc4ff9fe-2704-430d-9c49-ad908bd8a942.png":{"image/png":"iVBORw0KGgoAAAANSUhEUgAAA/kAAADKCAYAAAD+Q4CSAAAgAElEQVR4XuydD1xUVfr/P99smTLD1RY3dyVrwWrBtsC2gjWFXI1cdTIDbVXaUDL/pmJmlCFZSKZi/s1QKtRNITXUlDQXSn9QbsK2CbslbBn01XVWXYmsoez7e87M3Jk7wwyMOJgyn/t67WvTuffc87zPudf7Oc+f8z//Jwd4kAAJkAAJkAAJkAAJkAAJkAAJkAAJXPQE/oci/6IfQxpAAiRAAiRAAiRAAiRAAiRAAiRAAhYCFPmcCCRAAiRAAiRAAiRAAiRAAiRAAiTQRghQ5LeRgaQZJEACJEACJEACJEACJEACJEACJECRzzlAAiRAAiRAAiRAAiRAAiRAAiRAAm2EAEV+GxlImkECJEACJEACJEACJEACJEACJEACPhf5P/zwA77++huc/vZbmM0N+P7773HmzA8kTQIkQAIkQAIkQAIkQAIkQAIkQAJ+TaBdu0tw6aWXwmAIQPvLLsMVV1yOSy65xKdMfCbyGxq+w8lTdairq0eHK9qj/eWXwXBZAH5y6U+gDOFBAiRAAiRAAiRAAiRAAiRAAiRAAv5MQDnAv/v+O5i/bcDpb75F/denERjYAZ06BiIg4Cc+QeMTkf+f4ydxSsR9p58GomPglRT1PhkaNkICJEACJEACJEACJEACJEACJNCWCSjRf6ruK5z8b51o6Q742VWdztnccxL5ynt/9Nh/YAgIsHSGHvtzHg82QAIkQAIkQAIkQAIkQAIkQAIk4GcElNhXznNzQwOu7vKzc/Lqt1jkf/OtGUeOHsNVnX6Kjh2v9LMhoLkkQAIkQAIkQAIkQAIkQAIkQAIk4FsCp059heMn/4uuV3fB5ZcZWtR4i0S+8uDX/u9RBP2sM67scEWLbsyLSIAESIAESIAESIAESIAESIAESIAEnAl8Vf81TP85gW6/uLpFHv0Wifwvao+g45Ud6MHnbCQBEiABEiABEiABEiABEiABEiABHxNQHv1TX9Xjmm5dz7rlsxb5Kk9A5Qv8vMtVZ30zXkACJEACJEACJEACJEACJEACJEACJNA8gX8fO26pe3e2xfjOSuSrMP2aL4/i2mt+ySJ7zY8JzyABEiABEiABEiABEiABEiABEiCBFhFQzvXPv/gSwb88u7D9sxL5/zYdl33vL0XnTh1b1EleRAIkQAIkQAIkQAIkQAIkQAIkQAIk4B2BEydP4bvvv8fPg7yPpPda5P/www+o/qwGv7o2mF5878aDZ5EACZAACZAACZAACZAACZAACZBAiwkob/6/Pq9ByHXBuOSSS7xqx2uR/9VXX6P+69NSyj/Iq4Z5EgmQAAmQAAmQAAmQAAmQAAmQAAmQwLkROHLUhA5XtMeVV3q3s53XIl+F6l8WEMCK+uc2PryaBEiABEiABEiABEiABEiABEiABLwmoCrtf9vQ4HXIvtciX22b1yWoMy4zGLzuDE8kARIgARIgARIgARIgARIgARIgARJoOYFvzWYcM53wejs9r0W+ygPoHsyq+i0fGl5JAiRAAiRAAiRAAiRAAiRAAiRAAmdHQOXlH6750lIfz5vDa5F/qPoweoR096ZNnkMCJEACJEACJEACJEACJEACJEACJOAjAmejxynyfQSdzZAACZAACZAACZAACZAACZAACZBAaxCgyG8NqmyTBEiABEiABEiABEiABEiABEiABH4EAhT5PwJ03pIESIAESIAESIAESIAESIAESIAEW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moGtcCT77cu2ZHOqbOXoeyk8qqQKdwffU3NTtSMX5mPirU1oLtwzB83nJkDrZ1VCtapz1TnSKQOHcR0gfqdgnQxLvy8j9gQqYS1yfd7Gqg9+R/vAbjx2Wh6KhllBCuD9d3YYdOTYTrW8bchJIVKRifVWpn/cyiNPuYu4p8rXr/rJC1rK7v3+9KWk8CJEACJEACJEACJEACFwWBi1/k+wKzeJ3N3xtgaJxq74vWL842TquFEc9AzPK7oYnfW8Vos4zTpTJOLgss2r3MsvBgsGyPyIMESIAESIAESIAESIAESIAE/JMARb5/jjutJgESIAESIAESIAESIAESIAESaIMEKPLb4KDSJBIgARIgARIgARIgARIgARIgAf8kQJHvn+NOq0mABEiABEiABEiABEiABEiABNogAYr8NjioNIkESIAESIAESIAESIAESIAESMA/CVDk++e402oSIAESIAESIAESIAESIAESIIE2SIAivw0OKk0iARIgARIgARIgARIgARIgARLwTwIU+f457rSaBEiABEiABEiABEiABEiABEigDRKgyG+Dg0qTSIAESIAESIAESIAESIAESIAE/JMARb5/jjutJgESIAESIAESIAESIAESIAESaIMEKPLb4KDSJBIgARIgARIgARIgARIgARIgAf8kQJHvn+NOq0mABEiABEiABEiABEiABEiABNogAYr8NjioNIkESIAESIAESIAESIAESIAESMA/CVDk++e402oSIAESIAESIAESIAESIAESIIE2SIAivw0OKk0iARIgARIgARIgARIgARIgARLwTwIU+f457rSaBEiABEiABEiABEiABEiABEigDRKgyG+Dg0qTSIAESIAESIAESIAESIAESIAE/JMARb5/jjutJgESIAESIAESIAESIAESIAESaIMEKPLb4KDSJBIgARIgARIgARIgARIgARIgAf8kQJHvn+NOq0mABEiABEiABEiABEiABEiABNogAYr8NjioNIkESIAESIAESIAESIAESIAESMA/CVDk++e402oSIAESIAESIAESIAESIAESIIE2SIAivw0OKk0iARIgARIgARIgARIgARIgARLwTwIU+f457rSaBEiABEiABEiABEiABEiABEigDRLwe5Fvrj+Cqo/eR8m/D+LDY4dR9/0RlHxXbxnq4J/0QPClVyK0Szh6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