<jupyter_start><jupyter_text>Store Item Demand Forecasting ChallengeThe objective of this competition is to predict 3 months of item-level sales data at different store locations.  This competition is provided as a way to explore different time series techniques on a relatively simple and clean dataset.  You are given 5 years of store-item sales data, and asked to predict 3 months of sales for 50 different items at 10 different stores.  What's the best way to deal with seasonality? Should stores be modeled separately, or can you pool them together? Does deep learning work better than ARIMA? Can either beat xgboost?See [Kaggle page](https://www.kaggle.com/c/demand-forecasting-kernels-only)<jupyter_code>import math
import pandas as pd
import numpy as np
import os

# Do not use normal form (scietific notation) when printing numbers, exponents can make it harder to compare values
pd.set_option('float_format', '{:f}'.format)

import seaborn as sns
#%pylab inline
# pylab.rcParams['figure.figsize'] = (15, 6)

import sklearn
from sklearn.linear_model import LinearRegression
from sklearn.metrics import accuracy_score, mean_squared_error
from sklearn.model_selection import GridSearchCV
'numpy: {}, pandas: {}, sklearn: {}'.format(np.__version__, pd.__version__, sklearn.__version__)<jupyter_output><empty_output><jupyter_text>Download<jupyter_code>competition_name = "demand-forecasting-kernels-only"
data_path = "..\datasets\kaggle\demand-forecasting"
if not os.path.isdir(data_path):
    print("creating directory '{}'".format(data_path))
    os.makedirs(data_path)
!kaggle competitions download -c $competition_name -p $data_path
import tarfile

def extract_zip(filename):
    print("unzipping {} to {}".format(filename, data_path))
    !python -m zipfile -e $filename $data_path<jupyter_output><empty_output><jupyter_text>Unzip all zip files<jupyter_code>import glob

for zip_file in glob.glob(os.path.join(data_path, "*.zip")):
    extract_zip(zip_file)
!DEL /Q "$data_path\*.zip"<jupyter_output><empty_output><jupyter_text>Import<jupyter_code>def read_data(filename):
    return pd.read_csv(os.path.join(data_path, filename))
train_data = read_data("train.csv")
test_data = read_data("test.csv")
X_train = train_data.drop(["sales"], axis=1)
y_train = train_data["sales"].copy()
X_test = test_data.copy()<jupyter_output><empty_output><jupyter_text>Explore<jupyter_code>X_train.head()
X_train.info()
X_train.describe()
X_train.shape<jupyter_output><empty_output><jupyter_text>Train  Evaluate  Submit<jupyter_code>submission = pd.DataFrame({
  "PassengerId": X_test.index,
  "Survived": y_hat_gb
})
submission.to_csv("../datasets/kaggle/titanic/submission.csv", index=False)
!kaggle competitions submit -c $competition_name -f $data_path/submission.csv -m "Use gradient tree boosting"`<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10824195259992925, 'fraction_numerical': 0.0038910505836575876, 'mean_word_length': 6.581769436997319, 'pattern_counts': {'":': 2, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '378657', 'license': 'MIT', 'n_tokens_mistral': 956, 'n_tokens_neox': 918, 'n_words': 243, 'path': 'kaggle/store-demand.ipynb', 'repo_name': 'stuarthallows/machine-learning', 'size': '2827'}