{"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":"markdown","source":"## About this notebook\n* skf path from https://www.kaggle.com/vincentwang25/g2net-skf","metadata":{}},{"cell_type":"markdown","source":"## Install Dependencies","metadata":{}},{"cell_type":"code","source":"import os\nimport math\nimport random\nimport re\nimport warnings\nfrom pathlib import Path\nfrom typing import Optional, Tuple\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport seaborn as sns\nimport tensorflow as tf\nimport tensorflow_addons as tfa\nfrom kaggle_datasets import KaggleDatasets\nfrom scipy.signal import get_window\nfrom sklearn.model_selection import KFold\nfrom sklearn.metrics import roc_auc_score","metadata":{"execution":{"iopub.status.busy":"2021-09-23T11:36:44.539096Z","iopub.execute_input":"2021-09-23T11:36:44.539729Z","iopub.status.idle":"2021-09-23T11:36:51.49596Z","shell.execute_reply.started":"2021-09-23T11:36:44.539639Z","shell.execute_reply":"2021-09-23T11:36:51.494645Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"tf.__version__","metadata":{"execution":{"iopub.status.busy":"2021-09-23T11:36:51.497695Z","iopub.execute_input":"2021-09-23T11:36:51.49814Z","iopub.status.idle":"2021-09-23T11:36:51.507304Z","shell.execute_reply.started":"2021-09-23T11:36:51.498084Z","shell.execute_reply":"2021-09-23T11:36:51.506208Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Config","metadata":{}},{"cell_type":"code","source":"SAVEDIR = Path(\"models\")\nSAVEDIR.mkdir(exist_ok=True)\n\nOOFDIR = Path(\"oof\")\nOOFDIR.mkdir(exist_ok=True)","metadata":{"execution":{"iopub.status.busy":"2021-09-23T11:36:51.509545Z","iopub.execute_input":"2021-09-23T11:36:51.509952Z","iopub.status.idle":"2021-09-23T11:36:51.516927Z","shell.execute_reply.started":"2021-09-23T11:36:51.50991Z","shell.execute_reply":"2021-09-23T11:36:51.516215Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Data Loading","metadata":{}},{"cell_type":"code","source":"gcs_paths = []\nGCS_path = KaggleDatasets().get_gcs_path(f\"g2net-skf\")\ngcs_paths.append(GCS_path)\nprint(GCS_path)","metadata":{"execution":{"iopub.status.busy":"2021-09-23T11:36:51.517946Z","iopub.execute_input":"2021-09-23T11:36:51.518344Z","iopub.status.idle":"2021-09-23T11:37:57.425388Z","shell.execute_reply.started":"2021-09-23T11:36:51.518316Z","shell.execute_reply":"2021-09-23T11:37:57.424251Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"all_files = []\nfor path in gcs_paths:\n    all_files.extend(np.sort(np.array(tf.io.gfile.glob(path + \"/train*.tfrecords\"))))\n\nprint(\"train_files: \", len(all_files))","metadata":{"execution":{"iopub.status.busy":"2021-09-23T11:37:57.42668Z","iopub.execute_input":"2021-09-23T11:37:57.426983Z","iopub.status.idle":"2021-09-23T11:37:58.082994Z","shell.execute_reply.started":"2021-09-23T11:37:57.426953Z","shell.execute_reply":"2021-09-23T11:37:58.081806Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}