{"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":"raw","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-08T17:40:40.314125Z","iopub.execute_input":"2023-01-08T17:40:40.314574Z","iopub.status.idle":"2023-01-08T17:40:40.344346Z","shell.execute_reply.started":"2023-01-08T17:40:40.314478Z","shell.execute_reply":"2023-01-08T17:40:40.343041Z"}}},{"cell_type":"code","source":"pd.read_csv(\"/kaggle/input/emsi-5iir-ds/test.csv\")","metadata":{"execution":{"iopub.status.busy":"2023-01-08T20:12:27.015463Z","iopub.execute_input":"2023-01-08T20:12:27.015839Z","iopub.status.idle":"2023-01-08T20:12:30.971081Z","shell.execute_reply.started":"2023-01-08T20:12:27.015809Z","shell.execute_reply":"2023-01-08T20:12:30.969757Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pd.read_csv(\"/kaggle/input/emsi-5iir-ds/train.csv\")","metadata":{"execution":{"iopub.status.busy":"2023-01-08T20:12:30.973686Z","iopub.execute_input":"2023-01-08T20:12:30.974161Z","iopub.status.idle":"2023-01-08T20:12:36.161862Z","shell.execute_reply.started":"2023-01-08T20:12:30.974115Z","shell.execute_reply":"2023-01-08T20:12:36.160516Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train = pd.read_csv(\"/kaggle/input/emsi-5iir-ds/train.csv\")","metadata":{"execution":{"iopub.status.busy":"2023-01-08T20:12:36.163571Z","iopub.execute_input":"2023-01-08T20:12:36.164043Z","iopub.status.idle":"2023-01-08T20:12:40.901049Z","shell.execute_reply.started":"2023-01-08T20:12:36.163995Z","shell.execute_reply":"2023-01-08T20:12:40.899845Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test = pd.read_csv(\"/kaggle/input/emsi-5iir-ds/test.csv\")","metadata":{"execution":{"iopub.status.busy":"2023-01-08T20:12:40.905874Z","iopub.execute_input":"2023-01-08T20:12:40.906234Z","iopub.status.idle":"2023-01-08T20:12:44.452614Z","shell.execute_reply.started":"2023-01-08T20:12:40.906204Z","shell.execute_reply":"2023-01-08T20:12:44.451495Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train.columns","metadata":{"execution":{"iopub.status.busy":"2023-01-08T20:12:44.453949Z","iopub.execute_input":"2023-01-08T20:12:44.454328Z","iopub.status.idle":"2023-01-08T20:12:44.463013Z","shell.execute_reply.started":"2023-01-08T20:12:44.454262Z","shell.execute_reply":"2023-01-08T20:12:44.461687Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train.target.plot.hist()","metadata":{"execution":{"iopub.status.busy":"2023-01-08T20:12:44.464144Z","iopub.execute_input":"2023-01-08T20:12:44.464482Z","iopub.status.idle":"2023-01-08T20:12:44.787243Z","shell.execute_reply.started":"2023-01-08T20:12:44.464452Z","shell.execute_reply":"2023-01-08T20:12:44.786118Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train.head()","metadata":{"execution":{"iopub.status.busy":"2023-01-08T20:12:44.788661Z","iopub.execute_input":"2023-01-08T20:12:44.789031Z","iopub.status.idle":"2023-01-08T20:12:44.815950Z","shell.execute_reply.started":"2023-01-08T20:12:44.788997Z","shell.execute_reply":"2023-01-08T20:12:44.814815Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test.head()","metadata":{"execution":{"iopub.status.busy":"2023-01-08T20:12:44.817224Z","iopub.execute_input":"2023-01-08T20:12:44.817587Z","iopub.status.idle":"2023-01-08T20:12:44.848177Z","shell.execute_reply.started":"2023-01-08T20:12:44.817554Z","shell.execute_reply":"2023-01-08T20:12:44.846953Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.linear_model import LogisticRegression, LinearRegression\n","metadata":{"execution":{"iopub.status.busy":"2023-01-08T20:12:44.850185Z","iopub.execute_input":"2023-01-08T20:12:44.851614Z","iopub.status.idle":"2023-01-08T20:12:44.859357Z","shell.execute_reply.started":"2023-01-08T20:12:44.851534Z","shell.execute_reply":"2023-01-08T20:12:44.858244Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"features = [\"f_00\",\"f_01\",\"f_02\",\"f_03\",\"f_04\",\"f_05\",\"f_06\",\"f_07\",\"f_08\",\"f_09\",\"f_10\",\"f_11\",\"f_12\",\"f_13\",\"f_14\",\"f_15\",\"f_16\",\"f_17\",\"f_18\",\"f_19\",\"f_20\",\"f_21\",\"f_22\",\"f_23\",\"f_24\",\"f_25\",\"f_26\",\"f_28\",\"f_29\",\"f_30\"]\nx_train = train[features]\nx_test = test[features]\ny_train = train[\"target\"]","metadata":{"execution":{"iopub.status.busy":"2023-01-08T20:12:44.865058Z","iopub.execute_input":"2023-01-08T20:12:44.865623Z","iopub.status.idle":"2023-01-08T20:12:44.996316Z","shell.execute_reply.started":"2023-01-08T20:12:44.865584Z","shell.execute_reply":"2023-01-08T20:12:44.994974Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"model = LinearRegression()\nmodel.fit(x_train, y_train)\npredictions = model.predict(x_test)","metadata":{"execution":{"iopub.status.busy":"2023-01-08T20:12:44.998306Z","iopub.execute_input":"2023-01-08T20:12:44.998718Z","iopub.status.idle":"2023-01-08T20:12:46.116013Z","shell.execute_reply.started":"2023-01-08T20:12:44.998684Z","shell.execute_reply":"2023-01-08T20:12:46.114060Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submission = test[[\"id\"]]\nsubmission","metadata":{"execution":{"iopub.status.busy":"2023-01-08T20:12:46.118255Z","iopub.execute_input":"2023-01-08T20:12:46.118845Z","iopub.status.idle":"2023-01-08T20:12:46.143836Z","shell.execute_reply.started":"2023-01-08T20:12:46.118790Z","shell.execute_reply":"2023-01-08T20:12:46.141869Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submission[\"target\"] = predictions","metadata":{"execution":{"iopub.status.busy":"2023-01-08T20:12:46.146425Z","iopub.execute_input":"2023-01-08T20:12:46.147231Z","iopub.status.idle":"2023-01-08T20:12:46.162136Z","shell.execute_reply.started":"2023-01-08T20:12:46.147160Z","shell.execute_reply":"2023-01-08T20:12:46.159850Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submission","metadata":{"execution":{"iopub.status.busy":"2023-01-08T20:12:46.164685Z","iopub.execute_input":"2023-01-08T20:12:46.165318Z","iopub.status.idle":"2023-01-08T20:12:46.202967Z","shell.execute_reply.started":"2023-01-08T20:12:46.165242Z","shell.execute_reply":"2023-01-08T20:12:46.201193Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submission.to_csv(\"submission.csv\",index=None)","metadata":{"execution":{"iopub.status.busy":"2023-01-08T20:12:46.205275Z","iopub.execute_input":"2023-01-08T20:12:46.206788Z","iopub.status.idle":"2023-01-08T20:12:47.875975Z","shell.execute_reply.started":"2023-01-08T20:12:46.206725Z","shell.execute_reply":"2023-01-08T20:12:47.874769Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pd.read_csv(\"submission.csv\")","metadata":{"execution":{"iopub.status.busy":"2023-01-08T20:12:47.877638Z","iopub.execute_input":"2023-01-08T20:12:47.879361Z","iopub.status.idle":"2023-01-08T20:12:48.058713Z","shell.execute_reply.started":"2023-01-08T20:12:47.879265Z","shell.execute_reply":"2023-01-08T20:12:48.057666Z"},"trusted":true},"execution_count":null,"outputs":[]}]}