{"cells":[{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"3db5a417-b07d-88eb-0878-8d8652b354f4"},"outputs":[],"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)\n\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\nfrom subprocess import check_output\nprint(check_output([\"ls\", \"../input\"]).decode(\"utf8\"))\n\n# Any results you write to the current directory are saved as output."},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"183144ba-5bce-ba0e-aaf9-0c411371ab82"},"outputs":[],"source":"import time; start_time = time.time()\nimport warnings; warnings.filterwarnings('ignore');\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\n#%matplotlib inline\nfrom PIL import Image\nfrom PIL import ImageFilter\ntrain_photos = pd.read_csv('../input/train_photo_to_biz_ids.csv')\ntrain_attr = pd.read_csv('../input/train.csv')\ntrain_id = pd.read_csv('../input/train_photo_to_biz_ids.csv') \ntest_photos = pd.read_csv('../input/test_photo_to_biz.csv')\nplt.rcParams['figure.figsize'] = (10.0, 10.0)\nplt.subplots_adjust(wspace=0, hspace=0)\nprint(\"Train...\")\nfor x in range(25):\n        plt.subplot(5, 5, x+1)\n        im = Image.open('../input/train_photos/' + str(train_photos.photo_id[x]) + '.jpg')\n        im = im.resize((100, 100), Image.ANTIALIAS)\n        plt.imshow(im)\n        plt.axis('off')\nprint(\"Test...\")\nplt.rcParams['figure.figsize'] = (10.0, 10.0)\nplt.subplots_adjust(wspace=0, hspace=0)\nfor x in range(25):\n        plt.subplot(5, 5, x+1)\n        im = Image.open('../input/test_photos/' + str(test_photos.photo_id[x]) + '.jpg')\n        im = im.resize((100, 100), Image.ANTIALIAS)\n        plt.imshow(im)\n        plt.axis('off')\nprint(\"Train Photos\", len(train_photos), len(train_photos.columns))\ntrain_photos.head()\nprint(\"Train Attributes\", len(train_attr), len(train_attr.columns))\ntrain_attr.head()\nprint(\"Train ID\", len(train_id), len(train_id.columns))\ntrain_id.head()\nprint(\"Test Photos\", len(test_photos), len(test_photos.columns))\ntest_photos.head()\nlabel_notation = {0: 'good_for_lunch', 1: 'good_for_dinner', 2: 'takes_reservations',  3: 'outdoor_seating',\n                  4: 'restaurant_is_expensive', 5: 'has_alcohol', 6: 'has_table_service', 7: 'ambience_is_classy',\n                  8: 'good_for_kids'}\nfor l in label_notation:\n    ids = train_attr[train_attr['labels'].str.contains(str(l))==True].business_id.tolist()[:9]\n    plt.rcParams['figure.figsize'] = (7.0, 7.0)\n    plt.subplots_adjust(wspace=0, hspace=0)\n    for x in range(9):\n        plt.subplot(3, 3, x+1)\n        im = Image.open('../input/train_photos/' + str(train_photos.photo_id[ids[x]]) + '.jpg')\n        im = im.resize((150, 150), Image.ANTIALIAS)\n        plt.imshow(im)\n        plt.axis('off')\n    fig = plt.figure()\n    fig.suptitle(label_notation[l])"},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"ae7bfd49-2a4f-8068-817e-38b01aa7ac31"},"outputs":[],"source":""}],"metadata":{"_change_revision":0,"_is_fork":false,"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.6.0"}},"nbformat":4,"nbformat_minor":0}