Exercises & Solutions
Practice materials from the TA sessions
Schedule
- Weeks 4-10: Four exercises (~2 weeks each)
- Week 11: Project structure & debugging
- Week 12: Reports, documentation & hyperparameter tuning
- Weeks 13+: Project work
Exercise 1: Contact Manager (Basics)
Python fundamentals, functions, file I/O
Build a command-line contact manager application. Practice working with dictionaries, file handling (JSON), user input, and structuring code into functions.
Exercise 2: Contact Manager (OOP)
Object-oriented programming, classes, refactoring
Refactor your contact manager using object-oriented principles. Learn about classes, methods, encapsulation, and how to structure larger applications.
Exercise 3: ML Regression & Classification
Scikit-learn, model training, evaluation
Introduction to machine learning with scikit-learn. Train regression and classification models, evaluate performance, and understand the ML workflow.
Exercise 4: Neural Networks
Deep learning basics, MLPClassifier, hyperparameters
Build and train neural networks using scikit-learn's MLPClassifier. Understand layers, activation functions, and hyperparameter tuning.
Example: Iris Classification Project
Project structure, model comparison, reproducibility
A complete example project demonstrating proper structure for your final project. Compares Random Forest, KNN, and Logistic Regression on the Iris dataset with proper organization: src/ modules, main.py entry point, and reproducible results.