{"cells":[{"metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true,"_kg_hide-output":false},"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load in \n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the \"../input/\" directory.\n# For example, running this (by clicking run or pressing Shift+Enter) will list the files in the input directory\n\nimport os\nprint(os.listdir(\"../input\"))\n\n# Any results you write to the current directory are saved as output.","execution_count":null,"outputs":[]},{"metadata":{"_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0","_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a","trusted":true},"cell_type":"code","source":"%load_ext autoreload\n%autoreload 2\n\n%matplotlib inline","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"594391070e4066089694f931ff6b8cacf14810f3"},"cell_type":"code","source":"from fastai.imports import *\n# from fastai.structured import *\n\nfrom sklearn.ensemble import RandomForestRegressor\nfrom sklearn import metrics\n\nfrom IPython.display import display\n","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"342efed830e4ce6c844e8889cdb1b96580689764"},"cell_type":"code","source":"! which fastai\n","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"3a6a73a2882f9ca881d8055f04114c2e5687df88"},"cell_type":"code","source":"PATH_GROCERY = \"../input/favorita-grocery-sales-forecasting/\"","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"be2590a4a36c08faabe0f55c28061092e2077180"},"cell_type":"code","source":"!ls {PATH_GROCERY}","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"3c7c06805207d7c77ab2f7ded1c7f3b501f27eb9"},"cell_type":"code","source":"types = {'id':'int64', 'date':'int32', 'store_nbr':'int8', 'unit_sales':'float64', 'onpromotion':'object'}","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"ce56513562bc584920e2a775642de83befbac53f"},"cell_type":"code","source":"%%time\ndf_grocery_all = pd.read_csv(f'{PATH_GROCERY}train.csv', dtype=types, parse_dates=['date'], infer_datetime_format=True)\ndf_grocery_all.head()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"bb3bf057604e7183de2f81fa3deda5e1b9074ae6"},"cell_type":"code","source":"df_grocery_all.shape","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"ef1db213c18b159e6156e49a643745e57274cd2b"},"cell_type":"code","source":"df_grocery_all.onpromotion.fillna(value=False, inplace=True)\ndf_grocery_all.onpromotion = df_grocery_all.onpromotion.map({'False':False, 'True':True})\ndf_grocery_all.onpromotion = df_grocery_all.onpromotion.astype(bool)\n\n%time df_grocery_all.to_feather('data/favorita-grocery-sales-forecasting/raw_groceries')","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"2745f3fde36b80dd4b46c55d3f20e444ac680f6c"},"cell_type":"code","source":"%time df_grocery_all.describe","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"047cf1d823d9f6c95fcb7993af52c5b77db6b765"},"cell_type":"code","source":"","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"e34fcb434ffda226a9048018676224247a565f2a"},"cell_type":"code","source":"","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"4d78ef20a746ef17befaffcaaed3d4872dae426e"},"cell_type":"code","source":"","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"53e53aa7e8d2d505be98d49b204227e869e68d84"},"cell_type":"code","source":"","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"6e17fc8c00bf290c4197791d3614b9f5de2a3ce3"},"cell_type":"code","source":"","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"61a9532d70ab6da4750d6fdb70814c5f1dc09a09"},"cell_type":"code","source":"","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"70a038cc74ee24965cbf724c03ca6d423a23c30e"},"cell_type":"code","source":"","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"c47d1f93fec296e9a73f43b2a505324f021e79d4"},"cell_type":"code","source":"","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"dfdf52cd30a0af1b8792aa5efdca5cf5c96f6f34"},"cell_type":"code","source":"","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"f6ee1ed2611552fbbdc909e06302a1cecd372dbd"},"cell_type":"code","source":"","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"0c0ee302cc854defbb178b66edca09631a56a857"},"cell_type":"code","source":"","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"f0be187ea3905c4d967885ee276cd057d88057f8"},"cell_type":"code","source":"","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"359693074ef8ddee1c122eaa25d154a0be5e875e"},"cell_type":"code","source":"","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"1f4ea0519bbfabd59c5415ca52bb160e1ce15fe2"},"cell_type":"code","source":"","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"2b42206a3c2f5223ac6236cb5e92d13165c3532e"},"cell_type":"code","source":"","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"ab42ccda68863a583a43f6aaa556492aeb1c49ef"},"cell_type":"code","source":"","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"d2fe52028111de8cd4208a2038eaa78c6dc7928f"},"cell_type":"code","source":"","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"fba321b42495935872b5b87e58644bab5b6121ca"},"cell_type":"code","source":"","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"0d982d5424f85b323c746004f2e68ef8a7ed5f71"},"cell_type":"code","source":"","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"68dc9eddd9cb1d0ed699b0b02eac6775024db43c"},"cell_type":"code","source":"","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"f6e616ecceaf956bfded7abf7a00081229719323"},"cell_type":"code","source":"","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"2c55fd817bc58bc0ed15ed4bf4984b9315ea20ef"},"cell_type":"code","source":"","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"1b232624976eb74a324467fc975934dee8eccca0"},"cell_type":"code","source":"","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"7ed306c84e50dec7cee54f2b46223e7f82a41e70"},"cell_type":"code","source":"","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"cc63ad0c5d83c5eb5d03de62838fd0effcc222cb"},"cell_type":"code","source":"","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"7d506fef7fc91887b7692a3edc96e994853bc849"},"cell_type":"code","source":"","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"25ae729c0ca04deaef98382965636a6157745906"},"cell_type":"code","source":"","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"7b819d523207c2aaee99fe6e0e7168876be54e75"},"cell_type":"code","source":"","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"ae47268bbe64907ae05a585084b76ab8417072d8"},"cell_type":"code","source":"","execution_count":null,"outputs":[]}],"metadata":{"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"name":"python","version":"3.6.6","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat":4,"nbformat_minor":1}