{"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        pass\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":"2022-12-28T11:20:48.350898Z","iopub.execute_input":"2022-12-28T11:20:48.351772Z","iopub.status.idle":"2022-12-28T11:21:43.623416Z","shell.execute_reply.started":"2022-12-28T11:20:48.351693Z","shell.execute_reply":"2022-12-28T11:21:43.622435Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"%load_ext autoreload\n%autoreload 2","metadata":{"execution":{"iopub.status.busy":"2022-12-28T11:21:43.625167Z","iopub.execute_input":"2022-12-28T11:21:43.625544Z","iopub.status.idle":"2022-12-28T11:21:43.663269Z","shell.execute_reply.started":"2022-12-28T11:21:43.625509Z","shell.execute_reply":"2022-12-28T11:21:43.66229Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import pandas as pd\nimport numpy as np\nfrom pathlib import Path","metadata":{"execution":{"iopub.status.busy":"2022-12-28T11:21:47.171953Z","iopub.execute_input":"2022-12-28T11:21:47.172326Z","iopub.status.idle":"2022-12-28T11:21:47.201526Z","shell.execute_reply.started":"2022-12-28T11:21:47.172294Z","shell.execute_reply":"2022-12-28T11:21:47.200488Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# !pip install timm","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# !pip install -Uq fastai\n ","metadata":{"execution":{"iopub.status.busy":"2022-12-28T11:21:50.285089Z","iopub.execute_input":"2022-12-28T11:21:50.285471Z","iopub.status.idle":"2022-12-28T11:21:50.315276Z","shell.execute_reply.started":"2022-12-28T11:21:50.28544Z","shell.execute_reply":"2022-12-28T11:21:50.314105Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from pathlib import Path\nfrom fastai.vision.all import *","metadata":{"execution":{"iopub.status.busy":"2022-12-28T11:21:55.068533Z","iopub.execute_input":"2022-12-28T11:21:55.069196Z","iopub.status.idle":"2022-12-28T11:21:57.772693Z","shell.execute_reply.started":"2022-12-28T11:21:55.069161Z","shell.execute_reply":"2022-12-28T11:21:57.771698Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# import os\n\n# pathList=[]\n# root = '/kaggle/input/rsna-breast-cancer-detection/test_images/'\n# for rootdir, dirs, files in os.walk(root):\n#     for file in files:\n#         pathList.append(Path(rootdir+'/'+file))","metadata":{"execution":{"iopub.status.busy":"2022-12-28T12:04:42.964108Z","iopub.execute_input":"2022-12-28T12:04:42.965032Z","iopub.status.idle":"2022-12-28T12:04:43.007387Z","shell.execute_reply.started":"2022-12-28T12:04:42.964994Z","shell.execute_reply":"2022-12-28T12:04:43.006453Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# fn=np.array(pathList)","metadata":{"execution":{"iopub.status.busy":"2022-12-28T12:04:48.564005Z","iopub.execute_input":"2022-12-28T12:04:48.564402Z","iopub.status.idle":"2022-12-28T12:04:48.604759Z","shell.execute_reply.started":"2022-12-28T12:04:48.564368Z","shell.execute_reply":"2022-12-28T12:04:48.603757Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# fn_id = [ i.stem.split('_')[0] for i in fn]\n# fn_id","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_csv=pd.read_csv('/kaggle/input/rsna-breast-cancer-detection/test.csv')","metadata":{"execution":{"iopub.status.busy":"2022-12-28T12:19:33.925834Z","iopub.execute_input":"2022-12-28T12:19:33.926197Z","iopub.status.idle":"2022-12-28T12:19:33.973447Z","shell.execute_reply.started":"2022-12-28T12:19:33.926166Z","shell.execute_reply":"2022-12-28T12:19:33.972392Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# learn.save(r'/kaggle/working/learner_first')","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_csv['canc']=np.random.rand(test_csv.shape[0])\npred = test","metadata":{"execution":{"iopub.status.busy":"2022-12-28T12:17:48.995589Z","iopub.execute_input":"2022-12-28T12:17:48.995941Z","iopub.status.idle":"2022-12-28T12:17:49.036681Z","shell.execute_reply.started":"2022-12-28T12:17:48.995911Z","shell.execute_reply":"2022-12-28T12:17:49.035572Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df= test_csv[['prediction_id','canc']].groupby('prediction_id').max().reset_index()","metadata":{"execution":{"iopub.status.busy":"2022-12-28T12:18:33.046116Z","iopub.execute_input":"2022-12-28T12:18:33.046863Z","iopub.status.idle":"2022-12-28T12:18:33.095132Z","shell.execute_reply.started":"2022-12-28T12:18:33.046825Z","shell.execute_reply":"2022-12-28T12:18:33.094005Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.to_csv('submission.csv', index=False)","metadata":{"execution":{"iopub.status.busy":"2022-12-28T12:18:51.886741Z","iopub.execute_input":"2022-12-28T12:18:51.887093Z","iopub.status.idle":"2022-12-28T12:18:51.92964Z","shell.execute_reply.started":"2022-12-28T12:18:51.887063Z","shell.execute_reply":"2022-12-28T12:18:51.928678Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}