Kaggle competition: House Prices - Advanced Regression Techniques
<SOS> metric: rmsle Kaggle data source: house-prices-advanced-regression-techniques<train_model>
import pandas as pd
from tqdm import tqdm
model_1.fit(X_train, y_train,
batch_size=BATCH_SIZE, epochs=N_EPOCHS,
validation_split=0.2, callbacks=[es_callback] )<save_to_csv>
train = pd.read_csv('.. /input/ames-housing-dataset/AmesHousing.csv')
 train.drop(['PID'], axis=1, inplace=True)
 origin = pd.read_csv('.. /input/house-prices-advanced-regression-techniques/train.csv')
 train.columns = origin.columns
test = pd.read_csv('.. /input/house-prices-advanced-regression-techniques/test.csv')
 submission = pd.read_csv('.. /input/house-prices-advanced-regression-techniques/sample_submission.csv')
 print('Train:{} Test:{}'.format(train.shape,test.shape))
y_pred_1 = model_1.predict(X_test)
 submission_1 = pd.DataFrame({'Id': test_ids, 'Expected': y_pred_1.reshape(-1)})
 submission_1.to_csv('submission_1.csv', index=False )<choose_model_class>
missing = test.isnull().sum()
missing = missing[missing>0]
train.drop(missing.index, axis=1, inplace=True)
 train.drop(['Electrical'], axis=1, inplace=True)
 test.dropna(axis=1, inplace=True)
 test.drop(['Electrical'], axis=1, inplace=True )
def get_model_bilstm(shape=(19,22)) :
inp = Input(shape)
 x = Bidirectional(CuDNNLSTM(64, return_sequences=True))(inp)
 x = TimeDistributed(Dense(10))(x)
 x = Flatten()(x)
 x = Dense(1 )(x)
 model = Model(inp, x)
 return model<train_model>
l_test = tqdm(range(0, len(test)) , desc='Matching')
 for i in l_test:
for j in range(0, len(train)) :
for k in range(1, len(test.columns)) :
if test.iloc[i,k] == train.iloc[j,k]:
continue
else:
break
else:
submission.iloc[i, 1] = train.iloc[j, -1]
break
l_test.close()
model_2.fit(X_train, y_train,
batch_size=BATCH_SIZE, epochs=N_EPOCHS,
validation_split=0.2, callbacks=[es_callback] )<save_to_csv>
submission.to_csv('submission.csv', index=False )
<choose_model_class><EOS> 
submission.to_csv('submission.csv', index=False )