{"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":"**Analysis of the training studies for the [SIIM COVID-19 Detection](https://www.kaggle.com/c/siim-covid19-detection/overview) competition**.\n\n**Conclusions**:\n- There are no duplicates.\n- The study labels are imbalanced.\n- A study can only have one label (1).","metadata":{"execution":{"iopub.status.busy":"2021-06-23T15:18:31.142522Z","iopub.execute_input":"2021-06-23T15:18:31.143093Z","iopub.status.idle":"2021-06-23T15:18:31.15627Z","shell.execute_reply.started":"2021-06-23T15:18:31.142965Z","shell.execute_reply":"2021-06-23T15:18:31.154744Z"}}},{"cell_type":"markdown","source":"# CONFS","metadata":{}},{"cell_type":"code","source":"STUDIES = '/kaggle/input/siim-covid19-detection/train_study_level.csv'","metadata":{"execution":{"iopub.status.busy":"2021-06-23T12:59:31.760545Z","iopub.execute_input":"2021-06-23T12:59:31.760942Z","iopub.status.idle":"2021-06-23T12:59:31.765629Z","shell.execute_reply.started":"2021-06-23T12:59:31.760909Z","shell.execute_reply":"2021-06-23T12:59:31.764349Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# IMPORTS","metadata":{}},{"cell_type":"code","source":"import pandas as pd\nimport plotly.express as px","metadata":{"execution":{"iopub.status.busy":"2021-06-23T12:59:32.021649Z","iopub.execute_input":"2021-06-23T12:59:32.022096Z","iopub.status.idle":"2021-06-23T12:59:32.027293Z","shell.execute_reply.started":"2021-06-23T12:59:32.022058Z","shell.execute_reply":"2021-06-23T12:59:32.026413Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# DATASETS","metadata":{}},{"cell_type":"code","source":"df = pd.read_csv(STUDIES, index_col='id')\n# assert df['id'].nunique() == len(df)\ndf.head()","metadata":{"execution":{"iopub.status.busy":"2021-06-23T13:03:16.201891Z","iopub.execute_input":"2021-06-23T13:03:16.202661Z","iopub.status.idle":"2021-06-23T13:03:16.227686Z","shell.execute_reply.started":"2021-06-23T13:03:16.202617Z","shell.execute_reply":"2021-06-23T13:03:16.226779Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# ANALYSIS","metadata":{}},{"cell_type":"markdown","source":"- IDs are unique (no duplicates).\n- There is one label per case (1 value).","metadata":{}},{"cell_type":"code","source":"df.info()","metadata":{"execution":{"iopub.status.busy":"2021-06-23T13:11:09.648674Z","iopub.execute_input":"2021-06-23T13:11:09.649018Z","iopub.status.idle":"2021-06-23T13:11:09.663738Z","shell.execute_reply.started":"2021-06-23T13:11:09.648987Z","shell.execute_reply":"2021-06-23T13:11:09.662531Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"- <span style=\"color: red\">**The dataset is imbalanced**</span>:\n    - max. occurence: 47% (2,855 cases)\n    - min. occurence: 7% (474 cases)","metadata":{}},{"cell_type":"code","source":"cases = df.sum()\ncases","metadata":{"execution":{"iopub.status.busy":"2021-06-23T13:07:49.044377Z","iopub.execute_input":"2021-06-23T13:07:49.04499Z","iopub.status.idle":"2021-06-23T13:07:49.057023Z","shell.execute_reply.started":"2021-06-23T13:07:49.04495Z","shell.execute_reply":"2021-06-23T13:07:49.05524Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"px.bar(cases, title='Number of studies per case')","metadata":{"execution":{"iopub.status.busy":"2021-06-23T13:07:50.889189Z","iopub.execute_input":"2021-06-23T13:07:50.889596Z","iopub.status.idle":"2021-06-23T13:07:50.959974Z","shell.execute_reply.started":"2021-06-23T13:07:50.889561Z","shell.execute_reply":"2021-06-23T13:07:50.958556Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"percents = df.sum() / len(df) * 100\npercents","metadata":{"execution":{"iopub.status.busy":"2021-06-23T13:08:09.973578Z","iopub.execute_input":"2021-06-23T13:08:09.974054Z","iopub.status.idle":"2021-06-23T13:08:09.983473Z","shell.execute_reply.started":"2021-06-23T13:08:09.974022Z","shell.execute_reply":"2021-06-23T13:08:09.982437Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"px.pie(names=percents.index, values=percents.values)","metadata":{"execution":{"iopub.status.busy":"2021-06-23T13:09:46.604994Z","iopub.execute_input":"2021-06-23T13:09:46.605582Z","iopub.status.idle":"2021-06-23T13:09:46.674742Z","shell.execute_reply.started":"2021-06-23T13:09:46.605463Z","shell.execute_reply":"2021-06-23T13:09:46.674038Z"},"trusted":true},"execution_count":null,"outputs":[]}]}