{"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 os, glob\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nDATASET_FOLDER = \"/kaggle/input/mayo-clinic-strip-ai/\"","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-07-21T07:16:40.012075Z","iopub.execute_input":"2022-07-21T07:16:40.012869Z","iopub.status.idle":"2022-07-21T07:16:40.038273Z","shell.execute_reply.started":"2022-07-21T07:16:40.012763Z","shell.execute_reply":"2022-07-21T07:16:40.037277Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"path_csv = os.path.join(DATASET_FOLDER, \"train.csv\")\ndf_train = pd.read_csv(path_csv)\ndisplay(df_train.head())","metadata":{"execution":{"iopub.status.busy":"2022-07-21T07:16:40.040366Z","iopub.execute_input":"2022-07-21T07:16:40.041335Z","iopub.status.idle":"2022-07-21T07:16:40.072321Z","shell.execute_reply.started":"2022-07-21T07:16:40.04129Z","shell.execute_reply":"2022-07-21T07:16:40.07149Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_train.shape ","metadata":{"execution":{"iopub.status.busy":"2022-07-21T07:26:55.395972Z","iopub.execute_input":"2022-07-21T07:26:55.396568Z","iopub.status.idle":"2022-07-21T07:26:55.403739Z","shell.execute_reply.started":"2022-07-21T07:26:55.396532Z","shell.execute_reply":"2022-07-21T07:26:55.402596Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# check how balanced the data is for the classes - CE and LAA","metadata":{}},{"cell_type":"code","source":"df_train[[\"label\"]].value_counts().plot.pie(autopct='%1.1f%%',ylabel=\"label\")","metadata":{"execution":{"iopub.status.busy":"2022-07-21T07:22:42.676414Z","iopub.execute_input":"2022-07-21T07:22:42.676825Z","iopub.status.idle":"2022-07-21T07:22:42.775969Z","shell.execute_reply.started":"2022-07-21T07:22:42.676791Z","shell.execute_reply":"2022-07-21T07:22:42.774685Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# How many patients Have CE, LAA ","metadata":{}},{"cell_type":"code","source":"print('Unique patients having CE condition', df_train.loc[df_train['label']=='CE']['patient_id'].nunique() , 'of total',df_train['patient_id'].nunique() )\nprint('Unique patients having LAA condition', df_train.loc[df_train['label']=='LAA']['patient_id'].nunique(),'of total',df_train['patient_id'].nunique() )\n","metadata":{"execution":{"iopub.status.busy":"2022-07-21T07:25:52.246446Z","iopub.execute_input":"2022-07-21T07:25:52.24683Z","iopub.status.idle":"2022-07-21T07:25:52.258397Z","shell.execute_reply.started":"2022-07-21T07:25:52.2468Z","shell.execute_reply":"2022-07-21T07:25:52.257174Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Check any patient presented with both conditions","metadata":{}},{"cell_type":"code","source":"df_train.groupby(['patient_id']).agg(distinct_condition=('label','nunique')).reset_index()['distinct_condition'].value_counts() \n\n# None of the patients presented with both conditions","metadata":{"execution":{"iopub.status.busy":"2022-07-21T07:31:17.676574Z","iopub.execute_input":"2022-07-21T07:31:17.677592Z","iopub.status.idle":"2022-07-21T07:31:17.69262Z","shell.execute_reply.started":"2022-07-21T07:31:17.677555Z","shell.execute_reply":"2022-07-21T07:31:17.691547Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}