{"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":"import numpy as np\nimport pandas as pd","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2023-02-03T15:38:02.454873Z","iopub.execute_input":"2023-02-03T15:38:02.455371Z","iopub.status.idle":"2023-02-03T15:38:02.485767Z","shell.execute_reply.started":"2023-02-03T15:38:02.455277Z","shell.execute_reply":"2023-02-03T15:38:02.484652Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train = pd.read_csv(\"/kaggle/input/rsna-breast-cancer-detection/train.csv\")\ntrain","metadata":{"execution":{"iopub.status.busy":"2023-02-03T15:38:02.488331Z","iopub.execute_input":"2023-02-03T15:38:02.489184Z","iopub.status.idle":"2023-02-03T15:38:02.645824Z","shell.execute_reply.started":"2023-02-03T15:38:02.489114Z","shell.execute_reply":"2023-02-03T15:38:02.644783Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train.info()","metadata":{"execution":{"iopub.status.busy":"2023-02-03T15:38:02.647072Z","iopub.execute_input":"2023-02-03T15:38:02.647458Z","iopub.status.idle":"2023-02-03T15:38:02.681939Z","shell.execute_reply.started":"2023-02-03T15:38:02.647424Z","shell.execute_reply":"2023-02-03T15:38:02.680805Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train.describe()","metadata":{"jupyter":{"source_hidden":true},"execution":{"iopub.status.busy":"2023-02-03T15:38:02.684475Z","iopub.execute_input":"2023-02-03T15:38:02.685003Z","iopub.status.idle":"2023-02-03T15:38:02.743447Z","shell.execute_reply.started":"2023-02-03T15:38:02.684953Z","shell.execute_reply":"2023-02-03T15:38:02.742671Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train[train[\"biopsy\"]==1][\"cancer\"].describe()","metadata":{"execution":{"iopub.status.busy":"2023-02-03T15:38:02.745652Z","iopub.execute_input":"2023-02-03T15:38:02.74681Z","iopub.status.idle":"2023-02-03T15:38:02.760963Z","shell.execute_reply.started":"2023-02-03T15:38:02.746774Z","shell.execute_reply":"2023-02-03T15:38:02.759527Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train[train[\"biopsy\"]==0][\"cancer\"].describe()","metadata":{"execution":{"iopub.status.busy":"2023-02-03T15:38:02.762699Z","iopub.execute_input":"2023-02-03T15:38:02.763488Z","iopub.status.idle":"2023-02-03T15:38:02.788002Z","shell.execute_reply.started":"2023-02-03T15:38:02.76344Z","shell.execute_reply":"2023-02-03T15:38:02.786479Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train[train[\"invasive\"]==1][\"cancer\"].describe()","metadata":{"execution":{"iopub.status.busy":"2023-02-03T15:38:02.789554Z","iopub.execute_input":"2023-02-03T15:38:02.789925Z","iopub.status.idle":"2023-02-03T15:38:02.807723Z","shell.execute_reply.started":"2023-02-03T15:38:02.789891Z","shell.execute_reply":"2023-02-03T15:38:02.806254Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train[train[\"invasive\"]==0][\"cancer\"].describe()","metadata":{"execution":{"iopub.status.busy":"2023-02-03T15:38:02.809516Z","iopub.execute_input":"2023-02-03T15:38:02.810341Z","iopub.status.idle":"2023-02-03T15:38:02.832023Z","shell.execute_reply.started":"2023-02-03T15:38:02.810295Z","shell.execute_reply":"2023-02-03T15:38:02.830891Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train[train[\"BIRADS\"]==0][\"cancer\"].describe()","metadata":{"execution":{"iopub.status.busy":"2023-02-03T15:38:02.833586Z","iopub.execute_input":"2023-02-03T15:38:02.834292Z","iopub.status.idle":"2023-02-03T15:38:02.849973Z","shell.execute_reply.started":"2023-02-03T15:38:02.83424Z","shell.execute_reply":"2023-02-03T15:38:02.84853Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train[train[\"BIRADS\"]==1][\"cancer\"].describe()","metadata":{"execution":{"iopub.status.busy":"2023-02-03T15:38:02.85155Z","iopub.execute_input":"2023-02-03T15:38:02.852698Z","iopub.status.idle":"2023-02-03T15:38:02.869064Z","shell.execute_reply.started":"2023-02-03T15:38:02.852649Z","shell.execute_reply":"2023-02-03T15:38:02.867924Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train[train[\"BIRADS\"]==2][\"cancer\"].describe()","metadata":{"execution":{"iopub.status.busy":"2023-02-03T15:38:02.871181Z","iopub.execute_input":"2023-02-03T15:38:02.871721Z","iopub.status.idle":"2023-02-03T15:38:02.887497Z","shell.execute_reply.started":"2023-02-03T15:38:02.871672Z","shell.execute_reply":"2023-02-03T15:38:02.886112Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train[train[\"BIRADS\"].isnull()][\"cancer\"].describe()","metadata":{"execution":{"iopub.status.busy":"2023-02-03T15:44:52.457065Z","iopub.execute_input":"2023-02-03T15:44:52.457594Z","iopub.status.idle":"2023-02-03T15:44:52.475941Z","shell.execute_reply.started":"2023-02-03T15:44:52.457554Z","shell.execute_reply":"2023-02-03T15:44:52.474582Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train[train[\"biopsy\"]==1][\"BIRADS\"].describe()","metadata":{"execution":{"iopub.status.busy":"2023-02-03T15:45:32.08775Z","iopub.execute_input":"2023-02-03T15:45:32.088184Z","iopub.status.idle":"2023-02-03T15:45:32.103321Z","shell.execute_reply.started":"2023-02-03T15:45:32.088134Z","shell.execute_reply":"2023-02-03T15:45:32.102087Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"$$\n(cancer = 1) \\subseteqq (biosphy = 1)  \n$$\n\n$$\n(cancer = 1) \\subseteqq (BIRADS = 0 | BIRADS = NaN)\n$$\n\n$$\n(invasive = 1) \\subseteqq (cancer = 1)\n$$\n\n$$\n(biosphy = 1) \\subseteqq (BIRADS = 0 | BIRADS = NaN)\n$$","metadata":{}},{"cell_type":"markdown","source":"# Insights\nauxiliary lossとしてbiosphyを設定してみる。    \nダメであれば、BIRADSを設定する。  \nその場合、$BIRADS=0$のものと、$BIRADS=1 or 2$の２つに分類する。  \nNaNの扱いに関しては、$biopsy=1$のものを$BIRADS=0$、それ以外のものを$BIRADS=1$に分類する。","metadata":{}},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}