{"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":"2023-01-25T16:44:01.034773Z","iopub.execute_input":"2023-01-25T16:44:01.035336Z","iopub.status.idle":"2023-01-25T16:44:01.272674Z","shell.execute_reply.started":"2023-01-25T16:44:01.035236Z","shell.execute_reply":"2023-01-25T16:44:01.271512Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"tests = pd.read_parquet('/kaggle/input/icecube-neutrinos-in-deep-ice/test_meta.parquet')","metadata":{"execution":{"iopub.status.busy":"2023-01-25T16:44:01.275030Z","iopub.execute_input":"2023-01-25T16:44:01.275730Z","iopub.status.idle":"2023-01-25T16:44:01.411914Z","shell.execute_reply.started":"2023-01-25T16:44:01.275687Z","shell.execute_reply":"2023-01-25T16:44:01.411096Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"tests","metadata":{"execution":{"iopub.status.busy":"2023-01-25T16:44:01.413194Z","iopub.execute_input":"2023-01-25T16:44:01.413766Z","iopub.status.idle":"2023-01-25T16:44:01.430824Z","shell.execute_reply.started":"2023-01-25T16:44:01.413731Z","shell.execute_reply":"2023-01-25T16:44:01.430070Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train=pd.read_parquet(\"/kaggle/input/icecube-neutrinos-in-deep-ice/train_meta.parquet\")","metadata":{"execution":{"iopub.status.busy":"2023-01-25T16:44:01.434324Z","iopub.execute_input":"2023-01-25T16:44:01.435213Z","iopub.status.idle":"2023-01-25T16:44:48.257684Z","shell.execute_reply.started":"2023-01-25T16:44:01.435175Z","shell.execute_reply":"2023-01-25T16:44:48.254729Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train","metadata":{"execution":{"iopub.status.busy":"2023-01-25T16:44:48.263774Z","iopub.execute_input":"2023-01-25T16:44:48.265474Z","iopub.status.idle":"2023-01-25T16:44:48.340593Z","shell.execute_reply.started":"2023-01-25T16:44:48.265425Z","shell.execute_reply":"2023-01-25T16:44:48.336232Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"tests.info()","metadata":{"execution":{"iopub.status.busy":"2023-01-25T16:44:48.345644Z","iopub.execute_input":"2023-01-25T16:44:48.354242Z","iopub.status.idle":"2023-01-25T16:44:48.407038Z","shell.execute_reply.started":"2023-01-25T16:44:48.353882Z","shell.execute_reply":"2023-01-25T16:44:48.404429Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train.info()","metadata":{"execution":{"iopub.status.busy":"2023-01-25T16:44:48.411585Z","iopub.execute_input":"2023-01-25T16:44:48.413356Z","iopub.status.idle":"2023-01-25T16:44:48.461717Z","shell.execute_reply.started":"2023-01-25T16:44:48.413159Z","shell.execute_reply":"2023-01-25T16:44:48.458376Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sample=pd.read_parquet('/kaggle/input/icecube-neutrinos-in-deep-ice/sample_submission.parquet')","metadata":{"execution":{"iopub.status.busy":"2023-01-25T16:44:48.467567Z","iopub.execute_input":"2023-01-25T16:44:48.470088Z","iopub.status.idle":"2023-01-25T16:44:48.532442Z","shell.execute_reply.started":"2023-01-25T16:44:48.470005Z","shell.execute_reply":"2023-01-25T16:44:48.523495Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sample.head()","metadata":{"execution":{"iopub.status.busy":"2023-01-25T16:44:48.538911Z","iopub.execute_input":"2023-01-25T16:44:48.543249Z","iopub.status.idle":"2023-01-25T16:44:48.587991Z","shell.execute_reply.started":"2023-01-25T16:44:48.542849Z","shell.execute_reply":"2023-01-25T16:44:48.586068Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train.isna().sum()","metadata":{"execution":{"iopub.status.busy":"2023-01-25T16:44:48.602814Z","iopub.execute_input":"2023-01-25T16:44:48.604532Z","iopub.status.idle":"2023-01-25T16:44:50.681030Z","shell.execute_reply.started":"2023-01-25T16:44:48.604471Z","shell.execute_reply":"2023-01-25T16:44:50.675849Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"tests.isna().sum()","metadata":{"execution":{"iopub.status.busy":"2023-01-25T16:44:50.686212Z","iopub.execute_input":"2023-01-25T16:44:50.686581Z","iopub.status.idle":"2023-01-25T16:44:50.712502Z","shell.execute_reply.started":"2023-01-25T16:44:50.686548Z","shell.execute_reply":"2023-01-25T16:44:50.707558Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"features=['batch_id','event_id','first_pulse_index','last_pulse_index']","metadata":{"execution":{"iopub.status.busy":"2023-01-25T16:44:50.720958Z","iopub.execute_input":"2023-01-25T16:44:50.723686Z","iopub.status.idle":"2023-01-25T16:44:50.739653Z","shell.execute_reply.started":"2023-01-25T16:44:50.723643Z","shell.execute_reply":"2023-01-25T16:44:50.735293Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"target=['azimuth','zenith']","metadata":{"execution":{"iopub.status.busy":"2023-01-25T16:44:50.746661Z","iopub.execute_input":"2023-01-25T16:44:50.747804Z","iopub.status.idle":"2023-01-25T16:44:50.765569Z","shell.execute_reply.started":"2023-01-25T16:44:50.747757Z","shell.execute_reply":"2023-01-25T16:44:50.762379Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X=train[features]\ny=train[target]","metadata":{"execution":{"iopub.status.busy":"2023-01-25T16:44:50.769334Z","iopub.execute_input":"2023-01-25T16:44:50.770637Z","iopub.status.idle":"2023-01-25T16:45:02.688831Z","shell.execute_reply.started":"2023-01-25T16:44:50.770422Z","shell.execute_reply":"2023-01-25T16:45:02.685609Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.model_selection import train_test_split\nX_train,X_test,y_train,y_test=train_test_split(X,y,test_size=0.20,random_state=0)\nfrom sklearn.linear_model import LinearRegression","metadata":{"execution":{"iopub.status.busy":"2023-01-25T16:45:02.692527Z","iopub.execute_input":"2023-01-25T16:45:02.693175Z","iopub.status.idle":"2023-01-25T16:45:50.936691Z","shell.execute_reply.started":"2023-01-25T16:45:02.693118Z","shell.execute_reply":"2023-01-25T16:45:50.935392Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"lr=LinearRegression()\nmodel=lr.fit(X_train,y_train)\npredict=model.predict(X_test)","metadata":{"execution":{"iopub.status.busy":"2023-01-25T16:45:50.938417Z","iopub.execute_input":"2023-01-25T16:45:50.938982Z","iopub.status.idle":"2023-01-25T16:46:22.563796Z","shell.execute_reply.started":"2023-01-25T16:45:50.938946Z","shell.execute_reply":"2023-01-25T16:46:22.562508Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"y_predict=model.predict(tests)","metadata":{"execution":{"iopub.status.busy":"2023-01-25T16:46:22.567023Z","iopub.execute_input":"2023-01-25T16:46:22.567718Z","iopub.status.idle":"2023-01-25T16:46:22.575361Z","shell.execute_reply.started":"2023-01-25T16:46:22.567679Z","shell.execute_reply":"2023-01-25T16:46:22.574012Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sample","metadata":{"execution":{"iopub.status.busy":"2023-01-25T16:46:22.577121Z","iopub.execute_input":"2023-01-25T16:46:22.577611Z","iopub.status.idle":"2023-01-25T16:46:22.604567Z","shell.execute_reply.started":"2023-01-25T16:46:22.577567Z","shell.execute_reply":"2023-01-25T16:46:22.603444Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\nsample['azimuth'] = train['azimuth'].mean()\nsample['zenith'] = train['zenith'].mean()\nsample.to_csv('submission.csv', index=False)","metadata":{"execution":{"iopub.status.busy":"2023-01-25T16:46:22.605815Z","iopub.execute_input":"2023-01-25T16:46:22.606194Z","iopub.status.idle":"2023-01-25T16:46:23.577055Z","shell.execute_reply.started":"2023-01-25T16:46:22.606163Z","shell.execute_reply":"2023-01-25T16:46:23.575877Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sample","metadata":{"execution":{"iopub.status.busy":"2023-01-25T16:46:23.578399Z","iopub.execute_input":"2023-01-25T16:46:23.578733Z","iopub.status.idle":"2023-01-25T16:46:23.591566Z","shell.execute_reply.started":"2023-01-25T16:46:23.578704Z","shell.execute_reply":"2023-01-25T16:46:23.590419Z"},"trusted":true},"execution_count":null,"outputs":[]}]}