Kaggle competition: COVID19 Global Forecasting (Week 3)
country_map = {'United States': 'US',
'Czech Republic(Czechia)': 'Czechia',
'Congo': 'Congo(Brazzaville)',
'DR Congo': 'Congo(Kinshasa)',
'South Korea': 'Korea, South',
'Taiwan': 'Taiwan*',
"Côte d'Ivoire": "Cote d'Ivoire",
'Saint Kitts & Nevis': 'Saint Kitts and Nevis',
'St.Vincent & Grenadines': 'Saint Vincent and the Grenadines'}
map_state_rev = {k: v for k, v in country_map.items() }<define_variables>
import plotly.graph_objects as go
import matplotlib.pyplot as plt
from tqdm import tqdm
import time
from datetime import datetime
from pathlib import Path
from sklearn import preprocessing
import keras.backend as K
from keras.models import Sequential
from keras.layers import Dense, LSTM, RNN, Dropout
from keras.callbacks import EarlyStopping
from keras import optimizers
from sklearn.preprocessing import StandardScaler, MinMaxScaler
country_age_map = {'Cape Verde': 'Cabo Verde',
'Democratic Republic of the Congo': 'Congo(Kinshasa)',
'Republic of the Congo': 'Congo(Brazzaville)',
'Czech Republic': 'Czechia',
'Eswatini(Swaziland)': 'Eswatini',
'South Korea': 'Korea, South',
'Taiwan': 'Taiwan*',
'United States': 'US'}
map_state_rev_age = {k: v for k, v in country_age_map.items() }<define_variables>
train = pd.read_csv("/kaggle/input/covid19-global-forecasting-week-3/train.csv")
 test = pd.read_csv("/kaggle/input/covid19-global-forecasting-week-3/test.csv")
 train.tail()
health_countries_map = {'Bosnia And Herzegovina': 'Bosnia and Herzegovina',
'Czech Republic': 'Czechia',
'South Korea': 'Korea, South',
'Taiwan': 'Taiwan*',
'Trinidad And Tobago': 'Trinidad and Tobago'}
map_state_rev_health = {k: v for k, v in health_countries_map.items() }<feature_engineering>
mask = train['Date'].max()
world_cum_confirmed = sum(train[train['Date'] == mask].ConfirmedCases)
 world_cum_fatal = sum(train[train['Date'] == mask].Fatalities )
population['New_country_name'] = population['Country(or dependency)'].apply(lambda x: country_map[x] if x in
map_state_rev else x)
 country_stats['New_country_name'] = country_stats['Country'].apply(lambda x: stats_countries_map[x] if x in
map_state_rev_stat else x)
 age_by_countries['New_country_name'] = age_by_countries['Country'].apply(lambda x: country_age_map[x] if x in
map_state_rev_age else x)
 health_index['New_country_name'] = health_index['Country'].apply(lambda x: health_countries_map[x] if x in
map_state_rev_health else x )<feature_engineering>
print('Number of Countires are: ', len(train['Country_Region'].unique()))
print('Training dataset ends at: ', mask)
 print('Number of cumulative confirmed cases worldwide are: ', world_cum_confirmed)
 print('Number of cumulative fatal cases worldwide are: ', world_cum_fatal )
health_care_idx = {}
health_care_exp_idx = {}
for item in set(health_index['New_country_name']):
health_care_idx[item] = health_index.loc[health_index['New_country_name'] == item, 'Health Care Index'].values[0]
health_care_exp_idx[item] = health_index.loc[health_index['New_country_name'] == item, 'Health Care Exp.Index'].values[0]<feature_engineering>
cum_per_country = train[train['Date'] == mask].groupby(['Date','Country_Region'] ).sum().sort_values(['ConfirmedCases'], ascending=False)
 cum_per_country[:10]
pop = {}
dens = {}
l_area = {}
age = {}
urban_pop = {}
for item in set(population['New_country_name']):
pop[item] = population.loc[population['New_country_name'] == item, 'Population(2020)'].values[0]
dens[item] = population.loc[population['New_country_name'] == item, 'Density(P/Km²)'].values[0]
l_area[item] = population.loc[population['New_country_name'] == item, 'Land Area(Km²)'].values[0]
age[item] = population.loc[population['New_country_name'] == item, 'Med.Age'].values[0]
urban_pop[item] = population.loc[population['New_country_name'] == item, 'Urban Pop %'].values[0]<feature_engineering>
date = train['Date'].unique()
cc_us = train[train['Country_Region'] == 'US'].groupby(['Date'] ).sum().ConfirmedCases
ft_us = train[train['Country_Region'] == 'US'].groupby(['Date'] ).sum().Fatalities
cc_ity = train[train['Country_Region'] == 'Italy'].groupby(['Date'] ).sum().ConfirmedCases
ft_ity = train[train['Country_Region'] == 'Italy'].groupby(['Date'] ).sum().Fatalities
cc_spn = train[train['Country_Region'] == 'Spain'].groupby(['Date'] ).sum().ConfirmedCases
ft_spn = train[train['Country_Region'] == 'Spain'].groupby(['Date'] ).sum().Fatalities
cc_gmn = train[train['Country_Region'] == 'Germany'].groupby(['Date'] ).sum().ConfirmedCases
ft_gmn = train[train['Country_Region'] == 'Germany'].groupby(['Date'] ).sum().Fatalities
cc_frc = train[train['Country_Region'] == 'France'].groupby(['Date'] ).sum().ConfirmedCases
ft_frc = train[train['Country_Region'] == 'France'].groupby(['Date'] ).sum().Fatalities
fig = go.Figure()
fig.add_trace(go.Scatter(x=date, y=cc_us, name='US'))
fig.add_trace(go.Scatter(x=date, y=cc_ity, name='Italy'))
fig.add_trace(go.Scatter(x=date, y=cc_spn, name='Spain'))
fig.add_trace(go.Scatter(x=date, y=cc_gmn, name='Germany'))
fig.add_trace(go.Scatter(x=date, y=cc_frc, name='France'))
fig.update_layout(title="Plot of Cumulative Cases for Top 5 countires(except China)",
xaxis_title="Date",
yaxis_title="Cases")
 fig.update_xaxes(nticks=30)
 fig.show()
for key, val in urban_pop.items() :
if val != 'N.A.':
urban_pop[key] = int(val.replace('%', '')) / 100
else:
urban_pop[key] = -1<feature_engineering>
train['Date'] = pd.to_datetime(train['Date'])
 test['Date'] = pd.to_datetime(test['Date'])
 train['Country_Region'] = train['Country_Region'].astype(str)
 test['Country_Region'] = test['Country_Region'].astype(str)
coastline = {}
inf_mort = {}
gdp = {}
literacy = {}
phones = {}
arable = {}
crops = {}
other = {}
climate = {}
birhrate = {}
deathrate = {}
agri = {}
industry = {}
service = {}
for item in set(country_stats['New_country_name']):
coastline[item] = country_stats.loc[country_stats['New_country_name'] == item, 'Coastline(coast/area ratio)'].values[0]
inf_mort[item] = country_stats.loc[country_stats['New_country_name'] == item, 'Infant mortality(per 1000 births)'].values[0]
gdp[item] = country_stats.loc[country_stats['New_country_name'] == item, 'GDP($ per capita)'].values[0]
literacy[item] = country_stats.loc[country_stats['New_country_name'] == item, 'Literacy(%)'].values[0]
phones[item] = country_stats.loc[country_stats['New_country_name'] == item, 'Phones(per 1000)'].values[0]
arable[item] = country_stats.loc[country_stats['New_country_name'] == item, 'Arable(%)'].values[0]
crops[item] = country_stats.loc[country_stats['New_country_name'] == item, 'Crops(%)'].values[0]
other[item] = country_stats.loc[country_stats['New_country_name'] == item, 'Other(%)'].values[0]
climate[item] = country_stats.loc[country_stats['New_country_name'] == item, 'Climate'].values[0]
birhrate[item] = country_stats.loc[country_stats['New_country_name'] == item, 'Birthrate'].values[0]
deathrate[item] = country_stats.loc[country_stats['New_country_name'] == item, 'Deathrate'].values[0]
agri[item] = country_stats.loc[country_stats['New_country_name'] == item, 'Agriculture'].values[0]
industry[item] = country_stats.loc[country_stats['New_country_name'] == item, 'Industry'].values[0]
service[item] = country_stats.loc[country_stats['New_country_name'] == item, 'Service'].values[0]<categorify>
EMPTY_VAL = "EMPTY_VAL"
def fillState(state, country):
if state == EMPTY_VAL: return country
return state
train['Province_State'].fillna(EMPTY_VAL, inplace=True)
 train['Province_State'] = train.loc[:, ['Province_State', 'Country_Region']].apply(lambda x : fillState(x['Province_State'], x['Country_Region']), axis=1)
 test['Province_State'].fillna(EMPTY_VAL, inplace=True)
 test['Province_State'] = test.loc[:, ['Province_State', 'Country_Region']].apply(lambda x : fillState(x['Province_State'], x['Country_Region']), axis=1 )
train_df['Population'] = train_df['Country_Region'].map(pop)
 train_df['Density'] = train_df['Country_Region'].map(dens)
 train_df['Land_Area'] = train_df['Country_Region'].map(l_area)
 train_df['Med_Age'] = train_df['Country_Region'].map(age)
 train_df['Urban_Pop'] = train_df['Country_Region'].map(urban_pop)
 train_df['Coastline'] = train_df['Country_Region'].map(coastline)
 train_df['Infant_mortality'] = train_df['Country_Region'].map(inf_mort)
 train_df['GDP'] = train_df['Country_Region'].map(gdp)
 train_df['Literacy'] = train_df['Country_Region'].map(literacy)
 train_df['Phones'] = train_df['Country_Region'].map(phones)
 train_df['Arable'] = train_df['Country_Region'].map(arable)
 train_df['Crops'] = train_df['Country_Region'].map(crops)
 train_df['Other'] = train_df['Country_Region'].map(other)
 train_df['Climate'] = train_df['Country_Region'].map(climate)
 train_df['Birthrate'] = train_df['Country_Region'].map(birhrate)
 train_df['Deathrate'] = train_df['Country_Region'].map(deathrate)
 train_df['Agriculture'] = train_df['Country_Region'].map(agri)
 train_df['Industry'] = train_df['Country_Region'].map(industry)
 train_df['Service'] = train_df['Country_Region'].map(service)
 train_df['Health_Care_Index'] = train_df['Country_Region'].map(health_care_idx)
 train_df['Health_Care_Exp_Index'] = train_df['Country_Region'].map(health_care_exp_idx)
 test_df['Population'] = test_df['Country_Region'].map(pop)
 test_df['Density'] = test_df['Country_Region'].map(dens)
 test_df['Land_Area'] = test_df['Country_Region'].map(l_area)
 test_df['Med_Age'] = test_df['Country_Region'].map(age)
 test_df['Urban_Pop'] = test_df['Country_Region'].map(urban_pop)
 test_df['Coastline'] = test_df['Country_Region'].map(coastline)
 test_df['Infant_mortality'] = test_df['Country_Region'].map(inf_mort)
 test_df['GDP'] = test_df['Country_Region'].map(gdp)
 test_df['Literacy'] = test_df['Country_Region'].map(literacy)
 test_df['Phones'] = test_df['Country_Region'].map(phones)
 test_df['Arable'] = test_df['Country_Region'].map(arable)
 test_df['Crops'] = test_df['Country_Region'].map(crops)
 test_df['Other'] = test_df['Country_Region'].map(other)
 test_df['Climate'] = test_df['Country_Region'].map(climate)
 test_df['Birthrate'] = test_df['Country_Region'].map(birhrate)
 test_df['Deathrate'] = test_df['Country_Region'].map(deathrate)
 test_df['Agriculture'] = test_df['Country_Region'].map(agri)
 test_df['Industry'] = test_df['Country_Region'].map(industry)
 test_df['Service'] = test_df['Country_Region'].map(service)
 test_df['Health_Care_Index'] = test_df['Country_Region'].map(health_care_idx)
 test_df['Health_Care_Exp_Index'] = test_df['Country_Region'].map(health_care_exp_idx )<feature_engineering>
le = preprocessing.LabelEncoder()
train['country_encoder'] = le.fit_transform(train['Country_Region'])
 train['date_int'] = train['Date'].apply(lambda x: datetime.strftime(x, '%m%d')).astype(int)
 test['country_encoder'] = le.transform(test['Country_Region'])
 test['date_int'] = test['Date'].apply(lambda x: datetime.strftime(x, '%m%d')).astype(int )
train_df['Urban_pop_num'] = train_df[['Population', 'Urban_Pop']].apply(lambda x: x[0]*x[1], axis=1)
 test_df['Urban_pop_num'] = test_df[['Population', 'Urban_Pop']].apply(lambda x: x[0]*x[1], axis=1 )<feature_engineering>
le = preprocessing.LabelEncoder()
train['province_encoder'] = le.fit_transform(train['Province_State'])
 test['province_encoder'] = le.transform(test['Province_State'] )
age_cols = ['Age 0 to 14 Years', 'Age 15 to 64 Years', 'Age above 65 Years']
for item in age_cols:
for i in range(len(age_by_countries)) :
if type(age_by_countries[item][i])== str:
age_by_countries[item][i] = age_by_countries[item][i].replace('%','')
 age_by_countries[item][i] = float(age_by_countries[item][i])/ 100<feature_engineering>
start_time = time.time()
country = train['Country_Region'].drop_duplicates()
train_df = train.copy()
train_df.rename(columns={'Date': 'date', 'ConfirmedCases': 'cc_cases', 'Fatalities': 'ft_cases', 'Country_Region': 'country', 'Province_State': 'province'}, inplace=True)
 lags = np.arange(1,8,1)
 with tqdm(total = len(list(train_df['date'].unique())))as pbar:
for d in train_df['date'].drop_duplicates() :
for i in country:
province = train_df[train_df['country'] == i]['province'].drop_duplicates()
for j in province:
mask =(train_df['date'] == d)&(train_df['country'] == i)&(train_df['province'] == j)
 for lag in lags:
mask_org =(train_df['date'] ==(d - pd.Timedelta(days=lag)))&(train_df['country'] == i)&(train_df['province'] == j)
 try:
train_df.loc[mask, 'cc_cases_' + str(lag)] = train_df.loc[mask_org, 'cc_cases'].values
except:
train_df.loc[mask, 'cc_cases_' + str(lag)] = 0
try:
train_df.loc[mask, 'ft_cases_' + str(lag)] = train_df.loc[mask_org, 'ft_cases'].values
except:
train_df.loc[mask, 'ft_cases_' + str(lag)] = 0
pbar.update(1)
 print('Time spent for building features is {} minutes'.format(round(( time.time() -start_time)/60,1)) )
age_014 = {}
age_1564 = {}
age_65plus = {}
for item in set(age_by_countries['New_country_name']):
age_014[item] = age_by_countries.loc[age_by_countries['New_country_name'] == item, 'Age 0 to 14 Years'].values[0]
age_1564[item] = age_by_countries.loc[age_by_countries['New_country_name'] == item, 'Age 15 to 64 Years'].values[0]
age_65plus[item] = age_by_countries.loc[age_by_countries['New_country_name'] == item, 'Age above 65 Years'].values[0]<categorify>
train_df = train_df[train_df['date_int']>=301]
train_df['weekday'] = train_df['date'].dt.weekday
train_df[train_df['country'] == 'Italy'].tail(10 )
train_df['age_0-14'] = train_df['Country_Region'].map(age_014)
 train_df['age_15-64'] = train_df['Country_Region'].map(age_1564)
 train_df['age_65plus'] = train_df['Country_Region'].map(age_65plus)
 test_df['age_0-14'] = test_df['Country_Region'].map(age_014)
 test_df['age_15-64'] = test_df['Country_Region'].map(age_1564)
 test_df['age_65plus'] = test_df['Country_Region'].map(age_65plus )<data_type_conversions>
def split_train_val(df, val_ratio):
val_len = int(len(df)* val_ratio)
 train_set = df[:-val_len]
val_set = df[-val_len:]
return train_set, val_set
train_df = train_df.fillna(-1)
 test_df = test_df.fillna(-1 )<feature_engineering>
test_fixed_cols = ['ForecastId', 'Province_State', 'Country_Region', 'Date']
fixed_cols = ['Id', 'province', 'country', 'date']
output_cols = ['cc_cases', 'ft_cases']
input_cols = list(set(train_df.columns.to_list())- set(fixed_cols)- set(output_cols))
print('output columns are ', output_cols)
 print('input columns are ', input_cols)
 X = train_df[input_cols]
y = train_df[output_cols]
def time_feat(df, start_day):
start_day = datetime.strptime(start_day, '%Y-%m-%d' ).date()
df['Date_time'] = df['Date'].apply(lambda x: datetime.strptime(x, '%Y-%m-%d' ).date())
 df['Time_delta'] = df['Date_time'].apply(lambda x:(x - start_day ).days)
 df['Month'] = df['Date'].apply(lambda x: datetime.strptime(x, '%Y-%m-%d' ).month)
 return df<feature_engineering>
cc_input = ['country_encoder', 'province_encoder', 'weekday', 'date_int','cc_cases_1', 'cc_cases_2', 'cc_cases_3', 'cc_cases_4', 'cc_cases_5', 'cc_cases_6', 'cc_cases_7']
ft_input = ['country_encoder', 'province_encoder', 'weekday' , 'date_int', 'ft_cases_1', 'ft_cases_2', 'ft_cases_3', 'ft_cases_4', 'ft_cases_5', 'ft_cases_6', 'ft_cases_7']
cc_output = ['cc_cases']
ft_output = ['ft_cases']
val_ratio = 0.05
X_cc = X[cc_input]
X_ft = X[ft_input]
y_cc = y[cc_output]
y_ft = y[ft_output]
train_X_cc, val_X_cc = split_train_val(df = X_cc, val_ratio = val_ratio)
 train_y_cc, val_y_cc = split_train_val(df = y_cc, val_ratio = val_ratio)
 train_X_ft, val_X_ft = split_train_val(df = X_ft, val_ratio = val_ratio)
 train_y_ft, val_y_ft = split_train_val(df = y_ft, val_ratio = val_ratio )
train_df = time_feat(train_df, '2020-01-22')
 test_df = time_feat(test_df, '2020-01-22' )<categorify>
def to_str(x):
if x == -1:
return str(x)
 return x<data_type_conversions>
train_df[cols[1]] = train_df[cols[1]].apply(lambda x: to_str(x))
test_df[cols[1]] = test_df[cols[1]].apply(lambda x: to_str(x))<prepare_x_and_y>
X_train_cc = train_X_cc.to_numpy()
X_val_cc = val_X_cc.to_numpy()
X_train_ft = train_X_ft.to_numpy()
X_val_ft = val_X_ft.to_numpy()
y_train_cc = train_y_cc.to_numpy()
y_val_cc = val_y_cc.to_numpy()
y_train_ft = train_y_ft.to_numpy()
y_val_ft = val_y_ft.to_numpy()
features=['Province_State', 'Country_Region', 'Population', 'Density', 'Land_Area', 'Med_Age',
'Urban_Pop', 'Coastline', 'Infant_mortality', 'GDP', 'Literacy',
'Phones', 'Arable', 'Crops', 'Other', 'Climate', 'Birthrate', 'Health_Care_Index',
'Health_Care_Exp_Index','Deathrate', 'Agriculture', 'Industry', 'Service', 'Urban_pop_num',
'Time_delta', 'Month', 'age_0-14', 'age_15-64', 'age_65plus']
train_X = train_df[features + ['ConfirmedCases', 'Fatalities']].copy()
train_yc = train_df['ConfirmedCases'].copy()
train_yf = train_df['Fatalities'].copy()<feature_engineering>
def root_mean_squared_log_error(y_true, y_pred):
return K.sqrt(K.mean(K.square(K.log(y_pred + 1)- K.log(y_true + 1))))
for i in range(len(train_X)) :
if train_X['Med_Age'][i] == 'N.A.':
train_X['Med_Age'][i] = -1
for feature in features:
for i in range(len(test_df)) :
if test_df[feature][i] == 'N.A.':
test_df[feature][i] = -1<categorify>
def LSTM_model(n_1, input_dim, output_dim):
model = Sequential()
model.add(LSTM(n_1,input_shape=(1, input_dim), activation='relu'))
model.add(Dense(output_dim, activation='relu'))
model.compile(loss=root_mean_squared_log_error, optimizer='adam')
 return model
enc1 = OrdinalEncoder()
enc2 = OrdinalEncoder()
enc1.fit(train_X[cols[1]].to_numpy().reshape(-1, 1))
enc2.fit(train_X[cols[2]].to_numpy().reshape(-1, 1))
train_X[cols[1]] = enc1.transform(train_X[cols[1]].to_numpy().reshape(-1, 1))
train_X[cols[2]] = enc2.transform(train_X[cols[2]].to_numpy().reshape(-1, 1))
test_df[cols[1]] = enc1.transform(test_df[cols[1]].to_numpy().reshape(-1, 1))
test_df[cols[2]] = enc2.transform(test_df[cols[2]].to_numpy().reshape(-1, 1))<feature_engineering>
K.clear_session()
model_cc = LSTM_model(4, X_train_cc.shape[-1], y_train_cc.shape[-1])
 model_ft = LSTM_model(4, X_train_ft.shape[-1], y_train_ft.shape[-1])
 early_stop_cc = EarlyStopping(monitor='val_loss', patience=5, verbose=0, mode='min')
 early_stop_ft = EarlyStopping(monitor='val_loss', patience=5, verbose=0, mode='min' )
check_list = ['Coastline', 'Infant_mortality', 'GDP', 'Literacy','Phones', 'Arable', 'Crops', 'Other',
'Climate', 'Birthrate', 'Deathrate', 'Agriculture', 'Industry', 'Service']
for item in check_list:
for i in range(len(train_X)) :
if type(train_X[item][i])== str:
train_X[item][i] = train_X[item][i].replace(',','.')
 train_X[item][i] = float(train_X[item][i])
 for item in check_list:
for i in range(len(test_df)) :
if type(test_df[item][i])== str:
test_df[item][i] = test_df[item][i].replace(',','.')
 test_df[item][i] = float(test_df[item][i] )<feature_engineering>
print('Start model training')
 start_time = time.time()
history_cc = model_cc.fit(X_train_cc, y_train_cc, batch_size = 16, epochs = 100,validation_data =(X_val_cc, y_val_cc), verbose = 2, callbacks=[early_stop_cc])
 model_cc.save("model_cc.h5")
 print('Time spent for model training is {} minutes'.format(round(( time.time() -start_time)/60,1)) )
train_X['Agri_pop_num'] = train_X[['Population', 'Agriculture']].apply(lambda x: x[0]*x[1], axis=1)
 train_X['Industry_pop_num'] = train_X[['Population', 'Industry']].apply(lambda x: x[0]*x[1], axis=1)
 train_X['Service_pop_num'] = train_X[['Population', 'Service']].apply(lambda x: x[0]*x[1], axis=1)
 train_X['age_0-14_num'] = train_X[['Population', 'age_0-14']].apply(lambda x: x[0]*x[1], axis=1)
 train_X['age_15-64_num'] = train_X[['Population', 'age_15-64']].apply(lambda x: x[0]*x[1], axis=1)
 train_X['age_65plus_num'] = train_X[['Population', 'age_65plus']].apply(lambda x: x[0]*x[1], axis=1)
 test_df['Agri_pop_num'] = test_df[['Population', 'Agriculture']].apply(lambda x: x[0]*x[1], axis=1)
 test_df['Industry_pop_num'] = test_df[['Population', 'Industry']].apply(lambda x: x[0]*x[1], axis=1)
 test_df['Service_pop_num'] = test_df[['Population', 'Service']].apply(lambda x: x[0]*x[1], axis=1)
 test_df['age_0-14_num'] = test_df[['Population', 'age_0-14']].apply(lambda x: x[0]*x[1], axis=1)
 test_df['age_15-64_num'] = test_df[['Population', 'age_15-64']].apply(lambda x: x[0]*x[1], axis=1)
 test_df['age_65plus_num'] = test_df[['Population', 'age_65plus']].apply(lambda x: x[0]*x[1], axis=1 )<define_variables>
print('Start model training')
 start_time = time.time()
history_ft = model_ft.fit(X_train_ft, y_train_ft, batch_size = 16, epochs = 8,validation_data =(X_val_ft, y_val_ft), verbose = 2, callbacks=[early_stop_ft])
 model_ft.save("model_ft.h5")
 print('Time spent for model training is {} minutes'.format(round(( time.time() -start_time)/60,1)) )
features = features + ['Agri_pop_num', 'Industry_pop_num', 'Service_pop_num',
'age_0-14_num', 'age_15-64_num', 'age_65plus_num']<drop_column>
yhat_val_cc = model_cc.predict(X_val_cc)
 print(yhat_val_cc[50:70] )
features.remove('Agriculture')
 features.remove('Industry')
 features.remove('Service')
 features.remove('Urban_Pop')
 features.remove('age_0-14')
 features.remove('age_15-64')
 features.remove('age_65plus')
<normalization>
yhat_val_ft = model_ft.predict(X_val_ft)
 print(yhat_val_ft[60:70] )
scaler = StandardScaler()
train_X = scaler.fit_transform(train_X[features])
 train_X = pd.DataFrame(data=train_X, columns=features)
 test = test_df[features].copy()
test = scaler.transform(test)
 test = pd.DataFrame(data=test, columns=features )<split>
submission = pd.DataFrame()
submission['ForecastId'] = test_df['ForecastId']
submission['ConfirmedCases'] = test_df['cc_cases']
submission['Fatalities'] = test_df['ft_cases']
<split><EOS> 
submission.to_csv("submission.csv",index=False )