From 65e084556dca3458fb4cd893e6854cd67bda3625 Mon Sep 17 00:00:00 2001 From: BinarySandia04 Date: Thu, 21 May 2026 14:15:14 +0200 Subject: [PATCH] update --- skin_cancer_classification.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/skin_cancer_classification.py b/skin_cancer_classification.py index 7d02f0f..eddbe98 100644 --- a/skin_cancer_classification.py +++ b/skin_cancer_classification.py @@ -23,14 +23,11 @@ Original file is located at | mel | Melanoma | Malignant | | akiec | Actinic keratoses / Bowen's disease | Benign | -## 0. Requirements +## 1. Requirements and dataset download """ -# !pip install pandas numpy matplotlib seaborn pillow scikit-learn tensorflow - -"""## 1. Download dataset""" - -# !pip install --upgrade kagglehub[pandas-datasets,hf-datasets] +import sys +IN_COLAB = 'google.colab' in sys.modules import kagglehub @@ -52,10 +49,14 @@ import seaborn as sns from PIL import Image +# Source - https://stackoverflow.com/a/53586419 +# Posted by korakot, modified by community. See post 'Timeline' for change history +# Retrieved 2026-05-21, License - CC BY-SA 4.0 + """### Loading dataset""" # Path to your dataset folder -dataset_path = "/kaggle/input/skin-cancer-mnist-ham10000" +dataset_path = path # Metadata file metadata_path = os.path.join(dataset_path, "HAM10000_metadata.csv") @@ -312,6 +313,8 @@ val_generator = val_datagen.flow_from_dataframe( I will compile the model using the Adam optimizer, binary cross-entropy loss (suitable for binary classification), and track accuracy as a metric. """ + + from tensorflow.keras.optimizers import Adam model.compile(optimizer=Adam(learning_rate=0.0001), loss='binary_crossentropy', metrics=['accuracy'])