Kaggle competition: Severstal: Steel Defect Detection
def save_in_file_fast(arr, file_name):
pickle.dump(arr, open(file_name, 'wb'))
def load_from_file_fast(file_name):
return pickle.load(open(file_name, 'rb'))<feature_engineering>
df = pd.read_csv('.. /input/severstal-steel-defect-detection/sample_submission.csv')
 df['EncodedPixels']=['' for i in range(len(df)) ]
df_submit = pd.read_csv(".. /input/unet-sai/submission.csv")
 df_submit = df_submit.fillna('' )
def SieveOfEratosthenes(n):
prime = [True for i in range(n + 1)]
prime[0] = False
prime[1] = False
p = 2
while(p * p <= n):
if(prime[p] == True):
for i in range(p * 2, n + 1, p):
prime[i] = False
p += 1
return prime<load_pretrained>
df_submit['ImageId_ClassId'] = [(str(df_submit['ImageId'][i])+'_'+str(df_submit['ClassId'][i])) for i in range(len(df_submit)) ]
df_submit.head()
<find_best_params><EOS> 
if df.columns[0]=='ImageId_ClassId':
df.set_index('ImageId_ClassId', inplace=True)
 df_submit.set_index('ImageId_ClassId', inplace=True)
 for name, row in df_submit.iterrows() :
df.loc[name] = row
df.reset_index(inplace=True)
 df.to_csv('submission.csv', index=False)
 df.head()