Kaggle competition: DSI-US-8 Project 2 Regression Challenge
del source_data, train_x
gc.collect()
submit_data = load_csv('.. /input/test_V2.csv')
 optimize_data(submit_data)
 submit_data_x, _ = prepare_data(submit_data, scaler)
 submit_data['winPlacePercPred'] = model.predict(submit_data_x, batch_size=batch_size)
 submit_data['winPlacePercPred'] = np.clip(submit_data['winPlacePercPred'], a_min=0, a_max=1)
 results = submit_data.groupby(['matchId', 'groupId'])['winPlacePercPred'].mean().groupby('matchId' ).rank(pct=True ).reset_index()
results.columns = ['matchId','groupId', y_label]
submit_data = submit_data.merge(results, how='left', on=['matchId','groupId'])
 submission = submit_data[['Id', y_label]]
submission['Id'] = submission['Id'].map(lambda x: int_to_str_dict[x])
 display(submission.head())
 submission.to_csv('./submission.csv', index=False )<set_options>
train_df = pd.read_csv('.. /input/train.csv')
 test_df = pd.read_csv('.. /input/test.csv' )
pd.options.mode.chained_assignment = None
pd.options.display.max_columns = 999
init_notebook_mode(connected=True)
 color = sns.color_palette()
%matplotlib inline<load_from_csv>
submission_pd = pd.DataFrame(test_df.Id )
train_raw = pd.read_csv('.. /input/train_V2.csv')
 test_raw = pd.read_csv('.. /input/test_V2.csv' )<count_missing_values>
submission_pd['SalePrice'] = ybar
train_raw.isnull().sum()<count_missing_values>
submission_pd.to_csv('submission0.csv' )
<define_variables><EOS> 
submission_pd.to_csv('submission.csv', index=False )