update
This commit is contained in:
@@ -23,14 +23,11 @@ Original file is located at
|
|||||||
| mel | Melanoma | Malignant |
|
| mel | Melanoma | Malignant |
|
||||||
| akiec | Actinic keratoses / Bowen's disease | Benign |
|
| akiec | Actinic keratoses / Bowen's disease | Benign |
|
||||||
|
|
||||||
## 0. Requirements
|
## 1. Requirements and dataset download
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# !pip install pandas numpy matplotlib seaborn pillow scikit-learn tensorflow
|
import sys
|
||||||
|
IN_COLAB = 'google.colab' in sys.modules
|
||||||
"""## 1. Download dataset"""
|
|
||||||
|
|
||||||
# !pip install --upgrade kagglehub[pandas-datasets,hf-datasets]
|
|
||||||
|
|
||||||
import kagglehub
|
import kagglehub
|
||||||
|
|
||||||
@@ -52,10 +49,14 @@ import seaborn as sns
|
|||||||
|
|
||||||
from PIL import Image
|
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"""
|
"""### Loading dataset"""
|
||||||
|
|
||||||
# Path to your dataset folder
|
# Path to your dataset folder
|
||||||
dataset_path = "/kaggle/input/skin-cancer-mnist-ham10000"
|
dataset_path = path
|
||||||
|
|
||||||
# Metadata file
|
# Metadata file
|
||||||
metadata_path = os.path.join(dataset_path, "HAM10000_metadata.csv")
|
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.
|
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
|
from tensorflow.keras.optimizers import Adam
|
||||||
|
|
||||||
model.compile(optimizer=Adam(learning_rate=0.0001), loss='binary_crossentropy', metrics=['accuracy'])
|
model.compile(optimizer=Adam(learning_rate=0.0001), loss='binary_crossentropy', metrics=['accuracy'])
|
||||||
|
|||||||
Reference in New Issue
Block a user