Course syllabus


TDA232 / DIT381 Algorithms for machine learning and inference lp4 VT20 (7.5 hp)

The course is offered by the Department of Computer Science and Engineering.

This year the course will be given remotely via Zoom, the recordings (if available) will be uploaded.

Contact details

Instructor and examiner

      Morteza Haghir Chehreghani:


Student representatives

Course purpose

Today we have entered the era of “Big Data” : science, engineering and technology are producing increasingly large data streams, with petabyte and exabyte scales becoming increasingly common. We are flooded with data from the internet, social networks like Facebook and Twitter and high throughput experiments from Biology and Physics labs. Machine Learning is an area of Computer Science which deals with designing algorithms that allow computers to automatically make sense of this data tsunami by extracting interesting patterns and insights from raw data. The goal of this course is to introduce some of the fundamental concepts, techniques and algorithms in modern Machine Learning with special emphasis on Statistical Pattern Recognition.

Learning objectives

  • apply sound mathematical foundations to the inference of hypotheses from empirical data and models on scientific grounds;
  • explain a representative set of available Machine Learning approaches;
  • evaluate the methods qualitatively and quantitatively, and to recognize both their strengths and limitations.

Link to the syllabus and study plan



Slack Link

Gustaf Sjösten created this channel and suggested to share it to be used for the discussions among the students. Note that the instructor and the TAs will not be active in this channel. So, please send your questions by email to them or propose them in the discussion forum of Canvas. 

Examination form

The final exam will be in the form of a take home exam. The take home exam is to be done individually and it is allowed to use books and read sources on the internet but not to get help from others.

The score for the take home exam and the assignments will each be normalized to 60 points and follow the grade distribution 28 (3,G) 36 (4) 48 (5, VG).  The final grade on the course will be the minimum of the two grades.

The take home exam will be published online and will be due the following day. This day will be during the exam week and will be selected according to a doodle to accommodate as many students as possible.

The exam will be available from  TBA. All submissions will be handled through canvas. Either you submit a latex-pdf or take photos of your handwritten solutions and convert it to pdf.

Previous exams

Note that course content differs between the years.


exam_2016     exam_2016_solutions

exam_2017     exam_2017_solutions


Course literature

The coursebook is S. Rogers and M. Girolami, A First Course in Machine Learning, 2nd edition, Chapman & Hall/CRC 2016, ISBN: 9781498738484. Chapters 1, 2, 3, 4, 5, 6

The relevant notebooks to the lectures:

The GitHub for the codes in other formats:

For Deep Learning topics, use [GBC]. 

Further reading


Date and time Main topic Slides Recordings Recommended reading Room for consultation

Tue, Mar 24


Machine Learning – What, Why and How?Linear Modeling


Linear Models and Model Selection

zoom recording 1 A First Course In Machine Learning, Chapter 1  no consultation

Fri, Mar 27


Non-linear models and model selection previous lecture


A First Course In Machine Learning, Chapter 1

Visualized Linear Regression

Python example

no consultation

Tue, Mar 31


Linear Regression: Probabilistic approach Probabilistic Regression zoom recording 3 A First Course In Machine Learning, Chapter 2 no consultation

Fri, Apr 03


Linear Regression: Bayesian approach Bayesian Regression zoom recording 4 A First Course In Machine Learning, Chapter 3


Emilio: Zoom

Fri, Apr 17


previous lecture

Nearest Neighbor Classification

Nearest Neighbor and Bayes zoom recording 5 A First Course In Machine Learning, Chapter 5.1, 5.3.1 and 5.2.1


Emilio: Zoom

Tue, Apr 21


Bayes Classification and SVM I SVM zoom recording 6 A First Course In Machine Learning, Chapter 5.2, 5.3 


Arman: Zoom

Fri, Apr 24


SVM II, Analysis of Classification previous lecture zoom recording 7  A First Course In Machine Learning, Chapter 5.3, 5.4


Arman: Zoom

Tue, Apr 28


Logistic Regression Logistic Regression zoom recording 8 A First Course In Machine Learning, Chapter 4, 5.2


Divya/Yuchong: Zoom

Tue, May 5


Bayesian Logistic Regression previous lecture zoom recording 9 A First Course In Machine Learning, Chapter 4, 5.2


Divya/Yuchong: Zoom

Fri, May 8


Deep Neural Networks Deep Learning 1 zoom recording 10

Deep Learning, Chapter 6 (7, 8 for further reading) lecture


?: Zoom

Tue, May 12


CNNs Deep Learning 2 zoom recording 11

Deep Learning, Chapter 9 lecture


Simon: Zoom

Fri, May 15


RNNs and Sequential Data Models Deep Learning 3 zoom recording 12

Deep Learning, Chapter 10 lecture


Simon: Zoom

Tue, May 19




Mixture Models

zoom recording 13

Christopher M. Bishop, Pattern Recognition and Machine Learning, Ch 9

K-means in Python scikit-learn

GMM in Python scikit-learn


Simon: Zoom

Divya/Yuchong: Zoom

Tue, May 26


Invited Lecture I

Ola Engkvist from AstraZeneca
AI at AstraZeneca


Divya/Yuchong: Zoom

Fri, May 29


Invited Lecture II Marija Furdek Prekratic from E2, Optical Networks unit  no consultation



  • We will use Python3
  • Note that all homework are in Jupyter Notebook (they are not pdf). It is installed in the halls ES61-ES62, E-studio and MT9 but can easily be installed on any computer. You can also use google-colab to open/run these notebooks.
  • All assignments are to be solved in groups of 2 and uploaded on canvas. If you don’t have a partner, post in Looking for teammate.  Join an assignment work group here: People
  • Each homework consists of both theoretical and practical problems.
  • Upload the updated Jupyter notebook with discussions/results of practical questions (including results and/or plots and outputs of your code). All plots/results should be visible such that the notebooks do not have to be run but the code in the notebooks should reproduce the plots/results if we choose to do so. Write the solutions to theoretical questions in the notebook itself, using Latex-math mode for writing equations etc.
  • Assignment .pdf:s may be subject to minor changes (such as spelling corrections) up until one week before the deadline.


There will be five assignments in the course and they will be done in groups of two. If an assignment is handed in late without an valid excuse the points for the assignment will be reduced linearly by 10% per commenced day.

Homework Due date Data Points Grader Relevant lectures Solution sketch
hw1 - Probability and MLE 17/4 Emilio
hw2 - Bayesian learning 27/4 Arman
hw3 - Algorithms for Classification 6/5 Divya, Yuchong
hw4 - Deep learning 19/5 Simon
hw5 - Clustering 29/5 Yuchong, Divya


Course summary:

Date Details Due