{"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 numpy as np \nimport pandas as pd \nimport os\nimport os.path, sys\nfrom tqdm import tqdm\nfrom PIL import Image\nImage.MAX_IMAGE_PIXELS = None\nfrom pathlib import Path\nimport matplotlib.pyplot as plt\nimport matplotlib.image as mpimg\nimport matplotlib as mpl\nfrom IPython.display import display\n%matplotlib inline\nfrom skimage.feature import hog\nfrom skimage.color import rgb2gray\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.decomposition import PCA\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.svm import SVC\nfrom sklearn.metrics import roc_curve, auc, accuracy_score\nfrom skimage import data\nfrom skimage.color import rgb2hed, hed2rgb","metadata":{"execution":{"iopub.status.busy":"2023-10-25T13:07:17.470095Z","iopub.execute_input":"2023-10-25T13:07:17.470632Z","iopub.status.idle":"2023-10-25T13:07:17.495961Z","shell.execute_reply.started":"2023-10-25T13:07:17.470593Z","shell.execute_reply":"2023-10-25T13:07:17.494946Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_photodf = pd.read_csv(\"/kaggle/input/UBC-OCEAN/train.csv\")\ntrain_photodf_index = pd.read_csv(\"/kaggle/input/UBC-OCEAN/train.csv\",index_col=0)\n\nlist_files = []\n# giving directory name\ndirname = '/kaggle/input/UBC-OCEAN/train_thumbnails'\n \n# giving file extension\next = ('_thumbnail.png')\n \n# iterating over all files\nfor files in os.listdir(dirname):\n    if files.endswith(ext):\n        list_files.append(files)  \n    else:\n        continue\n        \nlist_files_array = np.array(list_files)\nid_images = list(map(int, [item.split('_thumbnail.png')[0] for item in list_files_array]))\ndf_thumbnail = train_photodf[train_photodf['image_id'].isin(id_images)]\ndf_thumbnail.set_index('image_id', inplace=True)\n\ndf_tumor = train_photodf_index[~train_photodf_index.index.isin(df_thumbnail.index)]\n\ndf_ntumor = df_thumbnail[df_thumbnail.index.isin(df_thumbnail.index[0:25])]\n\ndf_ntumorcropp = df_thumbnail[df_thumbnail.index.isin(df_thumbnail.index[0:9])]\n\n","metadata":{"execution":{"iopub.status.busy":"2023-10-25T13:09:50.765317Z","iopub.execute_input":"2023-10-25T13:09:50.765849Z","iopub.status.idle":"2023-10-25T13:09:50.788454Z","shell.execute_reply.started":"2023-10-25T13:09:50.765812Z","shell.execute_reply":"2023-10-25T13:09:50.787481Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def get_Image (row_id, root=\"/kaggle/input/UBC-OCEAN/train_images\"):\n    \"\"\"\n    Converts an image number into the file path where the image is located,\n    opens the image, return the image as numpy array.\n    \n    \"\"\"\n    filename = \"{}.png\".format(row_id)\n    file_path = os.path.join(root, filename)\n    img = Image.open(file_path)\n    left = int(img.size[0]/2-1000/2)\n    upper = int(img.size[1]/2-1000/2)\n    right = left + 1000\n    lower = upper + 1000\n    img_cropped = img.crop((left,upper,right,lower))\n    \n    return np.asarray(img_cropped)\n\ndef get_image3 (row_id, root=\"/kaggle/input/UBC-OCEAN/train_thumbnails\"):\n    \"\"\"\n    Converts an image number into the file path where the image is located,\n    opens the image, return the image as numpy array.\n    \n    \"\"\"\n    filename = \"{}_thumbnail.png\".format(row_id)\n    file_path = os.path.join(root, filename)\n    img = Image.open(file_path)\n    new_size = (1000,1000)\n    img = img.resize(new_size)\n\n    return np.array(img)\n\ndef get_image2 (row_id, root=\"/kaggle/input/UBC-OCEAN/train_images\"):\n    \"\"\"\n    Converts an image number into the file path where the image is located,\n    opens the image, return the image as numpy array.\n    \n    \"\"\"\n    filename = \"{}.png\".format(row_id)\n    file_path = os.path.join(root, filename)\n    img = Image.open(file_path)\n    new_size = (1000,1000)\n    img = img.resize(new_size)\n\n    return np.array(img)","metadata":{"execution":{"iopub.status.busy":"2023-10-25T13:31:30.766445Z","iopub.execute_input":"2023-10-25T13:31:30.767793Z","iopub.status.idle":"2023-10-25T13:31:30.780656Z","shell.execute_reply.started":"2023-10-25T13:31:30.767754Z","shell.execute_reply":"2023-10-25T13:31:30.779212Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"%%time\ndef create_features(img):\n    color_features = img.flatten()\n    gray_image = rgb2gray(img)\n    hog_features = hog(gray_image, block_norm='L2-Hys', pixels_per_cell=(16,16))\n    flat_features = np.hstack([color_features,hog_features])\n    return flat_features\n","metadata":{"execution":{"iopub.status.busy":"2023-10-25T12:28:16.655414Z","iopub.execute_input":"2023-10-25T12:28:16.655907Z","iopub.status.idle":"2023-10-25T12:28:16.663302Z","shell.execute_reply.started":"2023-10-25T12:28:16.65587Z","shell.execute_reply":"2023-10-25T12:28:16.66219Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def create_feature_matrix(T_dataframe,T_dataframe1):\n    features_list = []\n    \n    for img_Id in tqdm(T_dataframe1.index[0:200]):\n        Img = get_image3(img_Id)\n        Image_features = create_features(Img)\n        features_list.append(Image_features)\n        \n    \n    \n    \n    for img_id in tqdm(T_dataframe.index):\n        img = get_image2(img_id)\n        image_features = create_features(img)\n        features_list.append(image_features)\n      \n    feature_matrix = np.array(features_list)\n    return feature_matrix","metadata":{"execution":{"iopub.status.busy":"2023-10-25T12:28:24.590305Z","iopub.execute_input":"2023-10-25T12:28:24.590697Z","iopub.status.idle":"2023-10-25T12:28:24.598359Z","shell.execute_reply.started":"2023-10-25T12:28:24.590669Z","shell.execute_reply":"2023-10-25T12:28:24.596889Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"%%time\nfeature_matrix =create_feature_matrix(df_tumor,df_thumbnail)","metadata":{"execution":{"iopub.status.busy":"2023-10-25T12:28:31.071205Z","iopub.execute_input":"2023-10-25T12:28:31.071627Z","iopub.status.idle":"2023-10-25T12:30:51.4829Z","shell.execute_reply.started":"2023-10-25T12:28:31.071593Z","shell.execute_reply":"2023-10-25T12:30:51.481907Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_ntumor200 = df_thumbnail[df_thumbnail.index.isin(df_thumbnail.index[0:200])]\nsampleFrame = [df_tumor,df_ntumor200]\nSampleTumor = pd.concat(sampleFrame)\nSampleTumor.sort_index(axis=0, ascending=True)\nSampleTumor.info()","metadata":{"execution":{"iopub.status.busy":"2023-10-25T12:31:31.453382Z","iopub.execute_input":"2023-10-25T12:31:31.453806Z","iopub.status.idle":"2023-10-25T12:31:31.486634Z","shell.execute_reply.started":"2023-10-25T12:31:31.453776Z","shell.execute_reply":"2023-10-25T12:31:31.484689Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X_train, X_test, y_train, y_test = train_test_split(feature_matrix , SampleTumor.is_tma.values, test_size = .3, random_state = 1234123)\npd.Series(y_train).value_counts()\n","metadata":{"execution":{"iopub.status.busy":"2023-10-25T12:31:43.039692Z","iopub.execute_input":"2023-10-25T12:31:43.040176Z","iopub.status.idle":"2023-10-25T12:31:45.444688Z","shell.execute_reply.started":"2023-10-25T12:31:43.040138Z","shell.execute_reply":"2023-10-25T12:31:45.443393Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print('Training features matrix shape:', X_train.shape)\nss = StandardScaler()\ntrain_stand = ss.fit_transform(X_train)\ntest_stand = ss.fit_transform(X_test)\nprint('Standardized training features matrix shape is:',train_stand.shape)\nprint('Standardized testing features matrix shape is:',test_stand.shape)","metadata":{"execution":{"iopub.status.busy":"2023-10-25T12:31:56.731225Z","iopub.execute_input":"2023-10-25T12:31:56.731746Z","iopub.status.idle":"2023-10-25T12:32:11.778113Z","shell.execute_reply.started":"2023-10-25T12:31:56.731704Z","shell.execute_reply":"2023-10-25T12:32:11.77692Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pca = PCA(n_components=35)\nX_train = pca.fit_transform(train_stand)\nX_test = pca.transform(test_stand)\nprint(\"training features matrix is:\", X_train.shape)\nprint(\"testing features matrix is:\",X_test.shape)\n","metadata":{"execution":{"iopub.status.busy":"2023-10-25T12:33:54.645255Z","iopub.execute_input":"2023-10-25T12:33:54.645873Z","iopub.status.idle":"2023-10-25T12:34:50.893406Z","shell.execute_reply.started":"2023-10-25T12:33:54.645827Z","shell.execute_reply":"2023-10-25T12:34:50.892193Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# define support vector classifier\nsvm = SVC(kernel='linear', probability=True, random_state=42)\n# fit model\nsvm.fit(X_train, y_train)\n# generate predictions\ny_pred = svm.predict(X_test)\n# calculate accuracy\naccuracy = accuracy_score(y_test, y_pred)\nprint('Model accuracy is: ', accuracy)","metadata":{"execution":{"iopub.status.busy":"2023-10-25T12:37:39.594014Z","iopub.execute_input":"2023-10-25T12:37:39.594501Z","iopub.status.idle":"2023-10-25T12:38:18.280488Z","shell.execute_reply.started":"2023-10-25T12:37:39.594468Z","shell.execute_reply":"2023-10-25T12:38:18.27921Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# predict probabilities for X_test using predict_proba\nprobabilities = svm.predict_proba(X_test)\n# select the probabilities for label 1.0\ny_proba = probabilities[:, 1]\n# calculate false positive rate and true positive rate at different thresholds\nfalse_positive_rate, true_positive_rate, thresholds = roc_curve(y_test, y_proba, pos_label=1)\n# calculate AUC\nroc_auc = auc(false_positive_rate, true_positive_rate)\nplt.title('Receiver Operating Characteristic')\n# plot the false positive rate on the x axis and the true positive rate on the y axis\nroc_plot = plt.plot(false_positive_rate,\n                    true_positive_rate,\n                    label='AUC = {:0.2f}'.format(roc_auc))\nplt.legend(loc=0)\nplt.plot([0,1], [0,1], ls='--')\nplt.ylabel('True Positive Rate')\nplt.xlabel('False Positive Rate');","metadata":{"execution":{"iopub.status.busy":"2023-10-25T12:38:42.333729Z","iopub.execute_input":"2023-10-25T12:38:42.334244Z","iopub.status.idle":"2023-10-25T12:38:42.684281Z","shell.execute_reply.started":"2023-10-25T12:38:42.334204Z","shell.execute_reply":"2023-10-25T12:38:42.682795Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"img = Image.open(\"/kaggle/input/UBC-OCEAN/train_thumbnails/10077_thumbnail.png\")\nprint(\"the image size is {}\".format(img.size))\ndisplay(img)","metadata":{"execution":{"iopub.status.busy":"2023-10-25T12:39:01.681425Z","iopub.execute_input":"2023-10-25T12:39:01.681909Z","iopub.status.idle":"2023-10-25T12:39:03.484523Z","shell.execute_reply.started":"2023-10-25T12:39:01.681872Z","shell.execute_reply":"2023-10-25T12:39:03.483141Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#center of image\nleft = int(img.size[0]/2-224/2)\nupper = int(img.size[1]/2-100/2)\nright = left +224\nlower = upper + 100\nimg_cropped = img.crop((left, upper,right,lower))\nprint(img_cropped.size)\nplt.imshow(np.asarray(img_cropped))","metadata":{"execution":{"iopub.status.busy":"2023-10-25T12:39:14.887429Z","iopub.execute_input":"2023-10-25T12:39:14.888251Z","iopub.status.idle":"2023-10-25T12:39:15.271842Z","shell.execute_reply.started":"2023-10-25T12:39:14.888212Z","shell.execute_reply":"2023-10-25T12:39:15.270234Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"Img = Image.open(\"/kaggle/input/UBC-OCEAN/train_images/10077.png\")\nprint(\"the image size is {}\".format(Img.size))","metadata":{"execution":{"iopub.status.busy":"2023-10-25T12:39:20.569879Z","iopub.execute_input":"2023-10-25T12:39:20.570339Z","iopub.status.idle":"2023-10-25T12:39:20.591441Z","shell.execute_reply.started":"2023-10-25T12:39:20.570286Z","shell.execute_reply":"2023-10-25T12:39:20.590053Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#center of image\nleft = int(Img.size[0]/2-1000/2)\nupper = int(Img.size[1]/2-1000/2)\nright = left +1000\nlower = upper + 1000\nImg_cropped = Img.crop((left, upper,right,lower))\n#Img_cropped = Img.crop((40000,20000,43000,22210))\nprint(Img_cropped.size)\nplt.imshow(np.asarray(Img_cropped))","metadata":{"_kg_hide-input":true,"execution":{"iopub.status.busy":"2023-10-25T12:39:27.711962Z","iopub.execute_input":"2023-10-25T12:39:27.713559Z","iopub.status.idle":"2023-10-25T12:41:00.194157Z","shell.execute_reply.started":"2023-10-25T12:39:27.713509Z","shell.execute_reply":"2023-10-25T12:41:00.192818Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def add_image(T_dataframe):\n    image_list = []\n    \n    for img_id in tqdm(T_dataframe.index):\n        img = get_image2(img_id)\n        \n        image_list.append(img)\n      \n    image_matrix = np.array(image_list)\n    return image_matrix\n\ndef add_image1(T_dataframe):\n    image_list = []\n    \n    for img_id in tqdm(T_dataframe.index):\n        img = get_image3(img_id)\n        \n        image_list.append(img)\n      \n    image_matrix = np.array(image_list)\n    return image_matrix\n\n\ndef add_Image(T_dataframe):\n    image_list = []\n    \n    for img_id in tqdm(T_dataframe.index):\n        img = get_Image(img_id)\n        \n        image_list.append(img)\n      \n    image_matrix = np.array(image_list)\n    return image_matrix\n","metadata":{"execution":{"iopub.status.busy":"2023-10-25T13:14:44.434478Z","iopub.execute_input":"2023-10-25T13:14:44.434932Z","iopub.status.idle":"2023-10-25T13:14:44.443994Z","shell.execute_reply.started":"2023-10-25T13:14:44.434901Z","shell.execute_reply":"2023-10-25T13:14:44.442636Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_tumor_matrix = add_image(df_tumor)\ndf_ntumor_matrix = add_image1(df_ntumor)\n","metadata":{"execution":{"iopub.status.busy":"2023-10-25T13:14:49.746551Z","iopub.execute_input":"2023-10-25T13:14:49.746996Z","iopub.status.idle":"2023-10-25T13:22:44.17193Z","shell.execute_reply.started":"2023-10-25T13:14:49.746966Z","shell.execute_reply":"2023-10-25T13:22:44.170607Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_ntumorcropp_matrix = add_Image(df_ntumorcropp)","metadata":{"execution":{"iopub.status.busy":"2023-10-25T13:32:02.388644Z","iopub.execute_input":"2023-10-25T13:32:02.389095Z","iopub.status.idle":"2023-10-25T13:39:26.786349Z","shell.execute_reply.started":"2023-10-25T13:32:02.389061Z","shell.execute_reply":"2023-10-25T13:39:26.781073Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"im = df_tumor_matrix\nfig, axes = plt.subplots(5, 5, figsize=(7, 6), sharex=True, sharey=True)\nax = axes.ravel()\nfor i in range(0,25):\n    ax[i].imshow(im[i])\n    ax[i].set_title(\"label:{}\".format(df_tumor.iloc[i,0]))\n    \n     \n    \nfor a in ax.ravel():\n    a.axis('off')\n    \n       \nfig.tight_layout()","metadata":{"execution":{"iopub.status.busy":"2023-10-25T13:24:27.906546Z","iopub.execute_input":"2023-10-25T13:24:27.907239Z","iopub.status.idle":"2023-10-25T13:24:36.656566Z","shell.execute_reply.started":"2023-10-25T13:24:27.907195Z","shell.execute_reply":"2023-10-25T13:24:36.655299Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"imN = df_ntumor_matrix\nfig, axes = plt.subplots(5, 5, figsize=(7, 6), sharex=True, sharey=True)\nax = axes.ravel()\nfor i in range(0,25):\n    ax[i].imshow(imN[i])\n    ax[i].set_title(\"label:{}\".format(df_ntumor.iloc[i,0]))\n    \n     \n    \nfor a in ax.ravel():\n    a.axis('off')\n    \n       \nfig.tight_layout()","metadata":{"execution":{"iopub.status.busy":"2023-10-25T13:25:49.400272Z","iopub.execute_input":"2023-10-25T13:25:49.400761Z","iopub.status.idle":"2023-10-25T13:25:57.77809Z","shell.execute_reply.started":"2023-10-25T13:25:49.400717Z","shell.execute_reply":"2023-10-25T13:25:57.776801Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"imcropped = df_ntumorcropp_matrix\nfig, axes = plt.subplots(3, 3, figsize=(7, 6), sharex=True, sharey=True)\nax = axes.ravel()\nfor i in range(0,9):\n    ax[i].imshow(imcropped[i])\n    ax[i].set_title(\"label:{}\".format(df_ntumorcropp.iloc[i,0]))\n    \n     \n    \nfor a in ax.ravel():\n    a.axis('off')\n    \n       \nfig.tight_layout()","metadata":{"execution":{"iopub.status.busy":"2023-10-25T13:39:26.792884Z","iopub.execute_input":"2023-10-25T13:39:26.793318Z","iopub.status.idle":"2023-10-25T13:39:29.923308Z","shell.execute_reply.started":"2023-10-25T13:39:26.793283Z","shell.execute_reply":"2023-10-25T13:39:29.922306Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"for i in range(0,1):\n     plt.imshow(df_tumor_matrix[i])\n     \n     plt.show()","metadata":{"execution":{"iopub.status.busy":"2023-10-25T13:40:40.082281Z","iopub.execute_input":"2023-10-25T13:40:40.082719Z","iopub.status.idle":"2023-10-25T13:40:40.47895Z","shell.execute_reply.started":"2023-10-25T13:40:40.082686Z","shell.execute_reply":"2023-10-25T13:40:40.477661Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.imshow(df_ntumor_matrix[0])\nplt.show()\n","metadata":{"execution":{"iopub.status.busy":"2023-10-25T13:41:25.121983Z","iopub.execute_input":"2023-10-25T13:41:25.122475Z","iopub.status.idle":"2023-10-25T13:41:25.540543Z","shell.execute_reply.started":"2023-10-25T13:41:25.122439Z","shell.execute_reply":"2023-10-25T13:41:25.539451Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def get_image (row_id, root=\"/kaggle/input/UBC-OCEAN/train_images\"):\n    \"\"\"\n    Converts an image number into the file path where the image is located,\n    opens the image, return the image as numpy array.\n    \n    \"\"\"\n    filename = \"{}.png\".format(row_id)\n    file_path = os.path.join(root, filename)\n    img = Image.open(file_path)\n    new_size = (2000,2000)\n    img = img.resize(new_size)\n    return np.array(img)\n\nTumorImg = train_photodf_index[train_photodf_index.is_tma == True].index[24]\nNonTumorImg = train_photodf_index[train_photodf_index.is_tma == False].index[24]\n","metadata":{"execution":{"iopub.status.busy":"2023-10-25T13:40:05.981296Z","iopub.execute_input":"2023-10-25T13:40:05.981747Z","iopub.status.idle":"2023-10-25T13:40:06.019Z","shell.execute_reply.started":"2023-10-25T13:40:05.981708Z","shell.execute_reply":"2023-10-25T13:40:06.017442Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#plt.imshow(get_image(TumorImg))\n#plt.show()","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#plt.imshow(get_image(NonTumorImg))\n#plt.show()","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#TumorImg","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#NonTumorImg","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Tumor = get_image(TumorImg)\n#print(Tumor.shape)\n#GrayTumor = rgb2gray(Tumor)\n#plt.imshow(GrayTumor, cmap = mpl.cm.gray)\n#print(GrayTumor.shape)","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#NonTumor = get_image(NonTumorImg)\n#print(NonTumor.shape)\n#GrayNonTumor = rgb2gray(NonTumor)\n#plt.imshow(GrayNonTumor, cmap = mpl.cm.gray)\n#print(GrayNonTumor.shape)","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#hog_features, hog_image = hog(GrayTumor,\n                              #visualize=True,\n                              #block_norm='L2-Hys',\n                             # pixels_per_cell=(16,16))\n#plt.imshow(hog_image)","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#plt.imshow(hog_image, cmap=mpl.cm.gray)","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Tumor_features = create_features(Tumor)\n#print(\"Tumor features shape:\",Tumor_features.shape)\n\n#NonTumor_features = create_features(NonTumor)\n#print(\"NonTumor features shape:\", NonTumor_features.shape)","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#def create_feature_matrix3(T_dataframe):\n   # features_list = []\n    \n    \n    \n  #  for img_id in tqdm(T_dataframe.index[0:50]):\n      #  img = get_image2(img_id)\n      #  image_features = create_features(img)\n      #  features_list.append(image_features)\n      \n   # feature_matrix = np.array(features_list)\n   # return feature_matrix\n","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"trusted":true},"execution_count":null,"outputs":[]}]}