{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.14","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"nvidiaTeslaT4","dataSources":[{"sourceId":82611,"databundleVersionId":9553358,"sourceType":"competition"}],"dockerImageVersionId":30786,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":true}},"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":"2024-10-06T09:58:42.611379Z","iopub.execute_input":"2024-10-06T09:58:42.611847Z","iopub.status.idle":"2024-10-06T09:58:43.911254Z","shell.execute_reply.started":"2024-10-06T09:58:42.611802Z","shell.execute_reply":"2024-10-06T09:58:43.910025Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train = pd.read_csv('/kaggle/input/brist1d/train.csv')\ntrain.head()","metadata":{"execution":{"iopub.status.busy":"2024-10-06T09:59:16.075636Z","iopub.execute_input":"2024-10-06T09:59:16.076059Z","iopub.status.idle":"2024-10-06T09:59:31.954204Z","shell.execute_reply.started":"2024-10-06T09:59:16.076017Z","shell.execute_reply":"2024-10-06T09:59:31.952905Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train.info()","metadata":{"execution":{"iopub.status.busy":"2024-10-06T10:00:54.731701Z","iopub.execute_input":"2024-10-06T10:00:54.732706Z","iopub.status.idle":"2024-10-06T10:00:54.784958Z","shell.execute_reply.started":"2024-10-06T10:00:54.732648Z","shell.execute_reply":"2024-10-06T10:00:54.783567Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train.isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-10-06T10:01:31.307551Z","iopub.execute_input":"2024-10-06T10:01:31.308059Z","iopub.status.idle":"2024-10-06T10:01:32.040076Z","shell.execute_reply.started":"2024-10-06T10:01:31.308015Z","shell.execute_reply":"2024-10-06T10:01:32.038550Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test = pd.read_csv('/kaggle/input/brist1d/test.csv')\ntest.head()","metadata":{"execution":{"iopub.status.busy":"2024-10-06T10:02:26.139580Z","iopub.execute_input":"2024-10-06T10:02:26.140054Z","iopub.status.idle":"2024-10-06T10:02:26.487984Z","shell.execute_reply.started":"2024-10-06T10:02:26.140009Z","shell.execute_reply":"2024-10-06T10:02:26.486418Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test.info()","metadata":{"execution":{"iopub.status.busy":"2024-10-06T10:02:37.887656Z","iopub.execute_input":"2024-10-06T10:02:37.888807Z","iopub.status.idle":"2024-10-06T10:02:37.925727Z","shell.execute_reply.started":"2024-10-06T10:02:37.888736Z","shell.execute_reply":"2024-10-06T10:02:37.924355Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!pip install ray==2.10.0\n!pip install autogluon.tabular\n!pip install -U ipywidgets","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from autogluon.tabular import TabularDataset, TabularPredictor","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import pandas as pd\nfrom autogluon.tabular import TabularPredictor\n\npredictor = TabularPredictor(\n    label='bg+1:00',  # Target column\n    eval_metric='rmse',  \n    problem_type='regression'  \n).fit(\n    train_data=train,  \n    presets='best_quality', \n    time_limit=int(3600*6), \n    verbosity=2,\n    excluded_model_types=['KNN']\n)\n\nresults = predictor.fit_summary()","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"predictor.leaderboard()","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"y_pred = predictor.predict(test)","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub = pd.read_csv('/kaggle/input/brist1d/sample_submission.csv')\nsub['bg+1:00'] = y_pred\nsub.to_csv('submission.csv', index=False)\nprint(sub.head())","metadata":{},"execution_count":null,"outputs":[]}]}