Kaggle competition: University of applied sciences Mannheim
train_data["Fare"] = np.where(train_data["Fare"] != 0,np.log(train_data["Fare"]),np.log(0.00001))
test_data["Fare"] = np.where(test_data["Fare"] != 0,np.log(test_data["Fare"]),np.log(0.00001))
validation_data["Fare"] = np.where(validation_data["Fare"] != 0,np.log(validation_data["Fare"]),np.log(0.00001))<prepare_x_and_y>
def createSubmission(filename,coords,classes,test_directory = '.. /input/test/test/'):

 if coords.shape !=(225,2):
raise ValueError('coords must have shape(225,2)')
 if classes.shape !=(225,31):
raise ValueError('classes must have shape(225,31)')
 files = os.listdir(test_directory)
 with open(filename + '.csv','w')as f:
f.write('Nr,X,Y,' + ",".join(['C' + str(i)for i in range(0,31)])+'
')
 for n,coords,id_ in zip(classes,coords,files):
d = np.zeros(shape=(31,))
d[np.argmax(n[0])] = 1.0
class_ = str(d.tolist() ).replace('[','' ).replace(']','' ).replace(' ','')
 x_coords = coords[0]
y_coords = coords[1]
string = str(id_)+ ',' + str(x_coords)+ ',' + str(y_coords)+ ',' + str(class_)+ '
'
f.write(string)
X_train = train_data.drop(['PassengerId', 'Survived', 'Name', 'SibSp', 'Parch', 'Ticket'],axis=1)
 y_train = train_data[target]<prepare_x_and_y>
classes = np.random.rand(225,31)
 classes[classes >= 0.5] = 1.0
classes[classes != 1.0] = 0
createSubmission("submission.csv",np.random.rand(225,2),classes )