{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import numpy as np\nimport pandas as pd","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-08-01T10:19:46.648219Z","iopub.execute_input":"2022-08-01T10:19:46.648955Z","iopub.status.idle":"2022-08-01T10:19:46.680062Z","shell.execute_reply.started":"2022-08-01T10:19:46.648818Z","shell.execute_reply":"2022-08-01T10:19:46.679091Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df = pd.read_csv('../input/digital-turbine-auction-bid-price-prediction/train_data.csv')","metadata":{"execution":{"iopub.status.busy":"2022-08-01T10:21:06.981476Z","iopub.execute_input":"2022-08-01T10:21:06.981904Z","iopub.status.idle":"2022-08-01T10:21:41.402194Z","shell.execute_reply.started":"2022-08-01T10:21:06.981859Z","shell.execute_reply":"2022-08-01T10:21:41.400913Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df.head()","metadata":{"execution":{"iopub.status.busy":"2022-08-01T10:21:42.107661Z","iopub.execute_input":"2022-08-01T10:21:42.108029Z","iopub.status.idle":"2022-08-01T10:21:42.145739Z","shell.execute_reply.started":"2022-08-01T10:21:42.107995Z","shell.execute_reply":"2022-08-01T10:21:42.144309Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"avg_target = train_df['winBid'].mean()\nprint(f'Average winning bid: {avg_target}')","metadata":{"execution":{"iopub.status.busy":"2022-08-01T10:22:23.338876Z","iopub.execute_input":"2022-08-01T10:22:23.339748Z","iopub.status.idle":"2022-08-01T10:22:23.372663Z","shell.execute_reply.started":"2022-08-01T10:22:23.339667Z","shell.execute_reply":"2022-08-01T10:22:23.371470Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.metrics import mean_squared_error","metadata":{"execution":{"iopub.status.busy":"2022-08-01T10:23:56.667027Z","iopub.execute_input":"2022-08-01T10:23:56.667601Z","iopub.status.idle":"2022-08-01T10:23:56.672997Z","shell.execute_reply.started":"2022-08-01T10:23:56.667548Z","shell.execute_reply":"2022-08-01T10:23:56.671768Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"%%time\nrmse_on_train = mean_squared_error(train_df['winBid'].values, np.repeat(avg_target, train_df.shape[0])) ** 0.5\nprint('RMSE calculated on train set (with leak): ', rmse_on_train)","metadata":{"execution":{"iopub.status.busy":"2022-08-01T10:28:31.413253Z","iopub.execute_input":"2022-08-01T10:28:31.413698Z","iopub.status.idle":"2022-08-01T10:28:31.489393Z","shell.execute_reply.started":"2022-08-01T10:28:31.413662Z","shell.execute_reply":"2022-08-01T10:28:31.488139Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub = pd.read_csv('../input/digital-turbine-auction-bid-price-prediction/sample_submission.csv')\nsub.head()","metadata":{"execution":{"iopub.status.busy":"2022-08-01T10:28:45.410396Z","iopub.execute_input":"2022-08-01T10:28:45.410875Z","iopub.status.idle":"2022-08-01T10:28:45.455507Z","shell.execute_reply.started":"2022-08-01T10:28:45.410837Z","shell.execute_reply":"2022-08-01T10:28:45.453963Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub['winBid'] = avg_target","metadata":{"execution":{"iopub.status.busy":"2022-08-01T10:28:49.070194Z","iopub.execute_input":"2022-08-01T10:28:49.070629Z","iopub.status.idle":"2022-08-01T10:28:49.079808Z","shell.execute_reply.started":"2022-08-01T10:28:49.070596Z","shell.execute_reply":"2022-08-01T10:28:49.078575Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub.to_csv('avg_in_train.csv', index = False)","metadata":{"execution":{"iopub.status.busy":"2022-08-01T10:29:09.216671Z","iopub.execute_input":"2022-08-01T10:29:09.217072Z","iopub.status.idle":"2022-08-01T10:29:09.388802Z","shell.execute_reply.started":"2022-08-01T10:29:09.217040Z","shell.execute_reply":"2022-08-01T10:29:09.387681Z"},"trusted":true},"execution_count":null,"outputs":[]}]}