{"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\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-09-08T06:08:02.314423Z","iopub.execute_input":"2022-09-08T06:08:02.314838Z","iopub.status.idle":"2022-09-08T06:08:02.344335Z","shell.execute_reply.started":"2022-09-08T06:08:02.314750Z","shell.execute_reply":"2022-09-08T06:08:02.343368Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import tensorflow as tf\nimport matplotlib.pyplot as plt\nimport os","metadata":{"execution":{"iopub.status.busy":"2022-09-08T06:08:31.333920Z","iopub.execute_input":"2022-09-08T06:08:31.335094Z","iopub.status.idle":"2022-09-08T06:08:31.339482Z","shell.execute_reply.started":"2022-09-08T06:08:31.335051Z","shell.execute_reply":"2022-09-08T06:08:31.338224Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"base_image_dir = os.path.join('..', 'input', 'diabetic-retinopathy-detection')\nretina_df = pd.read_csv(os.path.join(base_image_dir, 'trainLabels.csv.zip'))\nretina_df","metadata":{"execution":{"iopub.status.busy":"2022-09-08T06:53:49.561749Z","iopub.execute_input":"2022-09-08T06:53:49.562138Z","iopub.status.idle":"2022-09-08T06:53:49.599544Z","shell.execute_reply.started":"2022-09-08T06:53:49.562105Z","shell.execute_reply":"2022-09-08T06:53:49.598384Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train = retina_df['image']\ntrain","metadata":{"execution":{"iopub.status.busy":"2022-09-08T06:57:35.881407Z","iopub.execute_input":"2022-09-08T06:57:35.881842Z","iopub.status.idle":"2022-09-08T06:57:35.890623Z","shell.execute_reply.started":"2022-09-08T06:57:35.881808Z","shell.execute_reply":"2022-09-08T06:57:35.889496Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test = retina_df['level']\ntest","metadata":{"execution":{"iopub.status.busy":"2022-09-08T06:57:37.955093Z","iopub.execute_input":"2022-09-08T06:57:37.955517Z","iopub.status.idle":"2022-09-08T06:57:37.964676Z","shell.execute_reply.started":"2022-09-08T06:57:37.955477Z","shell.execute_reply":"2022-09-08T06:57:37.963633Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from keras.preprocessing.image import ImageDataGenerator","metadata":{"execution":{"iopub.status.busy":"2022-09-08T07:01:04.786422Z","iopub.execute_input":"2022-09-08T07:01:04.786814Z","iopub.status.idle":"2022-09-08T07:01:04.791683Z","shell.execute_reply.started":"2022-09-08T07:01:04.786781Z","shell.execute_reply":"2022-09-08T07:01:04.790691Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_datagen = ImageDataGenerator(rescale=1./255,\n                                      shear_range=0.2, \n                                        zoom_range=0.2,\n                                        horizontal_flip=True)\nx_train = train_datagen.flow_from_directory(\n        '../input/diabetic-retinopathy-detection/train.zip.001',\n        batch_size=64,\n        )","metadata":{"execution":{"iopub.status.busy":"2022-09-08T07:04:05.857622Z","iopub.execute_input":"2022-09-08T07:04:05.858114Z","iopub.status.idle":"2022-09-08T07:04:05.901454Z","shell.execute_reply.started":"2022-09-08T07:04:05.858070Z","shell.execute_reply":"2022-09-08T07:04:05.900217Z"},"trusted":true},"execution_count":null,"outputs":[]}]}