{"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":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-10-04T17:57:24.764742Z","iopub.execute_input":"2022-10-04T17:57:24.765652Z","iopub.status.idle":"2022-10-04T17:57:24.798180Z","shell.execute_reply.started":"2022-10-04T17:57:24.765506Z","shell.execute_reply":"2022-10-04T17:57:24.796854Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_data = pd.read_csv('/kaggle/input/tabular-playground-series-oct-2022/test.csv')","metadata":{"execution":{"iopub.status.busy":"2022-10-04T18:43:23.716763Z","iopub.execute_input":"2022-10-04T18:43:23.717305Z","iopub.status.idle":"2022-10-04T18:43:36.072604Z","shell.execute_reply.started":"2022-10-04T18:43:23.717257Z","shell.execute_reply":"2022-10-04T18:43:36.071370Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Guessing All 0's","metadata":{}},{"cell_type":"code","source":"guess_zeros = pd.read_csv('/kaggle/input/tabular-playground-series-oct-2022/sample_submission.csv')\nguess_zeros","metadata":{"execution":{"iopub.status.busy":"2022-10-04T18:00:13.666572Z","iopub.execute_input":"2022-10-04T18:00:13.667112Z","iopub.status.idle":"2022-10-04T18:00:13.816928Z","shell.execute_reply.started":"2022-10-04T18:00:13.667071Z","shell.execute_reply":"2022-10-04T18:00:13.815700Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"guess_zeros['team_A_scoring_within_10sec'] = [0 for i in guess_zeros['team_A_scoring_within_10sec']]\nguess_zeros['team_B_scoring_within_10sec'] = [0 for j in guess_zeros['team_B_scoring_within_10sec']]\nguess_zeros","metadata":{"execution":{"iopub.status.busy":"2022-10-04T18:04:25.087162Z","iopub.execute_input":"2022-10-04T18:04:25.087718Z","iopub.status.idle":"2022-10-04T18:04:25.614187Z","shell.execute_reply.started":"2022-10-04T18:04:25.087674Z","shell.execute_reply":"2022-10-04T18:04:25.612955Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"output = pd.DataFrame({'Id': test_data.id,\n                       'team_A_scoring_within_10sec': guess_zeros['team_A_scoring_within_10sec'],\n                       'team_B_scoring_within_10sec': guess_zeros['team_B_scoring_within_10sec']})\noutput.to_csv('submission_zeroes.csv', index=False)","metadata":{"execution":{"iopub.status.busy":"2022-10-04T18:53:44.833443Z","iopub.execute_input":"2022-10-04T18:53:44.833983Z","iopub.status.idle":"2022-10-04T18:53:45.585662Z","shell.execute_reply.started":"2022-10-04T18:53:44.833939Z","shell.execute_reply":"2022-10-04T18:53:45.584387Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Guessing All 1's","metadata":{}},{"cell_type":"code","source":"guess_ones = pd.read_csv('/kaggle/input/tabular-playground-series-oct-2022/sample_submission.csv')\nguess_ones","metadata":{"execution":{"iopub.status.busy":"2022-10-04T18:08:54.374497Z","iopub.execute_input":"2022-10-04T18:08:54.375799Z","iopub.status.idle":"2022-10-04T18:08:54.518421Z","shell.execute_reply.started":"2022-10-04T18:08:54.375738Z","shell.execute_reply":"2022-10-04T18:08:54.517298Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"guess_ones['team_A_scoring_within_10sec'] = 1\nguess_ones['team_B_scoring_within_10sec'] = 1\nguess_ones","metadata":{"execution":{"iopub.status.busy":"2022-10-04T18:09:56.422140Z","iopub.execute_input":"2022-10-04T18:09:56.422622Z","iopub.status.idle":"2022-10-04T18:09:56.441027Z","shell.execute_reply.started":"2022-10-04T18:09:56.422582Z","shell.execute_reply":"2022-10-04T18:09:56.439806Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"output = pd.DataFrame({'Id': test_data.id,\n                       'team_A_scoring_within_10sec': guess_ones['team_A_scoring_within_10sec'],\n                       'team_B_scoring_within_10sec': guess_ones['team_B_scoring_within_10sec']})\noutput.to_csv('submission_ones.csv', index=False)","metadata":{"execution":{"iopub.status.busy":"2022-10-04T18:55:39.690319Z","iopub.execute_input":"2022-10-04T18:55:39.691771Z","iopub.status.idle":"2022-10-04T18:55:40.395851Z","shell.execute_reply.started":"2022-10-04T18:55:39.691717Z","shell.execute_reply":"2022-10-04T18:55:40.394713Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Guessing Each Target Column as All of Their Means","metadata":{}},{"cell_type":"code","source":"for i in [0,1,2,3,4,5,6,7,8,9]:\n    if i == 0:\n        train_total = pd.read_csv(f'/kaggle/input/tabular-playground-series-oct-2022/train_{i}.csv')\n    else:\n        train_part = pd.read_csv(f'/kaggle/input/tabular-playground-series-oct-2022/train_{i}.csv')\n        train_data_combined = pd.concat([train_total,train_part])","metadata":{"execution":{"iopub.status.busy":"2022-10-04T18:27:25.830003Z","iopub.execute_input":"2022-10-04T18:27:25.830529Z","iopub.status.idle":"2022-10-04T18:33:55.379299Z","shell.execute_reply.started":"2022-10-04T18:27:25.830455Z","shell.execute_reply":"2022-10-04T18:33:55.377374Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(train_data_combined.shape)\ntrain_data_combined[['team_A_scoring_within_10sec','team_B_scoring_within_10sec']].mean()","metadata":{"execution":{"iopub.status.busy":"2022-10-04T18:37:16.770495Z","iopub.execute_input":"2022-10-04T18:37:16.771569Z","iopub.status.idle":"2022-10-04T18:37:17.061410Z","shell.execute_reply.started":"2022-10-04T18:37:16.771518Z","shell.execute_reply":"2022-10-04T18:37:17.059923Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"guess_mean = pd.read_csv('/kaggle/input/tabular-playground-series-oct-2022/sample_submission.csv')\nguess_mean['team_A_scoring_within_10sec'] = train_data_combined['team_A_scoring_within_10sec'].mean()\nguess_mean['team_B_scoring_within_10sec'] = train_data_combined['team_B_scoring_within_10sec'].mean()\nguess_mean","metadata":{"execution":{"iopub.status.busy":"2022-10-04T18:40:20.404834Z","iopub.execute_input":"2022-10-04T18:40:20.405414Z","iopub.status.idle":"2022-10-04T18:40:20.630779Z","shell.execute_reply.started":"2022-10-04T18:40:20.405370Z","shell.execute_reply":"2022-10-04T18:40:20.629516Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"output = pd.DataFrame({'Id': test_data.id,\n                       'team_A_scoring_within_10sec': guess_mean['team_A_scoring_within_10sec'],\n                       'team_B_scoring_within_10sec': guess_mean['team_B_scoring_within_10sec']})\noutput.to_csv('submission_mean.csv', index=False)","metadata":{"execution":{"iopub.status.busy":"2022-10-04T18:56:50.215489Z","iopub.execute_input":"2022-10-04T18:56:50.216039Z","iopub.status.idle":"2022-10-04T18:56:51.874366Z","shell.execute_reply.started":"2022-10-04T18:56:50.215995Z","shell.execute_reply":"2022-10-04T18:56:51.872962Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}