This repository contains the complete set of practical assignments developed for the Artificial Intelligence course at the university. The work covers a wide spectrum of machine learning and deep learning paradigms — from classical supervised learning and ensemble methods to generative models and recurrent neural networks for time-series forecasting.
Each assignment is structured as a fully functional Jupyter notebook, complete with data preprocessing, model implementation, hyperparameter optimisation, performance evaluation, and visualisation. Together, they demonstrate a solid command of the theoretical foundations and practical implementation skills required in modern AI.
These assignments were designed to bridge the gap between theoretical AI concepts and hands-on implementation. The key learning outcomes addressed include:
- Implementing and evaluating classic ML algorithms (KNN, SVM, Gradient Boosting, XGBoost).
- Understanding and applying transfer learning and generative adversarial networks (GANs).
- Mastering deep learning for time-series using RNNs, LSTMs, and GRUs.
- Performing hyperparameter tuning, model interpretation, and feature importance analysis.
- Working with real‑world datasets and image data.
| Notebook | Topic | Key Techniques |
|---|---|---|
assignment1.ipynb |
Supervised Learning & Ensemble Methods | KNN, SVM, Gradient Boosting, XGBoost, GridSearchCV, SHAP, Feature Importance |
assignment2.ipynb |
Deep Learning for Vision – GANs & Transfer Learning | DCGAN, VGG16, Transfer Learning, Data Augmentation, Fine‑tuning |
assignment3.ipynb |
Time Series Forecasting with RNNs | RNN, LSTM, GRU, Bidirectional RNNs, Early Stopping, Learning Rate Scheduling |
Compare multiple classifiers on three benchmark datasets, optimise hyperparameters using cross‑validation, and interpret the best model using SHAP values.
- Iris – 3‑class flower classification (150 samples).
- Titanic – binary survival prediction (891 samples, pre‑processed).
- Telco Churn – binary customer churn prediction (7,043 samples).
- K‑Nearest Neighbours (KNN): Tuned number of neighbours and distance metrics.
- Support Vector Machine (SVM): Used RBF kernel; tuned
Candgammaparameters via GridSearchCV. - Gradient Boosting: Built with
GradientBoostingClassifier, optimised learning rate and tree depth. - XGBoost: The highlight of this assignment. Implemented with:
GridSearchCVovermax_depth,learning_rate,reg_lambda, andscale_pos_weight(to handle class imbalance).- Early stopping and evaluation on validation set.
- SHAP (SHapley Additive exPlanations): Generated beeswarm plots to identify the most influential features for churn prediction.
- Achieved >80% accuracy on Titanic and Telco churn; >95% on Iris.
- SHAP analysis provided transparent, business‑ready insights into customer churn drivers.
- Designed and trained a DCGAN (Deep Convolutional GAN) from scratch using Keras.
- Generator: Built with
Conv2DTransposelayers and LeakyReLU activations to upsample a 100‑dim latent vector into a 32×32 RGB image. - Discriminator: A CNN with dropout (0.4) and LeakyReLU to distinguish real from synthetic images.
- Trained for 5 epochs with batch size 1024, showing stable convergence and realistic sample generation.
- Leveraged a pre‑trained VGG16 (ImageNet weights) as a feature extractor.
- Data augmentation (rotation, shift, shear, zoom, flip) was applied to the training set to mitigate overfitting.
- Fine‑tuned the top layers with dense layers and dropout.
- Achieved >90% validation accuracy in only 5 epochs, demonstrating the efficiency of transfer learning on small datasets.
- Hands‑on experience with adversarial training dynamics.
- Effective use of pre‑trained CNNs and data augmentation for limited‑data scenarios.
Predict 72 future temperature readings (10‑minute intervals) given 216 past readings from the Jena Climate dataset.
- Simple RNN: Baseline model with 1–3 layers.
- LSTM: Deep LSTM with dropout to handle long‑term dependencies.
- GRU: Faster alternative to LSTM with comparable performance.
- Bidirectional GRU (final model): Two bidirectional GRU layers with L2 regularisation and dropout.
- Scaled data using
MinMaxScaler. - Created sliding‑window sequences: 216 input → 72 output.
- Split data 90‑10 into training and validation sets.
- Used EarlyStopping to prevent overfitting.
- Applied ReduceLROnPlateau for dynamic learning rate adjustment.
- Final model achieved R² = 0.94 on the test set (a significant improvement over the baseline RNN which scored R² = 0.70).
- Plots comparing predictions against actual values.
- Loss curves for training and validation sets.
- Language: Python 3.10+
- Libraries: TensorFlow, Keras, Scikit‑learn, XGBoost, Pandas, NumPy, Matplotlib, Seaborn, SHAP, OpenCV
- Environment: Jupyter Notebook, Google Colab
-
Clone this repository:
git clone https://github.com/yourusername/ai-course-assignments.git cd ai-course-assignments -
Install required packages:
pip install -r requirements.txt
-
Launch Jupyter and open the desired assignment:
jupyter notebook assignment1.ipynb
Note: Some datasets (e.g., skin lesion images, Jena climate CSV) are not included. Please download them separately and update file paths. The CIFAR‑10 dataset is built into Keras and loads automatically.