Week 10: Hands-on Deep Learning II

Lab

Overview

The second hands-on lab session on deep learning. In Week 9 the network predicted a number (regression). This week it answers a yes or no question: binary classification. You build a multilayer perceptron that classifies breast tumors as malignant or benign, and three things change compared with the earlier labs:

  • the output of the network is turned into a probability (logit and sigmoid),
  • the loss function becomes binary cross-entropy,
  • the evaluation uses the confusion matrix, precision, and recall, and you tune the decision threshold to trade false alarms against missed cancers.

How to run the lab in Google Colab

  1. Download the notebook and the dataset from the table below.
  2. Open colab.research.google.com, choose File, Upload notebook, and select the downloaded notebook.
  3. Choose Runtime, Run all. When the upload dialog appears, select the dataset file breast_cancer.csv from your computer.
  4. Read the text between the cells: it explains what each step does and why. Finish with the exercises at the end of the notebook.

No GPU is needed; everything runs on the CPU in under a minute.

Materials

Material Where
Lab 3 notebook lab03_classification_mlp.ipynb
Dataset breast_cancer.csv

Dataset citation: Wolberg, W., Mangasarian, O., Street, N., and Street, W. (1993). Breast Cancer Wisconsin (Diagnostic) [Dataset]. UCI Machine Learning Repository. https://doi.org/10.24432/C5DW2B.