Skip to content

nicksmits1/COMP-551-ml-projects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

COMP 551 — Machine Learning Projects

Contributors: Nicolas Smits, Bassem Mikhail
Projects completed for COMP 551: Introduction to Machine Learning (McGill University).

This repository contains four end-to-end machine learning assignments covering regression, neural networks, computer vision, and transformer-based NLP. Each project includes clean, reproducible implementations with supporting experiments and analysis.


🧮 A2 — Regularization & Model Evaluation

Topic: Linear Regression with Radial Basis Functions

This project explored the relationship between model complexity, bias–variance tradeoffs, and regularization. A linear model was enhanced with Gaussian RBF features to capture nonlinear structure in synthetic data.
Key components:

  • Implementation of RBF feature generation
  • L1 (Lasso) and L2 (Ridge) regularization
  • Train/validation/test splitting
  • k-fold cross‑validation for hyperparameter selection
  • Analysis of underfitting vs. overfitting through learning curves

The assignment emphasized how regularization stabilizes training and improves generalization in high‑dimensional feature spaces.


🧠 A3 — Image Classification with Neural Networks

Datasets: OrganAMNIST (medical images)
Models: Scratch‑built MLP, CNN (PyTorch), ResNet (pretrained)

This project implemented and compared multiple neural architectures on grayscale medical image classification:

  • Multilayer Perceptron (from scratch)
    Built using NumPy with manual backprop and SGD
  • Convolutional Neural Network (PyTorch)
    Implemented using standard conv/pool blocks
  • ResNet Transfer Learning
    Fine‑tuning a pretrained model to evaluate benefits of learned visual representations

Experiments examined:

  • Architectural depth and width
  • Data preprocessing and augmentation
  • Regularization (dropout, weight decay)
  • Optimization strategies and convergence behavior

💬 A4 — Emotion Classification with LLMs

Dataset: GoEmotions (27 emotion labels)
Models: Naive Bayes, Softmax, Random Forest, XGBoost, BERT

This NLP project investigated approaches to emotion classification, comparing traditional ML baselines with transformer‑based language models.

Highlights:

  • Text cleaning, tokenization, and label preprocessing
  • Baseline classifiers using TF‑IDF features
  • Fine‑tuning BERT for multi‑label emotion detection
  • Exploration of attention mechanisms and contextual embeddings
  • Evaluation using macro/micro F1, precision, and recall

The results demonstrate the substantial performance advantage of pretrained transformers over classical bag‑of‑words methods for nuanced sentiment analysis.


📂 Repository Structure

COMP-551-ml-projects/
│
├── Assignment2/
│   └── ... code, figures, reports
├── Assignment3/
│   └── ... image models & analysis
├── Assignment4/
│   └── ... NLP models & BERT fine-tuning
└── README.md

About

Machine learning projects spanning regression, computer vision, and NLP. Includes RBF-based linear regression with regularization, MLP/CNN/ResNet models for OrganAMNIST classification, and traditional ML vs. BERT-based emotion classification on the GoEmotions dataset.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages