Kaggle competition: M5 Forecasting - Accuracy
<SOS> metric: M5_WRMSSE Kaggle data source: m5-forecasting-accuracy<set_options>
import numpy as np
import pandas as pd
pd.set_option('display.max_columns', None)
 train_df.head(10 )<save_to_csv>
data1 = pd.read_csv('.. /input/m5-more-data-table-and-xgb/submission_lgbm.csv')
 data2 = pd.read_csv('.. /input/m5-dark-magic/submission.csv' )
train_df.to_csv('new_train.csv', index=False)
 test_df.to_csv('new_test.csv', index=False)
 print("New files have been created." )<load_from_csv>
for i in range(1,29):
data1['F'+str(i)] *= 1.04
X = pd.read_csv("/kaggle/working/new_train.csv")
 y = pd.read_csv("/kaggle/working/new_test.csv")
 all_data = [X,y]
pd.set_option('display.max_columns', None)
 X.head(20 )<categorify>
categories = []
for i in range(1, 29):
categories.append(f'F{i}' )
B = pd.concat([X,y])
 B = pd.concat([B, pd.get_dummies(B['Neighborhood'], prefix='Neighborhood', drop_first=True)], axis=1)
 B = pd.concat([B, pd.get_dummies(B['LotConfig'], prefix='LotConfig', drop_first=True)], axis=1)
 B = pd.concat([B, pd.get_dummies(B['BldgType'], prefix='BldgType', drop_first=True)], axis=1)
 B = pd.concat([B, pd.get_dummies(B['HouseStyle'], prefix='HouseStyle', drop_first=True)], axis=1)
 B = pd.concat([B, pd.get_dummies(B['SaleCondition'], prefix='SaleCondition', drop_first=True)], axis=1)
 B = pd.concat([B, pd.get_dummies(B['GarageFinish'], prefix='GarageFinish', drop_first=True)], axis=1)
 B = pd.concat([B, pd.get_dummies(B['GarageType'], prefix='GarageType', drop_first=True)], axis=1)
 B = pd.concat([B, pd.get_dummies(B['Foundation'], prefix='Foundation', drop_first=True)], axis=1)
 B.drop(['LotConfig', 'BldgType', 'HouseStyle', 'SaleCondition', 'GarageFinish', 'GarageType', 'Foundation'], axis=1, inplace=True)
 B.drop(['MasVnrType', 'Exterior2nd', 'Exterior1st', 'MSZoning', 'MSSubClass'], axis=1, inplace=True)
 B.head(20 )<prepare_x_and_y>
sub_col = data1['id']
X = B[:len(X)]
y = B[len(X):]
y = y.drop('SalePrice', axis=1)
 len(X )<save_to_csv>
all_cols = pd.DataFrame({})
 all_cols['id'] = sub_col
all_cols[categories] = 0.60*data1[categories] + 0.40*data2[categories]
<load_from_csv><EOS> 
all_cols.to_csv('sub.csv', index=False )