Neural network model dedicated to the classification of cancer types a patient is likely to have.
Find a file
2026-01-11 14:59:11 +02:00
imgs Update presentation slides 2025-10-29 08:45:25 +02:00
plots Add accuracy plot 2025-10-29 12:02:51 +02:00
presentation Update presentation slides 2025-10-29 08:45:25 +02:00
scripts Fix script bug and cleanup 2025-10-29 22:53:51 +02:00
utils use pretty names 2025-10-28 20:28:29 +02:00
.gitignore include results 2025-10-28 15:36:06 +02:00
cancer-risk-factors.csv add cancer dataset 2025-10-24 16:29:28 +02:00
kmeans.py Fix script bug and cleanup 2025-10-29 22:53:51 +02:00
knn.py Fix script bug and cleanup 2025-10-29 22:53:51 +02:00
main.py Fix script bug and cleanup 2025-10-29 22:53:51 +02:00
plot-results.py Add accuracy plot 2025-10-29 12:02:51 +02:00
README.md Update README.md 2026-01-11 14:59:11 +02:00
report.pdf Update report 2025-10-29 23:32:34 +02:00
requirements.txt Update scripts 2025-10-28 18:52:42 +02:00
results-tuning.csv freshly generated results (reproducible) 2025-10-28 20:42:54 +02:00

CSC4025Z Artificial Intelligence Assignment 2: Neural Networks

Neural network model dedicated to the classification of cancer types a patient is likely to have.

Requirements

  • Python (tested with version 3.13.7)
  • torch (tested with version 2.9.0)
  • pandas
  • scikit-learn (tested with version 1.7.2)
  • tqdm
  • matplotlib (for plot-results.py)
  • seaborn (for plot-results.py)

Note: Please ensure bash shell is used. All above listed requirements will be automatically installed when using ./install.sh.

Usage

  1. Run ./scripts/install.sh. This will create the venv for you and install all dependencies.
  2. Run ./scripts/run-baseline.sh. This will run ./kmeans.py and ./knn.py for you and execute the baseline programs.
  3. Run ./scripts/run-main.sh. This will run ./main.py for you and execute the neural network program with optimal hyper-parameters.
  4. Run ./scripts/automate-tuning.sh. This will run ./main.py --hyperparameter_search for you and execute the neural network program with the automated hyperparameter search. This might take a while depending on your device's performance. Output is written to results-tuning.csv
  5. Run ./scripts/plot-results.sh. This will run ./plot_results.py for you and generate plots.

Run ./scripts/cleanup.sh when complete to remove generated files such as the virtual environment and caches.

Optional arguments can be given to ./scripts/run-main.sh. To see all available options, run ./scripts/run-main.sh --help.

Note: Python virtual environment setup varies by operating system environment. Please manually set up the virtual environment and install the dependencies listed above if automated creation from the below steps fails. You can then manually invoke the Python scripts (such as main.py) instead of using the venv helper scripts. Using accelerator devices such as GPUs may also require manual setup to install the required libraries, such as ROCm for AMD GPUs or CUDA for NVIDIA GPUs.

Authors and acknowledgment

  • Unays Bhad (BHDUNA001)
  • Channing Bellamy (BLLCHA013)
  • Raaziq Parkar (PRKRAA002)

GitLab Repository

https://gitlab.cs.uct.ac.za/bllcha013/csc4025za2