{"cells":[{"metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true},"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 in \n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nimport os\n\nfrom glob import glob\nimport matplotlib.pyplot as plt\nimport cv2\nimport skimage\n# Input data files are available in the \"../input/\" directory.\n# For example, running this (by clicking run or pressing Shift+Enter) will list the files in the input directory\n\nimport os\nprint(os.listdir(\"../input\"))\ndata_trian_path  = '../input/train/'\n# Any results you write to the current directory are saved as output.","execution_count":null,"outputs":[]},{"metadata":{"_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0","_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a","trusted":true},"cell_type":"code","source":"data_train = pd.read_csv('../input/train_labels.csv')\ndata_train.info()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"460a08dfb22bd0e07ad123e6dd147bcfc576e29b"},"cell_type":"code","source":"data_train['label'].value_counts()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"scrolled":true,"_uuid":"97e0eed872e13c1444627bac731db319e3197557"},"cell_type":"code","source":"data_train['label'].hist()","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"1626a193641bbbb77d66d0484655bd0a39e8db79"},"cell_type":"markdown","source":"## review some pic"},{"metadata":{"trusted":true,"_uuid":"79af0004972b42bb726a315a1b2bf1c51c5d4a24"},"cell_type":"code","source":"print(\"cancer\")\nmultipleImages = data_train.loc[data_train['label']==1]['id'].values\n# multipleImages = glob(data_trian_path + '**')\ni_ = 0\nplt.rcParams['figure.figsize'] = (10.0, 10.0)\nplt.subplots_adjust(wspace=0, hspace=0)\nfor l in multipleImages[1:26]:\n    file_path = data_trian_path + l +'.tif'\n#     print(file_path)\n#     print(i_)\n    im = cv2.imread(file_path)\n#     im = cv2.resize(im, (96, 96)) \n    cv2.rectangle(im, (32,32), (64,64), (0,255,0), 2)\n    plt.subplot(5, 5, i_+1) #.set_title(l)\n    plt.imshow(cv2.cvtColor(im, cv2.COLOR_BGR2RGB)); plt.axis('off')\n    i_ += 1","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"bcf8c15e64022510cdcff053e6c50393e0d3ae7b"},"cell_type":"code","source":"print(\"no cancer\")\nmultipleImages = data_train.loc[data_train['label']==0]['id'].values\n# multipleImages = glob(data_trian_path + '**')\ni_ = 0\nplt.rcParams['figure.figsize'] = (10.0, 10.0)\nplt.subplots_adjust(wspace=0, hspace=0)\nfor l in multipleImages[:25]:\n    file_path = data_trian_path + l +'.tif'\n    im = cv2.imread(file_path)\n    cv2.rectangle(im, (32,32), (64,64), (0,255,0), 2)\n#     im = cv2.resize(im, (128, 128)) \n    plt.subplot(5, 5, i_+1) #.set_title(l)\n    plt.imshow(cv2.cvtColor(im, cv2.COLOR_BGR2RGB)); plt.axis('off')\n    i_ += 1","execution_count":null,"outputs":[]}],"metadata":{"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"name":"python","version":"3.6.6","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat":4,"nbformat_minor":1}