Kaggle competition: House Prices - Advanced Regression Techniques
<SOS> metric: rmsle Kaggle data source: house-prices-advanced-regression-techniques<feature_engineering>
import pandas as pd
from tqdm import tqdm
test['Fare'] = test['Fare'].fillna(7.75 )<categorify>
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))
get_initials(test,'Name')
 test['Name'] = le.fit_transform(test['Name'])
 test['Sex'] = le.fit_transform(test['Sex'])
 test.head()<feature_engineering>
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 )
test = sc.fit_transform(test )<save_to_csv>
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()
prediction = classifier_knn.predict(test)
 submission = pd.DataFrame({'PassengerId':passenger_id,'Survived':prediction})
 submission.to_csv('TITANIC_SUBMISSION.csv',index = False)
 submission<set_options>
submission.to_csv('result-with-best.csv', index=False )