Kaggle competition: COVID19 Global Forecasting (Week 4)
<SOS> metric: MCRMSLE Kaggle data source: covid19-global-forecasting-(week-4)<drop_column>
for dirname, _, filenames in os.walk('/kaggle/input'):
for filename in filenames:
print(os.path.join(dirname, filename))
print('--------------------------------------')
 print('Train data looks like...')
 trainData = pd.read_csv(".. /input/covid19-global-forecasting-week-4/train.csv")
 print(trainData.head(5))
print('Test data looks like...')
 testData = pd.read_csv(".. /input/covid19-global-forecasting-week-4/test.csv")
 print(testData.head(5))
del bundle_agg
del part_agg
del tags1_agg
gc.collect()<train_model>
def createDataset2(resultInf, resultFat):
print('Are they of same shape? : ', np.shape(resultInf), np.shape(resultFat))
[rf, cf] = np.shape(resultInf)
 df=[]
count = 0
for i in tqdm(range(rf)) :
iCol = 5
while iCol < cf-1 :
day5_I = resultInf.iloc[i, iCol]
day4_I = resultInf.iloc[i, iCol-1]
day3_I = resultInf.iloc[i, iCol-2]
day2_I = resultInf.iloc[i, iCol-3]
day1_I = resultInf.iloc[i, iCol-4]
diff1_I = day5_I - day4_I
diff2_I = day4_I - day3_I
diff3_I = day3_I - day2_I
diff4_I = day2_I - day1_I
day5_F = resultFat.iloc[i, iCol]
day4_F = resultFat.iloc[i, iCol-1]
day3_F = resultFat.iloc[i, iCol-2]
day2_F = resultFat.iloc[i, iCol-3]
day1_F = resultFat.iloc[i, iCol-4]
diff1_F = day5_F - day4_F
diff2_F = day4_F - day3_F
diff3_F = day3_F - day2_F
diff4_F = day2_F - day1_F
horizon = int(iCol)
 time_horizon = 0
while horizon < cf - 1:
time_horizon = time_horizon + 1
horizon = horizon + 1
dayPredictInf = resultInf.iloc[i, horizon]
dayPredictFat = resultFat.iloc[i, horizon]
data = {'day1_I': [day1_I], 'day2_I': [day2_I], 'day3_I': [day3_I], 'day4_I': [day4_I], 'day5_I': [day5_I],
'diff1_I': [diff1_I], 'diff2_I': [diff2_I], 'diff3_I': [diff3_I], 'diff4_I': [diff4_I],
'day1_F': [day1_F], 'day2_F': [day2_F], 'day3_F': [day3_F], 'day4_F': [day4_F], 'day5_F': [day5_F],
'diff1_F': [diff1_F], 'diff2_F': [diff2_F], 'diff3_F': [diff3_F], 'diff4_F': [diff4_F],
'dayPredictFat': [dayPredictFat], 'dayPredictInf': [dayPredictInf], 'time_horizon': [time_horizon]}
df2 = pd.DataFrame(data)
 df.append(df2)
 iCol = iCol + 1
df = pd.concat(df ).reset_index(drop=True)
 df = df.fillna(0)
 df.to_csv('TrainTest.csv', index=False)
 displayAll = 0
if displayAll == 1 :
pd.set_option('display.max_columns', None)
 readDataPath1 = ".. /input/jhudataset/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv"
readDataPath2 = ".. /input/jhudataset/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_deaths_global.csv"
print('Are the of same shape? ', np.shape(pd.read_csv(readDataPath1)) , np.shape(pd.read_csv(readDataPath2)))
 worldCorona = pd.read_csv(readDataPath1)
 worldCorona = worldCorona.fillna(0)
 worldCorona['Country'] = worldCorona['Country/Region']
worldCorona = worldCorona.drop(['Province/State', 'Country/Region', 'Lat', 'Long'], axis=1)
 worldCorona = worldCorona.groupby(['Country'] ).sum()
worldCorona.to_csv('HellosInfected.csv')
 worldCorona = pd.read_csv('HellosInfected.csv' ).reset_index(drop=True)
 result = worldCorona.drop([0, 9, 154] ).reset_index(drop=True)
 result = result.drop(['Country'], axis=1)
 print('Size of country-wise data(infected): ', np.shape(result))
worldCoronaProvince = pd.read_csv(readDataPath1)
 worldCoronaProvince = worldCoronaProvince.dropna().reset_index(drop=True)
 worldCoronaProvince = worldCoronaProvince.drop(['Province/State', 'Country/Region', 'Lat', 'Long'], axis=1)
 print('Size of province-wise data(infected): ', np.shape(worldCoronaProvince))
resultConfirmed = result.append(worldCoronaProvince)
 dfVal = resultConfirmed.copy()
dfVal = dfVal.drop(dfVal.iloc[:, 1:48], axis=1)
 dfVal.to_csv('Validation_Infected.csv', index=False)
 worldCorona = pd.read_csv(readDataPath2)
 worldCorona = worldCorona.fillna(0)
 worldCorona['Country'] = worldCorona['Country/Region']
worldCorona = worldCorona.drop(['Province/State', 'Country/Region', 'Lat', 'Long'], axis=1)
 worldCorona = worldCorona.groupby(['Country'] ).sum()
worldCorona.to_csv('HellosFatality.csv')
 worldCorona = pd.read_csv('HellosFatality.csv' ).reset_index(drop=True)
 result = worldCorona.drop([0, 9, 154] ).reset_index(drop=True)
 result = result.drop(['Country'], axis=1)
 print('Size of country-wise data(fatality): ', np.shape(result))
worldCoronaProvince = pd.read_csv(readDataPath2)
 worldCoronaProvince = worldCoronaProvince.dropna().reset_index(drop=True)
 worldCoronaProvince = worldCoronaProvince.drop(['Province/State', 'Country/Region', 'Lat', 'Long'], axis=1)
 print('Size of province-wise data(fatality): ', np.shape(worldCoronaProvince))
resultFatality = result.append(worldCoronaProvince)
 dfVal = resultFatality.copy()
dfVal = dfVal.drop(dfVal.iloc[:, 1:48], axis=1)
 dfVal.to_csv('Validation_Fatality.csv', index=False)
 createDataset2(resultConfirmed, resultFatality )
train_df['user_correctness'].fillna(1, inplace=True)
 train_df['attempt_no'].fillna(1, inplace=True)
 train_df.fillna(0, inplace=True )<categorify>
df = pd.read_csv('TrainTest.csv')
 print('Size of training data: ', np.shape(df))
df = df.groupby(['day1_I', 'day2_I', 'day3_I', 'day4_I', 'day5_I',
'diff1_I', 'diff2_I', 'diff3_I', 'diff4_I',
'day1_F', 'day2_F', 'day3_F', 'day4_F', 'day5_F',
'diff1_F', 'diff2_F', 'diff3_F', 'diff4_F', 'time_horizon'] ).mean()
df.to_csv('temp2.csv')
 df = pd.read_csv('temp2.csv' ).reset_index(drop=True)
 print('Size of training data after grouping: ', np.shape(df))
dfExtra = df[df['day1_I'] > 80000].reset_index(drop=True ).copy()
dfExtra = dfExtra.groupby(['day1_I', 'day2_I', 'day3_I', 'day4_I', 'day5_I',
'diff1_I', 'diff2_I', 'diff3_I', 'diff4_I',
'day1_F', 'day2_F', 'day3_F', 'day4_F', 'day5_F',
'diff1_F', 'diff2_F', 'diff3_F', 'diff4_F'] ).max()
dfExtra.to_csv('temp4.csv')
 dfExtra = pd.read_csv('temp4.csv' ).reset_index(drop=True)
 dfExtra = dfExtra[dfExtra['time_horizon'] == 1].reset_index(drop=True)
 print('Extra data shape', np.shape(dfExtra))
[rExtra, cExtra] = np.shape(dfExtra)
 dfNew=[]
for iNew in range(rExtra):
time_horizon = 1
day5_I = dfExtra.loc[iNew, 'day5_I']
day4_I = dfExtra.loc[iNew, 'day4_I']
day3_I = dfExtra.loc[iNew, 'day3_I']
day2_I = dfExtra.loc[iNew, 'day2_I']
day1_I = dfExtra.loc[iNew, 'day1_I']
diff1_I = dfExtra.loc[iNew, 'diff1_I']
diff2_I = dfExtra.loc[iNew, 'diff2_I']
diff3_I = dfExtra.loc[iNew, 'diff3_I']
diff4_I = dfExtra.loc[iNew, 'diff4_I']
day5_F = dfExtra.loc[iNew, 'day5_F']
day4_F = dfExtra.loc[iNew, 'day4_F']
day3_F = dfExtra.loc[iNew, 'day3_F']
day2_F = dfExtra.loc[iNew, 'day2_F']
day1_F = dfExtra.loc[iNew, 'day1_F']
diff1_F = dfExtra.loc[iNew, 'diff1_F']
diff2_F = dfExtra.loc[iNew, 'diff1_F']
diff3_F = dfExtra.loc[iNew, 'diff1_F']
diff4_F = dfExtra.loc[iNew, 'diff1_F']
stepI = diff4_I
stepF = diff4_F
while time_horizon < 35 :
time_horizon = time_horizon + 1
stepC = int(time_horizon - 1)
 stepI = float(stepI * 0.98)
 stepF = float(stepF * 0.96)
 deltaI = stepC * stepI
deltaF = stepC * stepF
dayPredictFat = dfExtra.loc[iNew, 'dayPredictFat'] + deltaF
dayPredictInf = dfExtra.loc[iNew, 'dayPredictInf'] + deltaI
data = {'day1_I': [day1_I], 'day2_I': [day2_I], 'day3_I': [day3_I], 'day4_I': [day4_I], 'day5_I': [day5_I],
'diff1_I': [diff1_I], 'diff2_I': [diff2_I], 'diff3_I': [diff3_I], 'diff4_I': [diff4_I],
'day1_F': [day1_F], 'day2_F': [day2_F], 'day3_F': [day3_F], 'day4_F': [day4_F], 'day5_F': [day5_F],
'diff1_F': [diff1_F], 'diff2_F': [diff2_F], 'diff3_F': [diff3_F], 'diff4_F': [diff4_F],
'dayPredictFat': [dayPredictFat], 'dayPredictInf': [dayPredictInf], 'time_horizon': [time_horizon]}
dfNewAdd = pd.DataFrame(data)
 dfNew.append(dfNewAdd)
 dfNew = pd.concat(dfNew ).reset_index(drop=True)
 print('Size of extra data: ', np.shape(dfNew))
df = df.append(dfNew ).reset_index(drop=True)
 print('Size of training data after extra operation: ', np.shape(df))
tuneTrue = 0
if tuneTrue == 1:
testSize = 0.8
randomState = None
X_train1, X_test2= train_test_split(df, test_size=testSize, random_state=randomState)
 X_train1.to_csv('temp3.csv')
 df = pd.read_csv('temp3.csv' ).reset_index(drop=True)
 df = df.drop(['Unnamed: 0'], axis=1)
 print('Size of training data after sorting: ', np.shape(df))
print('Is NaN? : ', df.isnull().values.any() )
<define_variables><EOS> 
def kaggle(dfTrain, dfTest):
pd.set_option('display.max_columns', None)
 dfTest['DateNew'] = pd.to_datetime(dfTest['Date'])
 dfTest = dfTest.drop(['Date'], axis=1)
 dfTest = dfTest.rename(columns={"DateNew": "Date"})
 dfTest['Year'] = dfTest['Date'].dt.year
dfTest['Month'] = dfTest['Date'].dt.month
dfTest['Day'] = dfTest['Date'].dt.day
dfTest = dfTest.drop(['Date'], axis=1)
 dfTest = dfTest.fillna('DummyProvince')
 dfTrain['DateNew'] = pd.to_datetime(dfTrain['Date'])
 dfTrain = dfTrain.drop(['Date'], axis=1)
 dfTrain = dfTrain.rename(columns={"DateNew": "Date"})
 dfTrain['Year'] = dfTrain['Date'].dt.year
dfTrain['Month'] = dfTrain['Date'].dt.month
dfTrain['Day'] = dfTrain['Date'].dt.day
dfTrain = dfTrain.drop(['Date'], axis=1)
 dfTrain = dfTrain.fillna('DummyProvince')
 result = pd.merge(dfTest, dfTrain, how='left', on=['Country_Region', 'Province_State', 'Year', 'Month', 'Day'])
 result = result.fillna(-1)
 print('Are the Kaggle submission files same? ', np.shape(dfTrain), np.shape(dfTest), np.shape(result))
result.to_csv('temp.csv')
 return result
def ErrorCalc(mdl, ref, tag):
relError = np.abs(mdl - ref)/ np.abs(ref+1)
 MeanErrorV = np.mean(relError)
 print(tag + ': Mean Rel Error in %: ', MeanErrorV * 100)
 return MeanErrorV
def TrainMdl(trainIpData, trainOpData, tuneTrue):
if tuneTrue == 1:
testSize = 0.5
print('Training starts...')
 randomState = 42
if tuneTrue == 1:
X_train, X_test, y_train, y_test = train_test_split(trainIpData, trainOpData, test_size=testSize, random_state=randomState)
 print('Train size: ', np.shape(X_train))
print('Test size: ', np.shape(X_test))
else:
X_train = trainIpData
y_train =trainOpData
print('Train size: ', np.shape(X_train))
TrainIP1 = X_train[['day1_I', 'day2_I', 'day3_I', 'day4_I', 'day5_I',
'diff1_I', 'diff2_I', 'diff3_I', 'diff4_I', 'time_horizon']]
TrainOP1 = X_train['dayPredictInf']
if tuneTrue == 1:
TestIP1 = X_test[['day1_I', 'day2_I', 'day3_I', 'day4_I', 'day5_I',
'diff1_I', 'diff2_I', 'diff3_I', 'diff4_I', 'time_horizon']]
if tuneTrue == 1:
treeDepth = 30
param_grid = {
'n_estimators': [100, 250, 500],
'learning_rate': [0.2, 0.1, 0.01]
}
regrMdl1 = xgb.XGBRegressor(max_depth = treeDepth)
 clf1 = RandomizedSearchCV(estimator = regrMdl1, param_distributions = param_grid,
n_iter = 100, cv = 3, verbose=7, random_state=42, n_jobs = -1)
 clf1.fit(TrainIP1, TrainOP1)
 print(clf1.best_estimator_)
 y_predictedTrain = clf1.predict(TrainIP1)
 ErrorCalc(y_predictedTrain, X_train['dayPredictInf'].to_numpy() , 'Train Data-set model-1(infection rate)')
 y_predictedTest = clf1.predict(TestIP1)
 ErrorCalc(y_predictedTest, X_test['dayPredictInf'].to_numpy() , 'Test Data-set model-1(infection rate)')
 else:
print('Directly predicting...')
 clf1 = xgb.XGBRegressor(max_depth=30, n_estimators = 500, learning_rate = 0.01)
 clf1.fit(TrainIP1, TrainOP1)
 y_predictedTrain = clf1.predict(TrainIP1)
 ErrorCalc(y_predictedTrain, X_train['dayPredictInf'].to_numpy() , 'Train Data-set model-1(infection rate)')
 TrainIP2 = X_train[['day1_I', 'day2_I', 'day3_I', 'day4_I', 'day5_I',
'diff1_I', 'diff2_I', 'diff3_I', 'diff4_I',
'day1_F', 'day2_F', 'day3_F', 'day4_F', 'day5_F',
'diff1_F', 'diff2_F', 'diff3_F', 'diff4_F', 'time_horizon']]
TrainOP2 = y_train
if tuneTrue == 1:
TestIP2 = X_test[['day1_I', 'day2_I', 'day3_I', 'day4_I', 'day5_I',
'diff1_I', 'diff2_I', 'diff3_I', 'diff4_I',
'day1_F', 'day2_F', 'day3_F', 'day4_F', 'day5_F',
'diff1_F', 'diff2_F', 'diff3_F', 'diff4_F', 'time_horizon']]
if tuneTrue == 1:
treeDepth = 30
param_grid = {
'n_estimators': [100, 250, 500],
'learning_rate': [0.2, 0.1, 0.01]
}
regrMdl2 = xgb.XGBRegressor(max_depth = treeDepth)
 clf2 = RandomizedSearchCV(estimator=regrMdl2, param_distributions=param_grid,
n_iter=100, cv=3, verbose=7, random_state=42, n_jobs=-1)
 clf2.fit(TrainIP2, TrainOP2)
 print(clf2.best_estimator_)
 y_predictedTrain = clf2.predict(TrainIP2)
 ErrorCalc(y_predictedTrain, y_train.to_numpy() , 'Train Data-set model-2')
 y_predictedTest = clf2.predict(TestIP2)
 ErrorCalc(y_predictedTest, y_test.to_numpy() , 'Test Data-set model-2')
 else:
print('Directly predicting...')
 clf2 = xgb.XGBRegressor(max_depth=30, n_estimators = 500, learning_rate = 0.01)
 clf2.fit(TrainIP2, TrainOP2)
 y_predictedTrain = clf2.predict(TrainIP2)
 ErrorCalc(y_predictedTrain, y_train.to_numpy() , 'Train Data-set model-2')
 dfValidation_Inf = pd.read_csv('Validation_Infected.csv' ).reset_index(drop=True)
 dfValidation_Fat = pd.read_csv('Validation_Fatality.csv' ).reset_index(drop=True)
 selRow = 0
startIdx = 20
[rVal, cVal] = np.shape(dfValidation_Inf)
 lengthZ = cVal-1
lengthZ = 12 * lengthZ
arrP = np.zeros(( 2 * lengthZ,))
arrA = np.zeros(( 2 * lengthZ,))
count = 0
error = 0
errorLen = 0
print('Validating...')
 for selRow in range(rVal):
iDetect = startIdx
iArray = 0
time_horizon = 0
while(iDetect < cVal-1):
if iDetect == startIdx :
day5_I = dfValidation_Inf.iloc[selRow, iDetect]
day4_I = dfValidation_Inf.iloc[selRow, iDetect - 1]
day3_I = dfValidation_Inf.iloc[selRow, iDetect - 2]
day2_I = dfValidation_Inf.iloc[selRow, iDetect - 3]
day1_I = dfValidation_Inf.iloc[selRow, iDetect - 4]
day5_F = dfValidation_Fat.iloc[selRow, iDetect]
day4_F = dfValidation_Fat.iloc[selRow, iDetect - 1]
day3_F = dfValidation_Fat.iloc[selRow, iDetect - 2]
day2_F = dfValidation_Fat.iloc[selRow, iDetect - 3]
day1_F = dfValidation_Fat.iloc[selRow, iDetect - 4]
diff1_I = day5_I - day4_I
diff2_I = day4_I - day3_I
diff3_I = day3_I - day2_I
diff4_I = day2_I - day1_I
diff1_F = day5_F - day4_F
diff2_F = day4_F - day3_F
diff3_F = day3_F - day2_F
diff4_F = day2_F - day1_F
time_horizon = time_horizon + 1
data1 = {'day1_I': [day1_I], 'day2_I': [day2_I], 'day3_I': [day3_I], 'day4_I': [day4_I], 'day5_I': [day5_I],
'diff1_I': [diff1_I], 'diff2_I': [diff2_I], 'diff3_I': [diff3_I], 'diff4_I': [diff4_I], 'time_horizon': [time_horizon]}
dfPredict1 = pd.DataFrame(data1)
 predictedInfected = clf1.predict(dfPredict1)
 if predictedInfected < day5_I:
predictedInfected = day5_I
actVal = dfValidation_Inf.iloc[selRow, iDetect + 1]
arrP[iArray] = predictedInfected
arrA[iArray] = actVal
iArray = iArray + 1
data2 = {'day1_I': [day1_I], 'day2_I': [day2_I], 'day3_I': [day3_I], 'day4_I': [day4_I], 'day5_I': [day5_I],
'diff1_I': [diff1_I], 'diff2_I': [diff2_I], 'diff3_I': [diff3_I], 'diff4_I': [diff4_I],
'day1_F': [day1_F], 'day2_F': [day2_F], 'day3_F': [day3_F], 'day4_F': [day4_F], 'day5_F': [day5_F],
'diff1_F': [diff1_F], 'diff2_F': [diff2_F], 'diff3_F': [diff3_F], 'diff4_F': [diff4_F], 'time_horizon': [time_horizon]}
dfPredict2 = pd.DataFrame(data2)
 predictedFatality = clf2.predict(dfPredict2)
 if predictedFatality < day5_F:
predictedFatality = day5_F
actVal = dfValidation_Fat.iloc[selRow, iDetect + 1]
arrP[iArray] = predictedFatality
arrA[iArray] = actVal
iArray = iArray + 1
iDetect = iDetect + 1
error = error + sum(np.square(np.log(arrP[0:iArray-1] + 1)- np.log(arrA[0:iArray-1] + 1)))
 errorLen = errorLen + iArray
count = count + 1
error = float(error)/ errorLen
print('Validation error: ', error)
 print('Making Kaggle Submission file...')
 dfTrain = pd.read_csv(".. /input/covid19-global-forecasting-week-4/train.csv")
 dfTest = pd.read_csv(".. /input/covid19-global-forecasting-week-4/test.csv")
 df2 = kaggle(dfTrain, dfTest)
 print('Prediction starts for Kaggle submission...')
 [rr, cc] = np.shape(df2)
 time_horizon = 0
for iP in range(rr):
if df2.loc[iP, 'ConfirmedCases'] == -1 :
time_horizon = time_horizon + 1
data1 = {'day1_I': [day1_I], 'day2_I': [day2_I], 'day3_I': [day3_I], 'day4_I': [day4_I], 'day5_I': [day5_I],
'diff1_I': [diff1_I], 'diff2_I': [diff2_I], 'diff3_I': [diff3_I], 'diff4_I': [diff4_I], 'time_horizon': [time_horizon]}
dfPredict1 = pd.DataFrame(data1)
 predictedInfected = clf1.predict(dfPredict1)
 if predictedInfected < df2.loc[iP-1, 'ConfirmedCases']:
predictedInfected = df2.loc[iP-1, 'ConfirmedCases']
df2.loc[iP, 'ConfirmedCases'] = np.round(predictedInfected)
 data2 = {'day1_I': [day1_I], 'day2_I': [day2_I], 'day3_I': [day3_I], 'day4_I': [day4_I], 'day5_I': [day5_I],
'diff1_I': [diff1_I], 'diff2_I': [diff2_I], 'diff3_I': [diff3_I], 'diff4_I': [diff4_I],
'day1_F': [day1_F], 'day2_F': [day2_F], 'day3_F': [day3_F], 'day4_F': [day4_F], 'day5_F': [day5_F],
'diff1_F': [diff1_F], 'diff2_F': [diff2_F], 'diff3_F': [diff3_F], 'diff4_F': [diff4_F], 'time_horizon': [time_horizon]}
dfPredict2 = pd.DataFrame(data2)
 predictedFatality = clf2.predict(dfPredict2)
 if predictedFatality < df2.loc[iP-1, 'Fatalities']:
predictedFatality = df2.loc[iP-1, 'Fatalities']
df2.loc[iP, 'Fatalities'] = np.round(predictedFatality)
 else:
if iP > 7 :
day5_I = df2.loc[iP-1, 'ConfirmedCases']
day4_I = df2.loc[iP-2, 'ConfirmedCases']
day3_I = df2.loc[iP-3, 'ConfirmedCases']
day2_I = df2.loc[iP-4, 'ConfirmedCases']
day1_I = df2.loc[iP-5, 'ConfirmedCases']
day5_F = df2.loc[iP - 1, 'Fatalities']
day4_F = df2.loc[iP - 2, 'Fatalities']
day3_F = df2.loc[iP - 3, 'Fatalities']
day2_F = df2.loc[iP - 4, 'Fatalities']
day1_F = df2.loc[iP - 5, 'Fatalities']
diff1_I = day5_I - day4_I
diff2_I = day4_I - day3_I
diff3_I = day3_I - day2_I
diff4_I = day2_I - day1_I
diff1_F = day5_F - day4_F
diff2_F = day4_F - day3_F
diff3_F = day3_F - day2_F
diff4_F = day2_F - day1_F
time_horizon = 0
return df2
print('Size of training data: ', np.shape(df))
trainIpData = df[['day1_I', 'day2_I', 'day3_I', 'day4_I', 'day5_I',
'diff1_I', 'diff2_I', 'diff3_I', 'diff4_I',
'day1_F', 'day2_F', 'day3_F', 'day4_F', 'day5_F',
'diff1_F', 'diff2_F', 'diff3_F', 'diff4_F', 'time_horizon', 'dayPredictInf']]
trainOpData = df['dayPredictFat']
predictions_dF = TrainMdl(trainIpData, trainOpData, tuneTrue)
 predictions_dF[['ForecastId', 'ConfirmedCases', 'Fatalities']].to_csv('submission.csv', index=False )