{"cells":[{"metadata":{"trusted":true,"_uuid":"c3a55579df52164a75f162a91a8260b909d802f4"},"cell_type":"code","source":"!pip install git+https://github.com/fastai/fastai@2e1ccb58121dc648751e2109fc0fbf6925aa8887\n\n!apt update &amp;&amp; apt install -y libsm6 libxext6","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"4f95d33a8f308b8cb749a93596888fc5070508f2"},"cell_type":"code","source":"%load_ext autoreload\n%autoreload 2\n\n%matplotlib inline","execution_count":null,"outputs":[]},{"metadata":{"_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0","_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a","trusted":true},"cell_type":"code","source":"from sklearn.ensemble import RandomForestRegressor, RandomForestClassifier\nfrom sklearn import metrics\nfrom IPython.display import display","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"354d1436b9e4542afd351294332e7ce27674764b"},"cell_type":"code","source":"from fastai.imports import *\nfrom fastai.structured import *","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"8c1414bc7a357d5332f6bf2105655056eed4f5d6","_kg_hide-input":true,"_kg_hide-output":true},"cell_type":"code","source":"types = {'id': 'int64',\n         'item_nbr': 'int32',\n         'store_nbr': 'int8',\n         'unit_sales': 'float32',\n         'onpromotion': 'object'}\n\n%time\n# dtype=types: Provide data type of each column to reduce memory usage\ndf_all = pd.read_csv(\"../input/train.csv\", parse_dates=['date'], dtype=types, infer_datetime_format=True)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"cc2bae70e120c586b5739e598d19ccd128e9cccd"},"cell_type":"code","source":"# Fill NaN values in 'onpromotion' column\n# Kaggle: \"Approximately 16% of the onpromotion values in this file are NaN.\"\ndf_all.onpromotion.fillna(False, inplace=True)\n# Map string values to boolean\ndf_all.onpromotion = df_all.onpromotion.map({'False': False, 'True': True})\ndf_all.onpromotion","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"049bb07d003ab2eb01e0b5acbee953dcd7b62169"},"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}