This commit is contained in:
2026-05-21 14:15:14 +02:00
parent d218003b45
commit 65e084556d

View File

@@ -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'])