Kaggle competition: TGS Salt Identification Challenge
<SOS> metric: IntersectionOverUnionObjectSegmentation Kaggle data source: tgs-salt-identification-challenge<load_from_csv>
%matplotlib inline
test = pd.read_csv(".. /input/titanic/test.csv")
 test.head() 
<count_missing_values>
def rle_decode(rle_mask):

 s = rle_mask.split()
starts, lengths = [np.asarray(x, dtype=int)for x in(s[0:][::2], s[1:][::2])]
starts -= 1
ends = starts + lengths
img = np.zeros(101*101, dtype=np.uint8)
 for lo, hi in zip(starts, ends):
img[lo:hi] = 1
return img.reshape(101,101 )
print(test.shape)
 print(test.columns)
 print(test.isnull().sum())
 print(test.dtypes)
 passenger_id= test['PassengerId']
data_combined=train.append(test )<prepare_output>

 df = pd.read_csv('.. /input/using-resnet50-pretrained-model/resnet50_pretrained_submission.csv')
 i = 0
j = 0
plt.figure(figsize=(30,15))
plt.subplots_adjust(bottom=0.2, top=0.8, hspace=0.2)
 while True:
if str(df.loc[i,'rle_mask'])!=str(np.nan):
decoded_mask = rle_decode(df.loc[i,'rle_mask'])
 plt.subplot(1,6,j+1)
 plt.imshow(decoded_mask)
 plt.title('ID: '+df.loc[i,'id'])
 j = j + 1
if j>5:
break
i = i + 1
train.set_index(['PassengerId'] , inplace=True)
 test.set_index(['PassengerId'] , inplace=True)
 train.head()<define_variables>
test_path = '.. /input/tgs-salt-identification-challenge/test/images/'
women = train.loc[train.Sex == 'female']["Survived"]
rate_women = sum(women)/len(women)
 print("% of women who survived:", rate_women )<define_variables>

 def rle_encode(im):

 pixels = im.flatten()
pixels = np.concatenate([[0], pixels, [0]])
 runs = np.where(pixels[1:] != pixels[:-1])[0] + 1
runs[1::2] -= runs[::2]
return ' '.join(str(x)for x in runs )
<categorify><EOS> 
df.to_csv('crf_correction.csv',index=False )