Kaggle competition: Corporación Favorita Grocery Sales Forecasting
model2.fit(X_train2, y_train2 )<compute_test_metric>
lrSubmitY= pd.read_csv('.. /input/aggr-dataset/lrSubmitY.csv',index_col=False)
 lrSubmitY.drop(['Unnamed: 0'], inplace=True,axis=1 )
model2.score(X_test2,y_test2 )<predict_on_test>
lgbSubmitY= pd.read_csv('.. /input/dataset2/lgbSubmitY.csv',index_col=False)
 lgbSubmitY.drop(['Unnamed: 0'], inplace=True,axis=1 )
anzzzz=model2.predict(x_predfinal )<feature_engineering>
xgbSubmitY= pd.read_csv('.. /input/aggr-dataset/xgbSubmitY.csv',index_col=False)
 xgbSubmitY.drop(['Unnamed: 0'], inplace=True,axis=1 )
a2=np.around(anzzzz )<data_type_conversions>
combinedPredY =(xgbSubmitY*0.45)+(lgbSubmitY*0.45)+(lrSubmitY*0.10 )
a2=a2.astype(int )<prepare_output>
df_train = pd.read_csv(
 '.. /input/favorita-grocery-sales-forecasting/train.csv', usecols=[1, 2, 3, 4, 5],
dtype={'onpromotion': bool},
converters={'unit_sales': lambda u: np.log1p(
 float(u)) if float(u)> 0 else 0},
parse_dates=["date"],
skiprows=range(1, 66458909)
)
 df_2017 = df_train.loc[df_train.date>=pd.datetime(2017,1,1)]
del df_train
df_2017 = df_2017.set_index(
 ["store_nbr", "item_nbr", "date"])[["unit_sales"]].unstack(
 level=-1 ).fillna(0)
 df_2017.columns = df_2017.columns.get_level_values(1 )
predictions = pd.DataFrame({'ForecastId':x_test['ForecastId'],'ConfirmedCases':a1,'Fatalities':a2})
 predictions.head()<import_modules>
print("Making submission...")
 df_preds = pd.DataFrame(
 combinedPredY.values, index=df_2017.index,
columns=pd.date_range("2017-08-16", periods=16)
 ).stack().to_frame("unit_sales")
 df_preds.index.set_names(["store_nbr", "item_nbr", "date"], inplace=True )
from sklearn.ensemble import AdaBoostRegressor<define_search_model>
gc.collect()
model3 = AdaBoostRegressor()
model4 = AdaBoostRegressor()<train_model>
df_test = pd.read_csv(
 ".. /input/favorita-grocery-sales-forecasting/test.csv", usecols=[0, 1, 2, 3, 4],
dtype={'onpromotion': bool},
parse_dates=["date"]
).set_index(
 ['store_nbr', 'item_nbr', 'date']
)
model3.fit(X_train1, y_train1 )<train_model>
submission = df_test[["id"]].join(df_preds, how="left" ).fillna(0)
 submission["unit_sales"] = np.clip(np.expm1(submission["unit_sales"]), 0, 1000)
 submission.to_csv('aggr.csv', float_format='%.4f', index=None )