This repository contains a collection of lab exercises and exams from the TDDE15: Advanced Machine Learning course taking at Linköping Univerity during the fall 2024. The main topics are: Bayesian Networks, Hidden Markov Models, Q-learning, REINFORCE, and Gaussian Processes.
-
Hill-Climbing Variability
- Show that different parameter settings yield non-equivalent Bayesian Network (BN) structures.
-
BN Classification
- Train a BN on 80% of the Asia dataset and classify
S
in the remaining 20%.
- Train a BN on 80% of the Asia dataset and classify
-
Markov Blanket Classification
- Classify
S
using only its Markov blanket.
- Classify
-
Naive Bayes Classifier
- Construct a naive Bayes BN by hand and classify
S
.
- Construct a naive Bayes BN by hand and classify
-
Analysis
- Compare and explain differences across models.
Lab 2: Hidden Markov Model for Robot Navigation
-
Build HMM
- Define an HMM based on the robot’s movement and observation model.
-
Simulate HMM
- Run a 100-step simulation.
-
Path Estimations
- Compute filtered, smoothed, and Viterbi paths from observations.
-
Accuracy
- Calculate accuracy of filtered, smoothed, and Viterbi paths.
-
Repeat with Variability
- Demonstrate advantages of smoothed distributions over filtered and Viterbi.
-
Entropy Analysis
- Calculate entropy over time to check localization accuracy.
- Predict Next State
- Estimate hidden state probabilities for time step 101.
-
Q-Learning in Grid World
- Implement Q-learning, ε-greedy policy, and run 10,000 episodes.
-
Environment A
- Analyze learning with multiple rewards and observe optimal policy formation.
3. **Environment B** - Examine how ε and γ affect the agent’s policy in a 7×8 grid.
4. **Environment C** - Study the impact of β on policy in a 3×6 grid.
5. **REINFORCE in Grid World** - Understand the REINFORCE algorithm’s operation in a 4×4 grid with random goals.
- Environment D
- Validate policy learned with eight goal positions.
7. **Environment E** - Analyze overfitting with goals restricted to top-row training positions.
-
GP Regression Implementation
- Implement GP regression using the squared exponential kernel.
-
Posterior Updates
- Update the posterior with single and multiple observations and visualize results.
3. **GP Regression with kernlab** - Use `kernlab` to fit a GP model on daily temperature data and compare hyperparameter effects.
- Time vs. Day Model Comparison
- Compare GP models with
time
andday
as inputs, analyzing pros and cons.
- Compare GP models with
- Locally Periodic Kernel
- Extend the GP with a periodic kernel to model seasonal patterns.
- GP Classification
- Train a GP classification model on banknote fraud data, using two and four covariates, and compare accuracy.
---
The exams folder contains exams for practice organized by date. Each folder contains exam instructions and my solutions. Exam dates:
- 2022-10-26
- 2023-10-25
- 2022-08-24
- 2021-10-25
- 2021-11-27
- 2020-10-27