{"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\n#for 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":"2021-08-14T02:15:01.450233Z","iopub.execute_input":"2021-08-14T02:15:01.451038Z","iopub.status.idle":"2021-08-14T02:15:01.464366Z","shell.execute_reply.started":"2021-08-14T02:15:01.450909Z","shell.execute_reply":"2021-08-14T02:15:01.462920Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\nimport matplotlib.pyplot as plt\n\n\n#TF stuff\nimport tensorflow as tf\nfrom tensorflow import keras\nfrom tensorflow.keras import layers\nfrom tensorflow.keras import regularizers\n\n#XGBoost\nfrom xgboost import XGBClassifier\n\n#Scikit\nfrom sklearn.metrics import log_loss\nfrom sklearn.multioutput import MultiOutputClassifier\nfrom sklearn.model_selection import KFold\nfrom sklearn.decomposition import PCA\nfrom sklearn.model_selection import RandomizedSearchCV\nfrom scipy.stats import uniform","metadata":{"execution":{"iopub.status.busy":"2021-08-14T02:15:03.848323Z","iopub.execute_input":"2021-08-14T02:15:03.848722Z","iopub.status.idle":"2021-08-14T02:15:11.280737Z","shell.execute_reply.started":"2021-08-14T02:15:03.848689Z","shell.execute_reply":"2021-08-14T02:15:11.280001Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"root_dir = '../input/rsna-miccai-brain-tumor-radiogenomic-classification/'\ntrain_targets = pd.read_csv(root_dir + 'train_labels.csv')\ny = train_targets['MGMT_value']\nprint(train_targets.head())","metadata":{"execution":{"iopub.status.busy":"2021-08-14T02:15:17.565096Z","iopub.execute_input":"2021-08-14T02:15:17.565731Z","iopub.status.idle":"2021-08-14T02:15:17.600042Z","shell.execute_reply.started":"2021-08-14T02:15:17.565695Z","shell.execute_reply":"2021-08-14T02:15:17.598799Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"y_mean = np.mean(y)\npreds = np.array([y_mean]*len(y))\n\nsample = pd.read_csv(root_dir + 'sample_submission.csv')\nsample.head()","metadata":{"execution":{"iopub.status.busy":"2021-08-14T02:15:19.207459Z","iopub.execute_input":"2021-08-14T02:15:19.207797Z","iopub.status.idle":"2021-08-14T02:15:19.231584Z","shell.execute_reply.started":"2021-08-14T02:15:19.207768Z","shell.execute_reply":"2021-08-14T02:15:19.230289Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\n\nnp.array([y_mean]*len(sample['BraTS21ID']))\nsubmission = pd.DataFrame({'BraTS21ID':sample['BraTS21ID'], 'MGMT_value':np.array([y_mean]*len(sample['BraTS21ID']))} )\n\nsubmission.to_csv('submission.csv', index=False)\nsubmission.head()","metadata":{"execution":{"iopub.status.busy":"2021-08-14T02:15:22.193320Z","iopub.execute_input":"2021-08-14T02:15:22.193725Z","iopub.status.idle":"2021-08-14T02:15:22.213481Z","shell.execute_reply.started":"2021-08-14T02:15:22.193692Z","shell.execute_reply":"2021-08-14T02:15:22.212331Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"execution":{"iopub.status.busy":"2021-08-13T06:33:15.293882Z","iopub.execute_input":"2021-08-13T06:33:15.294262Z","iopub.status.idle":"2021-08-13T06:33:15.310249Z","shell.execute_reply.started":"2021-08-13T06:33:15.29423Z","shell.execute_reply":"2021-08-13T06:33:15.309066Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"execution":{"iopub.status.busy":"2021-08-13T06:33:26.420234Z","iopub.execute_input":"2021-08-13T06:33:26.420604Z","iopub.status.idle":"2021-08-13T06:33:26.434875Z","shell.execute_reply.started":"2021-08-13T06:33:26.420574Z","shell.execute_reply":"2021-08-13T06:33:26.433676Z"},"trusted":true},"execution_count":null,"outputs":[]}]}