{"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":"markdown","source":"## KÜTÜPHANELER","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19"}},{"cell_type":"code","source":"import os\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sn\nimport cv2\nimport tifffile","metadata":{"execution":{"iopub.status.busy":"2023-10-07T10:12:35.680582Z","iopub.execute_input":"2023-10-07T10:12:35.681050Z","iopub.status.idle":"2023-10-07T10:12:35.687534Z","shell.execute_reply.started":"2023-10-07T10:12:35.681021Z","shell.execute_reply":"2023-10-07T10:12:35.686203Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## YOL TANIMLAMA","metadata":{}},{"cell_type":"code","source":"BASE_PATH = r\"/kaggle/input/hubmap-kidney-segmentation\"\nTRAIN_PATH = os.path.join(BASE_PATH, \"train\") # yolun sonuna \\train ekledi\n\nprint(os.listdir(BASE_PATH)) #içindeki dosyların isimlerini yazdırıyor","metadata":{"execution":{"iopub.status.busy":"2023-10-07T10:12:35.695471Z","iopub.execute_input":"2023-10-07T10:12:35.696986Z","iopub.status.idle":"2023-10-07T10:12:35.704655Z","shell.execute_reply.started":"2023-10-07T10:12:35.696948Z","shell.execute_reply":"2023-10-07T10:12:35.703229Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### train.csv içerisinde resimlerin ID'leri ve nesnelere yönelik olan mask'ların RLE kodunu içerir.","metadata":{}},{"cell_type":"code","source":"df_train = pd.read_csv(\n    os.path.join(BASE_PATH, \"train.csv\")\n)\ndf_train","metadata":{"execution":{"iopub.status.busy":"2023-10-07T10:12:35.709063Z","iopub.execute_input":"2023-10-07T10:12:35.709489Z","iopub.status.idle":"2023-10-07T10:12:36.216004Z","shell.execute_reply.started":"2023-10-07T10:12:35.709460Z","shell.execute_reply":"2023-10-07T10:12:36.214597Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## SUBMISSION DF","metadata":{"execution":{"iopub.status.busy":"2023-10-04T21:20:25.245757Z","iopub.execute_input":"2023-10-04T21:20:25.246115Z","iopub.status.idle":"2023-10-04T21:20:25.251325Z","shell.execute_reply.started":"2023-10-04T21:20:25.246071Z","shell.execute_reply":"2023-10-04T21:20:25.250015Z"}}},{"cell_type":"markdown","source":"\"Submission\" İngilizce'de \"sunum\" veya \"teslim etme\" anlamına gelir. Bu bağlamda, \"Submission df\" genellikle bir veri çerçevesini ifade eder. Bu veri çerçevesi, genellikle bir yarışma veya proje için sonuçları veya tahminleri içeren verileri içerir.\n\nÖrneğin, bir veri bilimi yarışmasında, katılımcılar genellikle belirli bir veri seti üzerinde çalışarak bir model oluştururlar. Sonrasında, bu modeli kullanarak belirli bir metrik veya kritere göre tahminlerde bulunurlar. Bu tahminler daha sonra bir \"submission\" dosyasında toplanır ve değerlendirme için organizatörlere veya platforma gönderilir.","metadata":{}},{"cell_type":"code","source":"df_sub = pd.read_csv(\n    os.path.join(BASE_PATH, \"sample_submission.csv\"))\ndf_sub","metadata":{"execution":{"iopub.status.busy":"2023-10-07T10:12:36.218455Z","iopub.execute_input":"2023-10-07T10:12:36.219494Z","iopub.status.idle":"2023-10-07T10:12:36.234411Z","shell.execute_reply.started":"2023-10-07T10:12:36.219454Z","shell.execute_reply":"2023-10-07T10:12:36.233148Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## ÖRNEKLEM MİKTARLARI","metadata":{}},{"cell_type":"code","source":"print(f\"Number of train images: {df_train.shape[0]}\")\nprint(f\"Number of train images: {df_sub.shape[0]}\")","metadata":{"execution":{"iopub.status.busy":"2023-10-07T10:12:36.236681Z","iopub.execute_input":"2023-10-07T10:12:36.237073Z","iopub.status.idle":"2023-10-07T10:12:36.242526Z","shell.execute_reply.started":"2023-10-07T10:12:36.237037Z","shell.execute_reply":"2023-10-07T10:12:36.241762Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Train and Test MetaData","metadata":{}},{"cell_type":"markdown","source":"\"Metadata,\" veriler hakkında bilgi sağlayan verilerdir. Temelde, verilerin nitelikleri, özellikleri ve yapıları hakkında bilgi veren bilgilerdir. Meta (önceki) ve data (veri) kelimelerinin birleşimiyle oluşmuştur.\n\nÖrneğin, bir fotoğraf dosyasının metadata bilgileri, fotoğrafın çekildiği tarih, enlem ve boylam koordinatları, kamera modeli, diyafram ayarı gibi bilgileri içerir. Bu bilgiler, fotoğrafın içeriği hakkında ek bilgiler sunar.","metadata":{}},{"cell_type":"code","source":"df_info = pd.read_csv(\n    os.path.join(BASE_PATH, \"HuBMAP-20-dataset_information.csv\"))\ndf_info.sample(3) #bunun içine yazılan sayı rastgele kaç örneğin yazılacapını belirtiyor.","metadata":{"execution":{"iopub.status.busy":"2023-10-07T10:12:36.244536Z","iopub.execute_input":"2023-10-07T10:12:36.245191Z","iopub.status.idle":"2023-10-07T10:12:36.275321Z","shell.execute_reply.started":"2023-10-07T10:12:36.245162Z","shell.execute_reply":"2023-10-07T10:12:36.274535Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":" ## UTILITY FUNC.","metadata":{}},{"cell_type":"markdown","source":"Yapay zeka alanında \"utility function\" veya \"yarar fonksiyonu\" genellikle bir karar problemi için bir çözümün ne kadar \"iyi\" veya \"tercih edilir\" olduğunu ölçen bir fonksiyondur. Bu, bir ajanın (örneğin, bir yapay zeka sistemi) belirli bir görevi ne kadar başarıyla gerçekleştirdiğini değerlendirmek için kullanılır.\n\nSonuç olarak, yarar fonksiyonu, bir ajanın davranışını yönlendirmek ve en iyi sonuçları elde etmek için kullanılan bir araçtır. Bu fonksiyon, bir ajanın hedeflerini ve tercihlerini temsil eder ve bu hedeflere ulaşmak için en iyi eylemi seçme sürecini yönlendirir.","metadata":{}},{"cell_type":"code","source":"def rle2mask(mask_rle, shape):\n    s = mask_rle.split() #mask_rle parçalanıyor ve s adındaki bir listeye kaydediliyor.\n    \n        #np.assary(x, dtype=int) = x elemanını int tipinde bir numpy dizisine dönüştürür.\n        #s[0:][::2] liste içine 0'dan başlayarak 2şerli artarak elemanları seçer (0,2,4,...)\n    starts, lengths = [\n        np.asarray(x, dtype=int) for x in (s[0:][::2], s[1:][::2])\n    ]\n     # burda starts ve lengths adında iki adet liste oluşturuldu.\n    starts -= 1\n    ends = starts + lengths\n    \n    img = np.zeros(shape[0] * shape[1], dtype=np.uint8) #resim boyutu kadar bir sıfır matrisi yani boş ekran yaratır.\n    \n    for lo, hi in zip(starts, ends):\n        img[lo : hi] = 1\n    return img.reshape(shape).T #resmin lo indexinden ho indexine kadar olan kısmını 1 (beyaz) yapar.\n        #ISLEV : img adında bir numpy dizisi oluşturmak ve statrs ile ends arası alanı beyaza boyamaktır.\n    \n\n#---------------------------------------------------------------------------#\n\ndef read_image(image_id, scale=None, verbose=1):\n    #image_id = resmin kimliği\n    #scale = görüntünün boyutlandırlacağı ölçek\n    #verbose = ekrana yazdırma durumu\n    \n    image = tifffile.imread( #tiff kütüphanesi ile resim okunuyor.\n        os.path.join(BASE_PATH,f\"train/{image_id}.tiff\"))\n    print(image.shape)\n    \n    if len(image.shape) == 5 or image.shape[0] == 3: #image'nin boyut sayısı 5 ve renk kanalaı sayısı 3 ise:\n        #image.squeeze() =  Eğer image dizisi bir veya daha fazla boyutta boyutu 1 olan ekstra boyutlara sahipse, bu boyutları kaldırır.\n        #.transpose(1,2,3) = dizinin boyutlarını yeniden düzenler. Bu işlem görüntülerin farklı boyutlara dönüştürülmesi işleminde kullanılır.\n        image = image.squeeze().transpose(1, 2, 0)\n    mask = rle2mask(\n        df_train[df_train[\"id\"] == image_id][\"encoding\"].values[0], \n        (image.shape[1], image.shape[0])\n    )\n        \n    if verbose: # verbose True ise bu blok çalışır\n        print(f\"[{image_id}] Image shape: {image.shape}\") # id ve shape yazdırılır.\n        \n    if scale: #scale değeri True yani sıfır olmayan bir değerse bu blok çalışır\n        # Burada, (image.shape[1]//scale, image.shape[0]//scale) ifadesi, \n        # genişlik ve yüksekliği scale değerine göre küçültülmüş yeni boyutları oluşturur.\n        new_size = (image.shape[1] // scale, image.shape[0] // scale)\n        image = cv2.resize(image, new_size)\n        mask = cv2.resize(mask, new_size)\n        \n    if verbose:\n        print(f\"[{image_id}] Resized Image Shape: {image.shape}\")\n        \n    return image, mask\n    #ISLEV : görüntüyü okur gerekli durumlarda döndürür ve boyutlandırmasını ayarlar. Ekrana yazdırır.\n#---------------------------------------------------------------------------#\n\ndef read_test_image(image_id, scale = None, verbose = 1):\n    image = tifffile.imread(\n                os.path.join(BASE_PATH, f\"test/{image_id}.tiff\")\n        )\n    if len(image.shape) == 5 or image.shape[0] == 3:\n        image = image.squeeze().transpose(1,2,0)\n        \n    if verbose:\n        print(f\"[{image_id}] Image Shape: {image.shape[0]}\")\n        \n    if scale:\n        new_size = (image.shape[1] // scale, image.shape[0] // scale)\n        image = cv2.resize(image, new_size)\n        \n        if verbose:\n            print(f\"[{image_id}] Resized Image Shape: {image.shape}\")\n    return image \n#---------------------------------------------------------------------------#                             \n\ndef plot_image_and_mask(image, mask, image_id):\n    #image = resim ; mask = maske ; image_id = resmin kimliği\n    plt.figure(figsize = (16, 10))\n    \n    plt.subplot(1,3,1) #1 satır ve 3 stunlu bir ızdara oluşturur.\n    plt.imshow(image)\n    plt.title(f\"Image {image_id}\", fontsize = 18)\n    \n    plt.subplot(1, 3, 2)\n    plt.imshow(image)\n    plt.imshow(mask, cmap=\"hot\", alpha=0.5)\n    plt.title(f\"Image {image_id} + mask\", fontsize=18) \n    \n    plt.subplot(1,3,2)\n    plt.imshow(image)\n    plt.imshow(mask, cmap = \"hot\", alpha = 0.5)\n    plt.title(f\"mask:\",fontsize=18)\n    \n    plt.show()\n    #ISLEV : görüntü ve maskeyi yan yana gösteren bir grafik yaratır.\n\n#---------------------------------------------------------------------------#\n\ndef plot_grid_image_with_mask(image, mask):\n    plt.figure(figsize = (16,16))\n    \n    w_len = image.shape[0]\n    h_len = image.shape[1]\n    \n    min_len = min(w_len, h_len)\n    w_start = (w_len - min_len) // 2\n    h_start = (h_len - min_len) // 2\n    \n    plt.imshow(image[w_start : w_start + min_len, h_start : h_start + min_len])\n    plt.imshow(\n        mask[w_start : w_start + min_len, h_start : h_start + min_len], cmap=\"hot\", alpha=0.5,\n    )\n    plt.axis(\"off\")\n            \n    plt.show()\n\n#---------------------------------------------------------------------------#\n\ndef plot_slice_image_and_mask(image, mask, start_h, end_h, start_w, end_w):\n    plt.figure(figsize = (16,5))\n    \n    w_len = image.shape[0] # x verisini genişlik değeri olarak tanımladık\n    h_len = image.shape[1] # y verisini uzunluk olarak tanımladık\n    \n    min_len = min(w_len, h_len) # uzunluk ve genişlik içerisinden en küçük değerleri min_len'e atadık\n    w_start = (w_len - min_len) // 2\n    h_start = (h_len - min_len) // 2\n    \n    plt.imshow(image[w_start: w_start + min_len, h_start: h_start +min_len]) #resmin gösterilecek kısmını ayarlıyoruz.\n    plt.imshow(mask[w_start: w_start + min_len, h_start :h_start + min_len], cmap=\"hot\", alpha =0.5)\n    \n    plt.axis(\"off\")\n    plt.show\n    \ndef plot_slice_image_and_mask(image, mask, start_h, end_h, start_w, end_w):\n    plt.figure(figsize = (16,5))\n    \n    sub_image = image[start_h:end_h, start_w:end_w, :]\n    sub_mask = mask[start_h:end_h, start_w:end_w]\n    \n    plt.subplot(1, 3, 1)\n    plt.imshow(sub_image)\n    plt.axis(\"off\")\n    \n    plt.subplot(1, 3, 2)\n    plt.imshow(sub_image)\n    plt.imshow(sub_mask, cmap=\"hot\", alpha=0.5)\n    plt.axis(\"off\")\n    \n    plt.subplot(1, 3, 3)\n    plt.imshow(sub_mask, cmap=\"hot\")\n    plt.axis(\"off\")\n    \n    plt.show()","metadata":{"execution":{"iopub.status.busy":"2023-10-07T10:12:36.276956Z","iopub.execute_input":"2023-10-07T10:12:36.277229Z","iopub.status.idle":"2023-10-07T10:12:36.299634Z","shell.execute_reply.started":"2023-10-07T10:12:36.277204Z","shell.execute_reply":"2023-10-07T10:12:36.298848Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"small_ids = [\n    \"2f6ecfcdf\", \"b2dc8411c\", \"4ef6695ce\",\"e79de561c\"\n] # bazı resimlerin id numaraları\nsmall_images = []\nsmall_masks = []\n\nfor small_id in small_ids:\n    tmp_image, tmp_mask = read_image(small_id, scale = 20, verbose =1)\n    small_images.append(tmp_image)\n    small_masks.append(tmp_mask)","metadata":{"execution":{"iopub.status.busy":"2023-10-07T10:12:36.301213Z","iopub.execute_input":"2023-10-07T10:12:36.301598Z","iopub.status.idle":"2023-10-07T10:15:02.480518Z","shell.execute_reply.started":"2023-10-07T10:12:36.301556Z","shell.execute_reply":"2023-10-07T10:15:02.479227Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## TRAIN IMAGE","metadata":{}},{"cell_type":"code","source":"plt.figure(figsize = (16, 16)) # oluşturulacak figurun boyu ve genişliği belirlendi\nfor ind, (tmp_id, tmp_image) in enumerate(zip(small_ids, small_images)): #iki listeli bir döngü\n    \n    #plt.subplot(3, 3, ind+1): Bu satır, 3x3 bir ızgara içindeki belirli bir konuma bir alt grafik yerleştirir. \n    #ind+1 ifadesi, alt grafik numarasını belirtir ve ind değerini 1 artırır.\n    plt.subplot(3, 3, ind+1)\n    \n    plt.imshow(tmp_image)\n    plt.axis(\"off\")","metadata":{"execution":{"iopub.status.busy":"2023-10-07T10:15:02.482100Z","iopub.execute_input":"2023-10-07T10:15:02.482987Z","iopub.status.idle":"2023-10-07T10:15:04.403768Z","shell.execute_reply.started":"2023-10-07T10:15:02.482958Z","shell.execute_reply":"2023-10-07T10:15:04.402620Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize = (16,16))\nfor ind, (tmp_id, tmp_images, tmp_mask) in enumerate(zip(small_ids,small_images, small_masks)):\n    plt.subplot(3, 3, ind+1)\n    plt.imshow(tmp_images)\n    plt.imshow(tmp_mask, cmap = \"hot\", alpha = 0.5)\n    plt.axis(\"off\")","metadata":{"execution":{"iopub.status.busy":"2023-10-07T10:15:04.405195Z","iopub.execute_input":"2023-10-07T10:15:04.405500Z","iopub.status.idle":"2023-10-07T10:15:07.187066Z","shell.execute_reply.started":"2023-10-07T10:15:04.405475Z","shell.execute_reply":"2023-10-07T10:15:07.185913Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"small_ids = [\n    \"2ec3f1bb9\", \"3589adb90\", \"57512b7f1\", \"aa05346ff\", \"d488c759a\",\n]\nsmall_images = []\n\nfor small_id in small_ids:\n    tmp_image = read_test_image(small_id, scale=20, verbose=1)\n    small_images.append(tmp_image)","metadata":{"execution":{"iopub.status.busy":"2023-10-07T10:15:07.188423Z","iopub.execute_input":"2023-10-07T10:15:07.188737Z","iopub.status.idle":"2023-10-07T10:16:38.739629Z","shell.execute_reply.started":"2023-10-07T10:15:07.188712Z","shell.execute_reply":"2023-10-07T10:16:38.737719Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## TEST IMAGES","metadata":{}},{"cell_type":"code","source":"plt.figure(figsize = (16, 11))\n\nfor ind, (tmp_id, tmp_image) in enumerate(zip(small_ids, small_images)):\n    plt.subplot(2,3, ind+1)\n    plt.imshow(tmp_image)\n    plt.axis(\"off\")","metadata":{"execution":{"iopub.status.busy":"2023-10-07T10:16:38.742725Z","iopub.execute_input":"2023-10-07T10:16:38.743500Z","iopub.status.idle":"2023-10-07T10:16:41.762086Z","shell.execute_reply.started":"2023-10-07T10:16:38.743466Z","shell.execute_reply":"2023-10-07T10:16:41.760711Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### 0486052bb","metadata":{}},{"cell_type":"code","source":"image_id = \"0486052bb\"\nimage, mask = read_image(image_id, 2)","metadata":{"execution":{"iopub.status.busy":"2023-10-07T10:16:41.764296Z","iopub.execute_input":"2023-10-07T10:16:41.764788Z","iopub.status.idle":"2023-10-07T10:17:02.150771Z","shell.execute_reply.started":"2023-10-07T10:16:41.764718Z","shell.execute_reply":"2023-10-07T10:17:02.149638Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plot_image_and_mask(image, mask, image_id)","metadata":{"execution":{"iopub.status.busy":"2023-10-07T10:17:02.152133Z","iopub.execute_input":"2023-10-07T10:17:02.152680Z","iopub.status.idle":"2023-10-07T10:18:00.620841Z","shell.execute_reply.started":"2023-10-07T10:17:02.152651Z","shell.execute_reply":"2023-10-07T10:18:00.619460Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#resmin farklı bölümlerini inceleyeceğiz.\nplot_slice_image_and_mask(image, mask, 5000, 7500, 2500, 5000)\nplot_slice_image_and_mask(image, mask, 5250, 5720, 3500, 4000)\nplot_slice_image_and_mask(image, mask, 5375, 5575, 3650, 3850)","metadata":{"execution":{"iopub.status.busy":"2023-10-07T10:18:00.622672Z","iopub.execute_input":"2023-10-07T10:18:00.623128Z","iopub.status.idle":"2023-10-07T10:18:03.879583Z","shell.execute_reply.started":"2023-10-07T10:18:00.623090Z","shell.execute_reply":"2023-10-07T10:18:03.878186Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plot_grid_image_with_mask(image, mask)","metadata":{"execution":{"iopub.status.busy":"2023-10-07T10:18:03.881115Z","iopub.execute_input":"2023-10-07T10:18:03.881793Z","iopub.status.idle":"2023-10-07T10:18:35.559180Z","shell.execute_reply.started":"2023-10-07T10:18:03.881761Z","shell.execute_reply":"2023-10-07T10:18:35.557673Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## METADATA ANALİZİ","metadata":{}},{"cell_type":"code","source":"pd.read_json(\n    os.path.join(BASE_PATH, \"train/0486052bb-anatomical-structure.json\")\n)","metadata":{"execution":{"iopub.status.busy":"2023-10-07T10:21:22.933382Z","iopub.execute_input":"2023-10-07T10:21:22.933783Z","iopub.status.idle":"2023-10-07T10:21:22.974596Z","shell.execute_reply.started":"2023-10-07T10:21:22.933754Z","shell.execute_reply":"2023-10-07T10:21:22.973563Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pd.read_json(\n    os.path.join(BASE_PATH, \"train/0486052bb.json\")\n)","metadata":{"execution":{"iopub.status.busy":"2023-10-07T10:21:57.374841Z","iopub.execute_input":"2023-10-07T10:21:57.375228Z","iopub.status.idle":"2023-10-07T10:21:57.429093Z","shell.execute_reply.started":"2023-10-07T10:21:57.375203Z","shell.execute_reply":"2023-10-07T10:21:57.427818Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_info[\"split\"] = \"test\"\ndf_info.loc[df_info[\"image_file\"].isin(os.listdir(os.path.join(BASE_PATH,\"train\"))),\"split\"]","metadata":{"execution":{"iopub.status.busy":"2023-10-07T10:24:06.024362Z","iopub.execute_input":"2023-10-07T10:24:06.024942Z","iopub.status.idle":"2023-10-07T10:24:06.066289Z","shell.execute_reply.started":"2023-10-07T10:24:06.024904Z","shell.execute_reply":"2023-10-07T10:24:06.065353Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_info[\"area\"] = df_info[\"width_pixels\"] * df_info[\"height_pixels\"]","metadata":{"execution":{"iopub.status.busy":"2023-10-07T10:30:46.864133Z","iopub.execute_input":"2023-10-07T10:30:46.864695Z","iopub.status.idle":"2023-10-07T10:30:46.874021Z","shell.execute_reply.started":"2023-10-07T10:30:46.864661Z","shell.execute_reply":"2023-10-07T10:30:46.873111Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_info[\"area\"].head()","metadata":{"execution":{"iopub.status.busy":"2023-10-07T10:31:54.354402Z","iopub.execute_input":"2023-10-07T10:31:54.354929Z","iopub.status.idle":"2023-10-07T10:31:54.364909Z","shell.execute_reply.started":"2023-10-07T10:31:54.354889Z","shell.execute_reply":"2023-10-07T10:31:54.363739Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_info.head()","metadata":{"execution":{"iopub.status.busy":"2023-10-07T10:33:09.725010Z","iopub.execute_input":"2023-10-07T10:33:09.725470Z","iopub.status.idle":"2023-10-07T10:33:09.749066Z","shell.execute_reply.started":"2023-10-07T10:33:09.725441Z","shell.execute_reply":"2023-10-07T10:33:09.747635Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(16, 35))\n\nplt.subplot(6, 2, 1)\nsn.countplot(x=\"race\", hue=\"split\", data=df_info)\n\nplt.subplot(6, 2, 2)\nsn.countplot(x=\"ethnicity\", hue=\"split\", data=df_info)\n\nplt.subplot(6, 2, 3)\nsn.countplot(x=\"sex\", hue=\"split\", data=df_info)\n\nplt.subplot(6, 2, 4)\nsn.countplot(x=\"laterality\", hue=\"split\", data=df_info)\n\nplt.subplot(6, 2, 5)\nsn.histplot(x=\"age\", hue=\"split\", data=df_info)\n\nplt.subplot(6, 2, 6)\nsn.histplot(x=\"weight_kilograms\", hue=\"split\", data=df_info)\n\nplt.subplot(6, 2, 7)\nsn.histplot(x=\"height_centimeters\", hue=\"split\", data=df_info)\n\nplt.subplot(6, 2, 8)\nsn.histplot(x=\"bmi_kg/m^2\", hue=\"split\", data=df_info)\n\nplt.subplot(6, 2, 9)\nsn.histplot(x=\"percent_cortex\", hue=\"split\", data=df_info)\n\nplt.subplot(6, 2, 10)\nsn.histplot(x=\"percent_medulla\", hue=\"split\", data=df_info)\n\nplt.subplot(6, 2, 11)\nsn.histplot(x=\"area\", hue=\"split\", data=df_info);","metadata":{"execution":{"iopub.status.busy":"2023-10-07T10:33:11.260090Z","iopub.execute_input":"2023-10-07T10:33:11.260464Z","iopub.status.idle":"2023-10-07T10:33:13.563930Z","shell.execute_reply.started":"2023-10-07T10:33:11.260439Z","shell.execute_reply":"2023-10-07T10:33:13.562611Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}