{"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-01-28T17:58:27.643215Z","iopub.execute_input":"2022-01-28T17:58:27.643636Z","iopub.status.idle":"2022-01-28T17:58:27.654549Z","shell.execute_reply.started":"2022-01-28T17:58:27.643593Z","shell.execute_reply":"2022-01-28T17:58:27.65314Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import zipfile","metadata":{"execution":{"iopub.status.busy":"2022-01-28T17:58:27.656519Z","iopub.execute_input":"2022-01-28T17:58:27.656767Z","iopub.status.idle":"2022-01-28T17:58:27.667992Z","shell.execute_reply.started":"2022-01-28T17:58:27.656734Z","shell.execute_reply":"2022-01-28T17:58:27.667194Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"with zipfile.ZipFile('/kaggle/input/dogs-vs-cats/train.zip') as train:\n    train.extractall('.')\n\nwith zipfile.ZipFile('/kaggle/input/dogs-vs-cats/test1.zip') as test:\n    test.extractall('.')","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:24:43.475144Z","iopub.execute_input":"2022-01-28T19:24:43.475443Z","iopub.status.idle":"2022-01-28T19:25:07.663548Z","shell.execute_reply.started":"2022-01-28T19:24:43.475411Z","shell.execute_reply":"2022-01-28T19:25:07.662756Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import tensorflow as tf","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:25:07.66524Z","iopub.execute_input":"2022-01-28T19:25:07.665509Z","iopub.status.idle":"2022-01-28T19:25:07.670188Z","shell.execute_reply.started":"2022-01-28T19:25:07.66547Z","shell.execute_reply":"2022-01-28T19:25:07.669233Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# tf.config.experimental.list_physical_devices(\"GPU\")","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:25:07.671792Z","iopub.execute_input":"2022-01-28T19:25:07.672426Z","iopub.status.idle":"2022-01-28T19:25:07.678453Z","shell.execute_reply.started":"2022-01-28T19:25:07.672341Z","shell.execute_reply":"2022-01-28T19:25:07.67759Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"","metadata":{}},{"cell_type":"code","source":"filenames = os.listdir('/kaggle/working/train/')","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:25:07.68114Z","iopub.execute_input":"2022-01-28T19:25:07.681624Z","iopub.status.idle":"2022-01-28T19:25:07.700174Z","shell.execute_reply.started":"2022-01-28T19:25:07.681589Z","shell.execute_reply":"2022-01-28T19:25:07.699575Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"labels =[]\nfor i in filenames :\n    labels.append(i.split('.')[0])","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:25:07.701393Z","iopub.execute_input":"2022-01-28T19:25:07.701639Z","iopub.status.idle":"2022-01-28T19:25:07.715171Z","shell.execute_reply.started":"2022-01-28T19:25:07.701607Z","shell.execute_reply":"2022-01-28T19:25:07.7144Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.preprocessing import LabelEncoder ","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:25:07.716657Z","iopub.execute_input":"2022-01-28T19:25:07.717235Z","iopub.status.idle":"2022-01-28T19:25:07.723014Z","shell.execute_reply.started":"2022-01-28T19:25:07.717198Z","shell.execute_reply":"2022-01-28T19:25:07.722349Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"encoder = LabelEncoder()\nencoder.fit(labels)","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:25:07.72433Z","iopub.execute_input":"2022-01-28T19:25:07.724618Z","iopub.status.idle":"2022-01-28T19:25:07.742037Z","shell.execute_reply.started":"2022-01-28T19:25:07.724582Z","shell.execute_reply":"2022-01-28T19:25:07.74137Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"y = encoder.transform(labels)","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:25:07.744187Z","iopub.execute_input":"2022-01-28T19:25:07.744776Z","iopub.status.idle":"2022-01-28T19:25:07.757309Z","shell.execute_reply.started":"2022-01-28T19:25:07.74474Z","shell.execute_reply":"2022-01-28T19:25:07.756599Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"y = y.astype(str)","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:25:07.758712Z","iopub.execute_input":"2022-01-28T19:25:07.759088Z","iopub.status.idle":"2022-01-28T19:25:07.780052Z","shell.execute_reply.started":"2022-01-28T19:25:07.759046Z","shell.execute_reply":"2022-01-28T19:25:07.779433Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import random","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:25:07.783446Z","iopub.execute_input":"2022-01-28T19:25:07.783621Z","iopub.status.idle":"2022-01-28T19:25:07.788447Z","shell.execute_reply.started":"2022-01-28T19:25:07.783599Z","shell.execute_reply":"2022-01-28T19:25:07.787769Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"image = random.choice(filenames)","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:25:07.78962Z","iopub.execute_input":"2022-01-28T19:25:07.790038Z","iopub.status.idle":"2022-01-28T19:25:07.795233Z","shell.execute_reply.started":"2022-01-28T19:25:07.790001Z","shell.execute_reply":"2022-01-28T19:25:07.794371Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import matplotlib.pyplot as plt\nfrom tensorflow.keras.preprocessing.image import load_img , img_to_array","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:25:07.796536Z","iopub.execute_input":"2022-01-28T19:25:07.796781Z","iopub.status.idle":"2022-01-28T19:25:07.802822Z","shell.execute_reply.started":"2022-01-28T19:25:07.796747Z","shell.execute_reply":"2022-01-28T19:25:07.801887Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"f = load_img(\"/kaggle/working/train/\"+image)\nplt.imshow(f)\nphoto = img_to_array(f)\nphoto.shape","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:25:07.804298Z","iopub.execute_input":"2022-01-28T19:25:07.804571Z","iopub.status.idle":"2022-01-28T19:25:08.007927Z","shell.execute_reply.started":"2022-01-28T19:25:07.804524Z","shell.execute_reply":"2022-01-28T19:25:08.007218Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"file = {\"names\":filenames , \"y\":y}","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:25:08.009075Z","iopub.execute_input":"2022-01-28T19:25:08.00988Z","iopub.status.idle":"2022-01-28T19:25:08.014307Z","shell.execute_reply.started":"2022-01-28T19:25:08.009842Z","shell.execute_reply":"2022-01-28T19:25:08.013619Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df = pd.DataFrame(file)","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:25:08.015837Z","iopub.execute_input":"2022-01-28T19:25:08.016304Z","iopub.status.idle":"2022-01-28T19:25:08.027006Z","shell.execute_reply.started":"2022-01-28T19:25:08.016266Z","shell.execute_reply":"2022-01-28T19:25:08.026175Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.model_selection import train_test_split","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:25:08.029912Z","iopub.execute_input":"2022-01-28T19:25:08.030098Z","iopub.status.idle":"2022-01-28T19:25:08.034096Z","shell.execute_reply.started":"2022-01-28T19:25:08.030074Z","shell.execute_reply":"2022-01-28T19:25:08.033441Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"x_train ,y_train = train_test_split(df , test_size = .3 , random_state =42 )","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:25:16.313599Z","iopub.execute_input":"2022-01-28T19:25:16.313865Z","iopub.status.idle":"2022-01-28T19:25:16.324778Z","shell.execute_reply.started":"2022-01-28T19:25:16.313835Z","shell.execute_reply":"2022-01-28T19:25:16.324048Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"x_train","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:25:16.551554Z","iopub.execute_input":"2022-01-28T19:25:16.551795Z","iopub.status.idle":"2022-01-28T19:25:16.562441Z","shell.execute_reply.started":"2022-01-28T19:25:16.551769Z","shell.execute_reply":"2022-01-28T19:25:16.56145Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"x_train = x_train.reset_index(drop=True)\ny_train = y_train.reset_index(drop=True)","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:25:16.74805Z","iopub.execute_input":"2022-01-28T19:25:16.748294Z","iopub.status.idle":"2022-01-28T19:25:16.753644Z","shell.execute_reply.started":"2022-01-28T19:25:16.748264Z","shell.execute_reply":"2022-01-28T19:25:16.752617Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# from tensorflow.keras.preprocessing.image import ImageDataGenerator","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:25:17.07111Z","iopub.execute_input":"2022-01-28T19:25:17.071668Z","iopub.status.idle":"2022-01-28T19:25:17.075266Z","shell.execute_reply.started":"2022-01-28T19:25:17.071629Z","shell.execute_reply":"2022-01-28T19:25:17.074583Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# from tensorflow.keras.preprocessing.image import ImageDataGenerator\n# train_datagen = ImageDataGenerator(rescale=1.0/255.0)\n\n\n# valid_datagen = ImageDataGenerator(rescale=1.0/255.0)\n    ","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:25:18.177925Z","iopub.execute_input":"2022-01-28T19:25:18.178618Z","iopub.status.idle":"2022-01-28T19:25:18.183215Z","shell.execute_reply.started":"2022-01-28T19:25:18.17858Z","shell.execute_reply":"2022-01-28T19:25:18.182393Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# train_generator = train_datagen.flow_from_dataframe(\n#     x_train,\n#     \"/kaggle/working/train/\", \n#     x_col='names',\n#     y_col='y',\n# class_mode='binary', batch_size=64, target_size=(481, 287))\n\n# valid_generator = valid_datagen.flow_from_dataframe( \n#     y_train,\n#     \"/kaggle/working/train/\", \n#     x_col='names',\n#     y_col='y',\n#   class_mode='binary', batch_size=64, target_size=(481, 287))","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:25:18.414586Z","iopub.execute_input":"2022-01-28T19:25:18.415114Z","iopub.status.idle":"2022-01-28T19:25:18.420286Z","shell.execute_reply.started":"2022-01-28T19:25:18.415077Z","shell.execute_reply":"2022-01-28T19:25:18.419352Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# vgg16 model used for transfer learning on the dogs and cats dataset\nimport sys\nfrom matplotlib import pyplot\nfrom tensorflow.keras.utils import to_categorical\nfrom keras.applications.vgg16 import VGG16\nfrom keras.models import Model\nfrom keras.layers import Dense\nfrom keras.layers import Flatten\nfrom tensorflow.keras.optimizers import SGD\nfrom keras.preprocessing.image import ImageDataGenerator\n \n# define cnn model\ndef define_model():\n\t# load model\n\tmodel = VGG16(include_top=False, input_shape=(224, 224, 3))\n\t# mark loaded layers as not trainable\n\tfor layer in model.layers:\n\t\tlayer.trainable = False\n\t# add new classifier layers\n\tflat1 = Flatten()(model.layers[-1].output)\n\tclass1 = Dense(128, activation='relu', kernel_initializer='he_uniform')(flat1)\n\toutput = Dense(1, activation='sigmoid')(class1)\n\t# define new model\n\tmodel = Model(inputs=model.inputs, outputs=output)\n\t# compile model\n\topt = SGD(lr=0.001, momentum=0.9)\n\tmodel.compile(optimizer=opt, loss='binary_crossentropy', metrics=['accuracy'])\n\treturn model\n \n# plot diagnostic learning curves\ndef summarize_diagnostics(history):\n\t# plot loss\n\tpyplot.subplot(211)\n\tpyplot.title('Cross Entropy Loss')\n\tpyplot.plot(history.history['loss'], color='blue', label='train')\n\tpyplot.plot(history.history['val_loss'], color='orange', label='test')\n\t# plot accuracy\n\tpyplot.subplot(212)\n\tpyplot.title('Classification Accuracy')\n\tpyplot.plot(history.history['accuracy'], color='blue', label='train')\n\tpyplot.plot(history.history['val_accuracy'], color='orange', label='test')\n\t# save plot to file\n\tfilename = sys.argv[0].split('/')[-1]\n\tpyplot.savefig(filename + '_plot.png')\n\tpyplot.close()\n \n# run the test harness for evaluating a model\n\n# define model\nmodel = define_model()\n# create data generator\ndatagen = ImageDataGenerator(featurewise_center=True)\n# specify imagenet mean values for centering\ndatagen.mean = [123.68, 116.779, 103.939]\n# prepare iterator\ntrain_it = datagen.flow_from_dataframe( x_train,\n    \"/kaggle/working/train/\", \n    x_col='names',\n    y_col='y',\n\t\tclass_mode='binary', batch_size=64, target_size=(224, 224))\ntest_it = datagen.flow_from_dataframe( y_train,\n    \"/kaggle/working/train/\", \n    x_col='names',\n    y_col='y',\n\tclass_mode='binary', batch_size=64, target_size=(224, 224))\n\t# fit model\nhistory = model.fit_generator(train_it, steps_per_epoch=len(train_it),\n\t\tvalidation_data=test_it, validation_steps=len(test_it), epochs=5)\n# evaluate model\n_, acc = model.evaluate_generator(test_it, steps=len(test_it))\nprint('> %.3f' % (acc * 100.0))\n\t# learning curves\nsummarize_diagnostics(history)\n ","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:25:19.013207Z","iopub.execute_input":"2022-01-28T19:25:19.013646Z","iopub.status.idle":"2022-01-28T19:41:07.280087Z","shell.execute_reply.started":"2022-01-28T19:25:19.013609Z","shell.execute_reply":"2022-01-28T19:41:07.277613Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_filenames = os.listdir(\"/kaggle/working/test1\")","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:41:12.062565Z","iopub.execute_input":"2022-01-28T19:41:12.063111Z","iopub.status.idle":"2022-01-28T19:41:12.07528Z","shell.execute_reply.started":"2022-01-28T19:41:12.063072Z","shell.execute_reply":"2022-01-28T19:41:12.074469Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_filenames\n\ntest_df = pd.DataFrame({\n    'filename': test_filenames,\n})\ntest_df","metadata":{"execution":{"iopub.status.busy":"2022-01-28T20:03:52.050765Z","iopub.execute_input":"2022-01-28T20:03:52.051225Z","iopub.status.idle":"2022-01-28T20:03:52.069544Z","shell.execute_reply.started":"2022-01-28T20:03:52.05118Z","shell.execute_reply":"2022-01-28T20:03:52.068584Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_data = ImageDataGenerator(rescale=1./255)\ntest_data","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:41:15.772245Z","iopub.execute_input":"2022-01-28T19:41:15.772853Z","iopub.status.idle":"2022-01-28T19:41:15.778278Z","shell.execute_reply.started":"2022-01-28T19:41:15.772808Z","shell.execute_reply":"2022-01-28T19:41:15.777509Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_data_gen = test_data.flow_from_dataframe(\n    test_df, \n    \"/kaggle/working/test1\", \n    x_col='filename',\n    y_col=None,\n    class_mode=None,\n    target_size=(224, 224),\n    batch_size=64,\n    shuffle=False\n)","metadata":{"execution":{"iopub.status.busy":"2022-01-28T20:03:32.22495Z","iopub.execute_input":"2022-01-28T20:03:32.225224Z","iopub.status.idle":"2022-01-28T20:03:32.437803Z","shell.execute_reply.started":"2022-01-28T20:03:32.225193Z","shell.execute_reply":"2022-01-28T20:03:32.436003Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"predictions = model.predict_generator(test_data_gen,2000)","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:46:33.306651Z","iopub.execute_input":"2022-01-28T19:46:33.30691Z","iopub.status.idle":"2022-01-28T19:46:33.314276Z","shell.execute_reply.started":"2022-01-28T19:46:33.306879Z","shell.execute_reply":"2022-01-28T19:46:33.313362Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"len(predictions)","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:51:04.754036Z","iopub.execute_input":"2022-01-28T19:51:04.754301Z","iopub.status.idle":"2022-01-28T19:51:04.77634Z","shell.execute_reply.started":"2022-01-28T19:51:04.754271Z","shell.execute_reply":"2022-01-28T19:51:04.775271Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"results = (predictions > 0.5).astype(int)","metadata":{"execution":{"iopub.status.busy":"2022-01-28T20:00:28.528851Z","iopub.execute_input":"2022-01-28T20:00:28.529113Z","iopub.status.idle":"2022-01-28T20:00:28.5675Z","shell.execute_reply.started":"2022-01-28T20:00:28.529077Z","shell.execute_reply":"2022-01-28T20:00:28.566476Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"results = pd.DataFrame(results)","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:42:21.434776Z","iopub.execute_input":"2022-01-28T19:42:21.435526Z","iopub.status.idle":"2022-01-28T19:42:21.439491Z","shell.execute_reply.started":"2022-01-28T19:42:21.435485Z","shell.execute_reply":"2022-01-28T19:42:21.438732Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:43:28.110186Z","iopub.execute_input":"2022-01-28T19:43:28.110453Z","iopub.status.idle":"2022-01-28T19:43:28.119086Z","shell.execute_reply.started":"2022-01-28T19:43:28.110423Z","shell.execute_reply":"2022-01-28T19:43:28.118391Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# submission = pd.read_csv('sampleSubmission.csv')","metadata":{"execution":{"iopub.status.busy":"2022-01-28T18:25:25.497576Z","iopub.execute_input":"2022-01-28T18:25:25.497821Z","iopub.status.idle":"2022-01-28T18:25:25.501512Z","shell.execute_reply.started":"2022-01-28T18:25:25.497793Z","shell.execute_reply":"2022-01-28T18:25:25.500579Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:44:00.948196Z","iopub.execute_input":"2022-01-28T19:44:00.948971Z","iopub.status.idle":"2022-01-28T19:44:00.954273Z","shell.execute_reply.started":"2022-01-28T19:44:00.948928Z","shell.execute_reply":"2022-01-28T19:44:00.953303Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"results.columns = ['index']","metadata":{"execution":{"iopub.status.busy":"2022-01-28T16:39:03.648243Z","iopub.status.idle":"2022-01-28T16:39:03.648968Z","shell.execute_reply.started":"2022-01-28T16:39:03.648707Z","shell.execute_reply":"2022-01-28T16:39:03.648735Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"label = []\nfor i in results['index']:\n    if i ==0:\n        label.append('cat')\n    else:\n        label.append('dog')","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:43:32.488121Z","iopub.execute_input":"2022-01-28T19:43:32.488409Z","iopub.status.idle":"2022-01-28T19:43:32.499814Z","shell.execute_reply.started":"2022-01-28T19:43:32.488379Z","shell.execute_reply":"2022-01-28T19:43:32.499044Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:43:34.553087Z","iopub.execute_input":"2022-01-28T19:43:34.555256Z","iopub.status.idle":"2022-01-28T19:43:34.561877Z","shell.execute_reply.started":"2022-01-28T19:43:34.555217Z","shell.execute_reply":"2022-01-28T19:43:34.559845Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_df['label'] =results['index']","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:43:37.074062Z","iopub.execute_input":"2022-01-28T19:43:37.074554Z","iopub.status.idle":"2022-01-28T19:43:37.079415Z","shell.execute_reply.started":"2022-01-28T19:43:37.074514Z","shell.execute_reply":"2022-01-28T19:43:37.078688Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_df.to_csv(\"submission.csv\",index = False)","metadata":{"execution":{"iopub.status.busy":"2022-01-28T19:43:37.827546Z","iopub.execute_input":"2022-01-28T19:43:37.828023Z","iopub.status.idle":"2022-01-28T19:43:37.854219Z","shell.execute_reply.started":"2022-01-28T19:43:37.827985Z","shell.execute_reply":"2022-01-28T19:43:37.853571Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}