Kaggle competition: PUBG Finish Placement Prediction (Kernels Only)
<SOS> metric: MAE Kaggle data source: pubg-finish-placement-prediction-(kernels-only)<choose_model_class>
import numpy as np
import pandas as pd
import itertools
import os
import gc
import sys
import matplotlib.pyplot as plt
import seaborn as sns
lightgbm = LGBMRegressor(objective='regression',
num_leaves=4,
learning_rate=0.01,
n_estimators=8000,
max_bin=200,
bagging_fraction=0.75,
bagging_freq=5,
bagging_seed=7,
feature_fraction=0.2,
feature_fraction_seed=7,
verbose=-1, 
)
 e_alphas = [0.0001, 0.0002, 0.0003, 0.0004, 0.0005, 0.0006, 0.0007]
e_l1ratio = [0.8, 0.85, 0.9, 0.95, 0.99, 1]
alphas_alt = [14.5, 14.6, 14.7, 14.8, 14.9, 15, 15.1, 15.2, 15.3, 15.4, 15.5]
alphas2 = [5e-05, 0.0001, 0.0002, 0.0003, 0.0004, 0.0005, 0.0006, 0.0007, 0.0008]
ridge = make_pipeline(RobustScaler() , RidgeCV(alphas=alphas_alt, cv=kfolds))
lasso = make_pipeline(RobustScaler() , LassoCV(max_iter=1e7,
alphas=alphas2,random_state=42, cv=kfolds))
elasticnet = make_pipeline(RobustScaler() , ElasticNetCV(max_iter=1e7,
alphas=e_alphas, cv=kfolds, l1_ratio=e_l1ratio))
stack_gen = StackingCVRegressor(regressors=(ridge, lasso, elasticnet, lightgbm),
meta_regressor=elasticnet,
use_features_in_secondary=True)
 models = {'Ridge': ridge,
'Lasso': lasso,
'ElasticNet': elasticnet,
'lightgbm': lightgbm}
predictions = {}
scores = {}<compute_train_metric>
sns.set_style('darkgrid')
 sns.set_palette('bone' )
for name, model in models.items() :
model.fit(X, y)
 predictions[name] = np.expm1(model.predict(X))
score = cv_rmse(model, X=X)
 scores[name] =(score.mean() , score.std() )<compute_test_metric>
def toTapleList(list1,list2):
return list(itertools.product(list1,list2))
scoreList = []
print('---- Score with CV_RMSE-----')
 score = cv_rmse(ridge)
 print("Ridge score: {:.4f}({:.4f})
 ".format(score.mean() , score.std()))
scoreList.append(1 - score.mean())
 score = cv_rmse(lasso)
 print("Lasso score: {:.4f}({:.4f})
 ".format(score.mean() , score.std()))
scoreList.append(1 - score.mean())
 score = cv_rmse(elasticnet)
 print("ElasticNet score: {:.4f}({:.4f})
 ".format(score.mean() , score.std()))
scoreList.append(1 - score.mean())
 score = cv_rmse(lightgbm)
 print("lightgbm score: {:.4f}({:.4f})
 ".format(score.mean() , score.std()))
scoreList.append(1 - score.mean())
 score = cv_rmse(stack_gen)
 print("stack_gen score: {:.4f}({:.4f})
 ".format(score.mean() , score.std()))
scoreList.append(1 - score.mean())
 ".format(score.mean() , score.std()))
print('----START Fit----',datetime.now())
 print('Elasticnet')
 elastic_model = elasticnet.fit(X, y)
 print('Lasso')
 lasso_model = lasso.fit(X, y)
 print('Ridge')
 ridge_model = ridge.fit(X, y)
 print('lightgbm')
 lgb_model_full_data = lightgbm.fit(X, y)
 print('stack_gen')
 stack_gen_model = stack_gen.fit(np.array(X), np.array(y)) 
<find_best_model_class>
train = pd.read_csv('.. /input/train_V2.csv')
 train = reduce_mem_usage(train)
 test = pd.read_csv('.. /input/test_V2.csv')
 test = reduce_mem_usage(test)
 print(train.shape, test.shape )
def blend_models_predict(X):
return(( 0.25 * elastic_model.predict(X)) + \ 
(0.25 * lasso_model.predict(X)) + \ 
(0.2 * ridge_model.predict(X)) + \ 
(0.10 * lgb_model_full_data.predict(X)) + \ 
(0.2 * stack_gen_model.predict(np.array(X))))
def blend_models_predict_ABL(X, _scoreList):
print("scoreList~>|%s|" %(_scoreList,))
ScoreSum = sum(_scoreList)
 print("ScoreSum~>|%s|" %(ScoreSum,))
return(( scoreList[2]/ScoreSum * elastic_model.predict(X)) + \ 
(scoreList[1]/ScoreSum * lasso_model.predict(X)) + \ 
(scoreList[0]/ScoreSum * ridge_model.predict(X)) + \ 
(scoreList[3]/ScoreSum * lgb_model_full_data.predict(X)) + \ 
(scoreList[4]/ScoreSum* stack_gen_model.predict(np.array(X))))<compute_test_metric>
null_cnt = train.isnull().sum().sort_values()
print('null count:', null_cnt[null_cnt > 0])
 train.dropna(inplace=True )
print('RMSLE score on train data:')
 print(rmsle(y, blend_models_predict(X)))
 print('RMSLE score on train data:(blend_models_predict2)')
 print(rmsle(y, blend_models_predict_ABL(X, scoreList)) )<load_from_csv>
for c in ['Id','groupId','matchId']:
print(f'unique [{c}] count:', train[c].nunique() )
print('Predict submission')
 submission = pd.read_csv(".. /input/sample_submission.csv")
 submission.iloc[:,1] =(np.expm1(blend_models_predict_ABL(X_test, scoreList)) )<import_modules>
all_data = train.append(test, sort=False ).reset_index(drop=True)
 del train, test
gc.collect()
from keras.layers import *
from keras.models import Model 
<categorify>
match = all_data.groupby('matchId')
 all_data['killsPerc'] = match['kills'].rank(pct=True ).values
all_data['killPlacePerc'] = match['killPlace'].rank(pct=True ).values
all_data['walkDistancePerc'] = match['walkDistance'].rank(pct=True ).values
all_data['walkPerc_killsPerc'] = all_data['walkDistancePerc'] / all_data['killsPerc']
def normalize(x):

 return x /(K.sqrt(K.mean(K.square(x)))+ K.epsilon())
 def deprocess_image(x):

 x -= x.mean()
x /=(x.std() + K.epsilon())
 x *= 0.25
x += 0.5
x = np.clip(x, 0, 1)
 x *= 255
if K.image_data_format() == 'channels_first':
x = x.transpose(( 1, 2, 0))
x = np.clip(x, 0, 255 ).astype('uint8')
 return x
def process_image(x, former):

 if K.image_data_format() == 'channels_first':
x = x.transpose(( 2, 0, 1))
return(x / 255 - 0.5)* 4 * former.std() + former.mean()
def visualize_layer(model,
layer_name,
step=1.,
epochs=15,
upscaling_steps=9,
upscaling_factor=1.2,
output_dim=(412, 412),
filter_range=(0, None)) :

 def _generate_filter_image(input_img,
layer_output,
filter_index):

 s_time = time.time()
if K.image_data_format() == 'channels_first':
loss = K.mean(layer_output[:, filter_index, :, :])
 else:
loss = K.mean(layer_output[:, :, :, filter_index])
 grads = K.gradients(loss, input_img)[0]
grads = normalize(grads)
 iterate = K.function([input_img], [loss, grads])
 intermediate_dim = tuple(
 int(x /(upscaling_factor ** upscaling_steps)) for x in output_dim)
 if K.image_data_format() == 'channels_first':
input_img_data = np.random.random(
(1, 3, intermediate_dim[0], intermediate_dim[1]))
else:
input_img_data = np.random.random(
(1, intermediate_dim[0], intermediate_dim[1], 3))
input_img_data =(input_img_data - 0.5)* 20 + 128
for up in reversed(range(upscaling_steps)) :
for _ in range(epochs):
loss_value, grads_value = iterate([input_img_data])
 input_img_data += grads_value * step
if loss_value <= K.epsilon() :
return None
intermediate_dim = tuple(
 int(x /(upscaling_factor ** up)) for x in output_dim)
 img = deprocess_image(input_img_data[0])
 img = np.array(pil_image.fromarray(img ).resize(intermediate_dim,
pil_image.BICUBIC))
input_img_data = np.expand_dims(
 process_image(img, input_img_data[0]), 0)
 img = deprocess_image(input_img_data[0])
 e_time = time.time()
print('Costs of filter {:3}: {:5.0f}({:4.2f}s)'.format(filter_index,
loss_value,
e_time - s_time))
return img, loss_value
def _draw_filters(filters, n=None):

 if n is None:
n = int(np.floor(np.sqrt(len(filters))))
filters.sort(key=lambda x: x[1], reverse=True)
 filters = filters[:n * n]
MARGIN = 5
width = n * output_dim[0] +(n - 1)* MARGIN
height = n * output_dim[1] +(n - 1)* MARGIN
stitched_filters = np.zeros(( width, height, 3), dtype='uint8')
 for i in range(n):
for j in range(n):
img, _ = filters[i * n + j]
width_margin =(output_dim[0] + MARGIN)* i
height_margin =(output_dim[1] + MARGIN)* j
stitched_filters[
width_margin: width_margin + output_dim[0],
height_margin: height_margin + output_dim[1], :] = img
save_img('vgg_{0:}_{1:}x{1:}.png'.format(layer_name, n), stitched_filters)
 assert len(model.inputs)== 1
input_img = model.inputs[0]
layer_dict = dict([(layer.name, layer)for layer in model.layers[1:]])
 output_layer = layer_dict[layer_name]
assert isinstance(output_layer, layers.Conv2D)
 filter_lower = filter_range[0]
filter_upper =(filter_range[1]
if filter_range[1] is not None
else len(output_layer.get_weights() [1]))
assert(filter_lower >= 0
and filter_upper <= len(output_layer.get_weights() [1])
 and filter_upper > filter_lower)
 print('Compute filters {:} to {:}'.format(filter_lower, filter_upper))
processed_filters = []
for f in range(filter_lower, filter_upper):
img_loss = _generate_filter_image(input_img, output_layer.output, f)
 if img_loss is not None:
processed_filters.append(img_loss)
 print('{} filter processed.'.format(len(processed_filters)))
 _draw_filters(processed_filters)
<load_from_csv>
all_data['_totalDistance'] = all_data['rideDistance'] + all_data['walkDistance'] + all_data['swimDistance']
train_data=pd.read_csv("/kaggle/input/digit-recognizer/train.csv")
 test_data=pd.read_csv("/kaggle/input/digit-recognizer/test.csv" )<prepare_x_and_y>
def fillInf(df, val):
numcols = df.select_dtypes(include='number' ).columns
cols = numcols[numcols != 'winPlacePerc']
df[df == np.Inf] = np.NaN
df[df == np.NINF] = np.NaN
for c in cols: df[c].fillna(val, inplace=True )
y=train_data["label"]
X=train_data.copy()
del X["label"]<define_variables>
all_data['_healthItems'] = all_data['heals'] + all_data['boosts']
all_data['_headshotKillRate'] = all_data['headshotKills'] / all_data['kills']
all_data['_killPlaceOverMaxPlace'] = all_data['killPlace'] / all_data['maxPlace']
all_data['_killsOverWalkDistance'] = all_data['kills'] / all_data['walkDistance']
fillInf(all_data, 0 )
SIZE=32<normalization>
all_data.drop(['boosts','heals','killStreaks','DBNOs'], axis=1, inplace=True)
 all_data.drop(['headshotKills','roadKills','vehicleDestroys'], axis=1, inplace=True)
 all_data.drop(['rideDistance','swimDistance','matchDuration'], axis=1, inplace=True)
 all_data.drop(['rankPoints','killPoints','winPoints'], axis=1, inplace=True )
def reshape32(img):
img=img.reshape(( 28,28))
img=np.pad(img,(( SIZE-28)//2,(SIZE-28)//2))
img=img.reshape(( SIZE,SIZE,1))
return img<define_variables>
match = all_data.groupby(['matchId'])
 group = all_data.groupby(['matchId','groupId','matchType'])
 agg_col = list(all_data.columns)
 exclude_agg_col = ['Id','matchId','groupId','matchType','maxPlace','numGroups','winPlacePerc']
for c in exclude_agg_col:
agg_col.remove(c)
 print(agg_col)
 sum_col = ['kills','killPlace','damageDealt','walkDistance','_healthItems']
new_X=[]
for i,img in enumerate(X.values):
new_X.append(reshape32(img))
new_X=np.array(new_X)
 new_X[new_X<50]=0 
<split>
minKills = all_data.sort_values(['matchId','groupId','kills','killPlace'] ).groupby(
 ['matchId','groupId','kills'] ).first().reset_index().copy()
for n in np.arange(4):
c = 'kills_' + str(n)+ '_Place'
nKills =(minKills['kills'] == n)
 minKills.loc[nKills, c] = minKills[nKills].groupby(['matchId'])['killPlace'].rank().values
match_data = pd.merge(match_data, minKills[nKills][['matchId','groupId',c]], how='left')
 match_data = reduce_mem_usage(match_data)
 del minKills, nKills
print(match_data.shape )
train_X,val_X,train_y,val_y = train_test_split(new_X/255,y,test_size=0.1 )<choose_model_class>
all_data = pd.merge(all_data, match_data)
 del match_data
gc.collect()
all_data['enemy.players'] = all_data['m.players'] - all_data['players']
for c in sum_col:
all_data['p.max_msum.' + c] = all_data['max.' + c] / all_data['m.sum.' + c]
all_data['p.max_mmax.' + c] = all_data['max.' + c] / all_data['m.max.' + c]
all_data.drop(['m.sum.' + c, 'm.max.' + c], axis=1, inplace=True)
 fillInf(all_data, 0)
 print(all_data.shape )
inp=Input(shape=(32,32,1))
model = Conv2D(filters=32, kernel_size=(2, 2), padding='SAME', activation='relu',name="conv32" )(inp)
 model = Conv2D(filters=32, kernel_size=(2, 2), padding='SAME', activation='relu' )(model)
 model = Conv2D(filters=32, kernel_size=(2, 2), padding='SAME', activation='relu' )(model)
 model = BatchNormalization(momentum=0.15 )(model)
 model = MaxPool2D(pool_size=(2, 2))(model)
 model = Conv2D(filters=32, kernel_size=(3, 3), padding='SAME', activation='relu' )(model)
 model = Dropout(rate=0.3 )(model)
 model = Conv2D(filters=64, kernel_size=(5, 5), padding='SAME', activation='relu',name="conv64" )(model)
 model = Conv2D(filters=64, kernel_size=(5, 5), padding='SAME', activation='relu' )(model)
 model = Conv2D(filters=64, kernel_size=(5, 5), padding='SAME', activation='relu' )(model)
 model = BatchNormalization(momentum=0.15 )(model)
 model = MaxPool2D(pool_size=(2, 2))(model)
 model = Conv2D(filters=64, kernel_size=(5, 5), padding='SAME', activation='relu' )(model)
 model = BatchNormalization(momentum=0.15 )(model)
 model = Dropout(rate=0.2 )(model)
 model = Conv2D(filters=128, kernel_size=(7, 7), padding='SAME', activation='relu',name="conv128" )(model)
 model = Conv2D(filters=128, kernel_size=(7, 7), padding='SAME', activation='relu' )(model)
 model = Conv2D(filters=128, kernel_size=(7, 7), padding='SAME', activation='relu' )(model)
 model = BatchNormalization(momentum=0.15 )(model)
 model = MaxPool2D(pool_size=(2, 2))(model)
 model = Conv2D(filters=128, kernel_size=(7, 7), padding='SAME', activation='relu' )(model)
 model = BatchNormalization(momentum=0.15 )(model)
 model = Dropout(rate=0.2 )(model)
 model = Conv2D(filters=256, kernel_size=(15, 15), padding='SAME', activation='relu',name="conv256" )(model)
 model = Conv2D(filters=256, kernel_size=(15, 15), padding='SAME', activation='relu' )(model)
 model = Conv2D(filters=256, kernel_size=(15, 15), padding='SAME', activation='relu' )(model)
 model = BatchNormalization(momentum=0.15 )(model)
 model = MaxPool2D(pool_size=(2, 2))(model)
 model = Dropout(rate=0.2 )(model)
 my_x=Flatten()(model)
 my_x=Dense(256,activation='relu',kernel_initializer='he_uniform',bias_initializer='zeros' )(my_x)
 my_x=Dropout(0.2 )(my_x)
 my_x=Dense(128,activation='relu',kernel_initializer='he_uniform',bias_initializer='zeros' )(my_x)
 my_x=Dropout(0.2 )(my_x)
 my_x=Dense(64,activation='relu',name='my' )(my_x)
 my_x=Dropout(0.2 )(my_x)
 my_x=Dense(32,activation='relu',name='my2' )(my_x)
 my_x=Dropout(0.2 )(my_x)
 preds=Dense(10,activation='softmax',kernel_initializer='he_uniform',bias_initializer='zeros',name='output' )(my_x)
 my_model=Model(inputs=inp,outputs=preds)
<choose_model_class>
match = all_data.groupby('matchId')
 matchRank = match[numcols].rank(pct=True ).rename(columns=lambda s: 'rank.' + s)
 all_data = reduce_mem_usage(pd.concat([all_data, matchRank], axis=1))
rank_col = matchRank.columns
del matchRank
gc.collect()
match = all_data.groupby('matchId')
 matchRank = match[rank_col].max().rename(columns=lambda s: 'max.' + s ).reset_index()
all_data = pd.merge(all_data, matchRank)
 for c in numcols:
all_data['rank.' + c] = all_data['rank.' + c] / all_data['max.rank.' + c]
all_data.drop(['max.rank.' + c], axis=1, inplace=True)
 del matchRank
gc.collect()
print(all_data.shape )
my_model.compile(optimizer=Adadelta() ,loss='categorical_crossentropy',metrics=['accuracy','mse'] )<categorify>
killMinorRank = all_data[['matchId','min.kills','max.killPlace']].copy()
group = killMinorRank.groupby(['matchId','min.kills'])
 killMinorRank['rank.minor.maxKillPlace'] = group.rank(pct=True ).values
all_data = pd.merge(all_data, killMinorRank)
 killMinorRank = all_data[['matchId','max.kills','min.killPlace']].copy()
group = killMinorRank.groupby(['matchId','max.kills'])
 killMinorRank['rank.minor.minKillPlace'] = group.rank(pct=True ).values
all_data = pd.merge(all_data, killMinorRank)
 del killMinorRank
gc.collect()
rlrp = ReduceLROnPlateau(monitor='loss', factor=0.1, patience=2, min_delta=1E-30,verbose=1)
 history=my_model.fit(x=train_X,y=pd.get_dummies(train_y),validation_data=(val_X,pd.get_dummies(val_y)) ,epochs=100, batch_size=1024,callbacks=[rlrp])
<load_pretrained>
constant_column = [col for col in all_data.columns if all_data[col].nunique() == 1]
print('drop columns:', constant_column)
 all_data.drop(constant_column, axis=1, inplace=True )
for layer in my_model.layers:
print(layer.name,)
 if 'conv' not in layer.name:
continue
filters, biases = layer.get_weights()
filters, biases = layer.get_weights()
f_min, f_max = filters.min() , filters.max()
filters =(filters - f_min)/(f_max - f_min)
 n_filters, ix = 6, 1
for i in range(n_filters):
f = filters[:, :, :, i]
for j in range(1):
ax = plt.subplot(n_filters, 3, ix)
 ax.set_xticks([])
 ax.set_yticks([])
 plt.imshow(f[:, :, j], cmap='gray')
 ix += 1
plt.show()<predict_on_test>
all_data['matchType'] = all_data['matchType'].apply(mapper)
 all_data = pd.concat([all_data, pd.get_dummies(all_data['matchType'])], axis=1)
 all_data.drop(['matchType'], axis=1, inplace=True)
 all_data['matchId'] = all_data['matchId'].apply(lambda x: int(x,16))
all_data['groupId'] = all_data['groupId'].apply(lambda x: int(x,16))
for i in range(len(val_X)) :
if np.argmax(my_model.predict(val_X[i].reshape(1,32,32,1)) ,axis=1)!=val_y.values[i]: 
(plt.imshow(val_X[i].reshape(32,32),))
plt.show()
print("Label : ",val_y.values[i])
 print("Prediction : ",np.argmax(my_model.predict(val_X[i].reshape(1,32,32,1)) ,axis=1)) 
<normalization>
null_cnt = all_data.isnull().sum().sort_values()
print(null_cnt[null_cnt > 0] )
test_X=[]
for i,img in enumerate(test_data.values):
z=reshape32(img)
 test_X.append(z)
 test_X=np.array(test_X)
 test_X[test_X<50]=0
test_X=test_X/255<save_to_csv>
cols = [col for col in all_data.columns if col not in ['Id','matchId','groupId']]
for i, t in all_data.loc[:, cols].dtypes.iteritems() :
if t == object:
all_data[i] = pd.factorize(all_data[i])[0]
all_data = reduce_mem_usage(all_data)
 all_data.head()
sol=np.argmax(my_model.predict(( test_X)) ,axis=1)
 df=pd.DataFrame(sol)
 df.index+=1
df.to_csv("/kaggle/working/sol_final.csv",index=True,header=["Label"],index_label=["ImageId"] )<set_options>
X_train = all_data[all_data['winPlacePerc'].notnull() ].reset_index(drop=True)
 X_test = all_data[all_data['winPlacePerc'].isnull() ].drop(['winPlacePerc'], axis=1 ).reset_index(drop=True)
 del all_data
gc.collect()
Y_train = X_train.pop('winPlacePerc')
 X_test_grp = X_test[['matchId','groupId']].copy()
train_matchId = X_train['matchId']
X_train.drop(['matchId','groupId'], axis=1, inplace=True)
 X_test.drop(['matchId','groupId'], axis=1, inplace=True)
 print(X_train.shape, X_test.shape )
%matplotlib inline
Dense,
Flatten,
Dropout,
Conv2D,
MaxPooling2D,
Activation,
BatchNormalization 
)
<set_options>
print(pd.DataFrame([[val for val in dir() ], [sys.getsizeof(eval(val)) for val in dir() ]],
index=['name','size'] ).T.sort_values('size', ascending=False ).reset_index(drop=True)[:10])
config = tf.compat.v1.ConfigProto()
config.gpu_options.allow_growth = True
session = tf.compat.v1.Session(config=config )<load_from_csv>
params={'learning_rate': 0.1,
'objective':'mae',
'metric':'mae',
'num_leaves': 31,
'verbose': 1,
'random_state':42,
'bagging_fraction': 0.7,
'feature_fraction': 0.7
}
reg = lgb.LGBMRegressor(**params, n_estimators=10000)
 reg.fit(X_train, Y_train)
 pred = reg.predict(X_test, num_iteration=reg.best_iteration_ )
sample_submission = pd.read_csv(".. /input/digit-recognizer/sample_submission.csv")
 test = pd.read_csv(".. /input/digit-recognizer/test.csv")
 train = pd.read_csv(".. /input/digit-recognizer/train.csv" )<prepare_x_and_y>
X_test_grp['_nofit.winPlacePerc'] = pred
group = X_test_grp.groupby(['matchId'])
 X_test_grp['winPlacePerc'] = pred
X_test_grp['_rank.winPlacePerc'] = group['winPlacePerc'].rank(method='min')
 X_test = pd.concat([X_test, X_test_grp], axis=1 )
X_train = train.loc[:, train.columns!='label'].values.astype('uint8')
 y_train = train['label'].values
X_train = X_train.reshape(( X_train.shape[0],28,28))<data_type_conversions>
fullgroup =(X_test['numGroups'] == X_test['maxPlace'])
 subset = X_test.loc[fullgroup]
X_test.loc[fullgroup, 'winPlacePerc'] =(subset['_rank.winPlacePerc'].values - 1)/(subset['maxPlace'].values - 1)
 subset = X_test.loc[~fullgroup]
gap = 1.0 /(subset['maxPlace'].values - 1)
 new_perc = np.around(subset['winPlacePerc'].values / gap)* gap
X_test.loc[~fullgroup, 'winPlacePerc'] = new_perc
X_test['winPlacePerc'] = X_test['winPlacePerc'].clip(lower=0,upper=1 )
X_test = test.loc[:, test.columns!='label'].values.astype('uint8')
 X_test = X_test.reshape(( X_test.shape[0],28,28))<split>
test = pd.read_csv('.. /input/test_V2.csv')
 test['matchId'] = test['matchId'].apply(lambda x: int(x,16))
test['groupId'] = test['groupId'].apply(lambda x: int(x,16))
submission = pd.merge(test, X_test[['matchId','groupId','winPlacePerc']])
 submission = submission[['Id','winPlacePerc']]
submission.to_csv("submission.csv", index=False )