Difference between revisions of "Pattern Analysis and Machine Intelligence"

From Chrome
Jump to: navigation, search
m (Reverted edits by Matteo (talk) to last revision by Davide)
Line 2: Line 2:
  
 
The following are last minute news you should be aware of ;-)
 
The following are last minute news you should be aware of ;-)
  12/04/2011: detailed schedule modified; no lecture on 18/5 and additional lectures on 31/05 and 01/06 (I forgot them originally)
+
   
  14/03/2011: added the detailed schedule. NOTE that tomorrow class starts at 14:15 instead of 13:15
+
26/05/2013: first homework is out -> deadline to turn it in Sunday 09/06/2013
  08/03/2011: the course started today!
+
21/05/2013: detailed schedule updated
 +
13/04/2013: change to the schedule to recover missed lecture
 +
05/03/2013: a new edition of the course starts today!
 +
05/03/2013: grades from the 29/01/2013 exam are available at [[Media:Grades_130129_PAMI.pdf|this link]]
 +
<!--
 +
05/10/2012: Grades for the 19/09/2012 exam are available at [[Media:Grades_120919_PAMI.pdf|this link]]
 +
21/07/2012: Updated grades for the 10/07/2012 and 26/06/2012 exams are available at [[Media:Grades_120710_PAMI.pdf|this link]]
 +
  18/07/2012: Grades for the 10/07/2012 exam are available at [[Media:Grades_120710_PAMI.pdf|this link]]
 +
08/07/2012: Grades for the 26/06/2012 exam are available at [[Media:Grades_120626_PAMI.pdf|this link]]
 +
17/06/2012: Homework bugfix, check out below!
 +
12/06/2012: second and third (this one is optional) are out!
 +
11/06/2012: updated lecture schedule with details on 18/06 and 19/06 lectures
 +
02/06/2012: homework exstension! The deadline is '''Tuesday 05/06/2012 23:59 CET'''!!
 +
26/05/2012: the first part of the homework is out! You have to turn it in by Sunday 3/6/2012!
 +
03/04/2012: published some material on "probability basics"
 +
  12/03/2012: a new edition of the course starts today!
 +
-->
  
 
==Course Aim & Organization==
 
==Course Aim & Organization==
Line 30: Line 46:
 
===Detailed course schedule===
 
===Detailed course schedule===
  
A detailed schedule of the course can be found here; topics are just indicative while days and teachers are correct up to some last minute change (I will notify you by email). Please note that not all Tuesdays and Wednesdays are in!!
+
A detailed schedule of the course can be found here; topics are just indicative while days and teachers are correct up to some last minute change (I will notify you by email). Please note that not all days we have lectures!!
  
 
{| border="1" align="center" style="text-align:center;"
 
{| border="1" align="center" style="text-align:center;"
Line 36: Line 52:
 
|Date || Day || Time || Room || Teacher || Topic
 
|Date || Day || Time || Room || Teacher || Topic
 
|-
 
|-
|08/03/2011 || Tuesday || 13:15 - 16:15 || 3.6 || Matteo Matteucci || Course Introduction (Ch. 1)
+
|05/03/2013 || Tuesday || 13:15 - 15:15 || 4.1 || Matteo Matteucci || Course Introduction (Ch. 1)
 
|-
 
|-
|15/03/2011 || Tuesday || 14:15 - 16:15 || 3.6 || Matteo Matteucci || Two examples from classification (Ch. 2)  
+
|11/03/2013 || Monday  || 13:15 - 15:15 || 3.8 || Matteo Matteucci || Two examples from classification (Ch. 2)
 
|-
 
|-
|22/03/2011 || Tuesday || 13:15 - 15:15 || 3.6 || Matteo Matteucci || Discriminating functions, decision boundary and Linear Regression (Ch.4.1, Ch. 4.2)
+
|12/03/2013 || Tuesday || 13:15 - 15:15 || 4.1 || Matteo Matteucci || Statistical Decision Theory and Bias-Variance trade off (Ch. 2)
 
|-
 
|-
|23/03/2011 || Wednesday || 14:15 - 16:15 || 4.2 || Luigi Malago || Linear regression methods (Ch 2.1, 2.2, 2.3 and 2.3.1, 2.4, 2.6 and 2.6.1, 2.7 and 2.7.1, 2.8 and 2.8.1, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.9,  see paper "Least Angle Regression" linked below, pages 1-16)
+
|18/03/2013 || Monday  || 13:15 - 15:15 || 3.8 || Luigi Malagò    || Linear Regression Methods (Ch. 2, Ch. 3, (*))
 
|-
 
|-
|29/03/2011 || Tuesday || 13:15 - 15:15 || 3.6 || Matteo Matteucci || Linear Discriminant Analysis (Ch. 4.3)
+
|19/03/2013 || Tuesday || 13:15 - 15:15 || 4.1 || Luigi Malagò    || Linear Regression Methods (Ch. 2, Ch. 3, (*))
 
|-
 
|-
|30/03/2011 || Wednesday || 14:15 - 16:15 || 4.2 || Luigi Malago || Linear regression methods (see 23/03/2011)
+
|25/03/2013 || Monday  || 13:15 - 15:15 || 3.8 || Luigi Malagò    || --- CANCELLED ---
 
|-
 
|-
|05/04/2011 || Tuesday || 13:15 - 15:15 || 3.6 || Luigi Malago || Linear regression methods (see 23/03/2011)
+
|26/03/2013 || Tuesday || 13:15 - 15:15 || 4.1 || Luigi Malagò    || Linear Regression Methods (Ch. 2, Ch. 3, (*))
 
|-
 
|-
|06/04/2011 || Wednesday || 14:15 - 16:15 || 4.2 || Luigi Malago || Linear regression methods (see 23/03/2011)
+
|01/04/2013 || Monday  || 13:15 - 15:15 || 3.8 || ---    || No Lecture
 
|-
 
|-
|12/04/2011 || Tuesday || 13:15 - 15:15 || 3.6 || Matteo Matteucci || Logistic regression (Ch.4.4)
+
|02/04/2013 || Tuesday || 13:15 - 15:15 || 4.1 || ---    || No Lecture
 
|-
 
|-
|13/04/2011 || Wednesday || 14:15 - 16:15 || 4.2 || Davide Eynard || Clustering I: Introduction and K-Means
+
|08/04/2013 || Monday  || 13:15 - 15:15 || 3.8 || Luigi Malagò    || Linear Regression Methods (Ch. 2, Ch. 3, (*))
 
|-
 
|-
|19/04/2011 || Tuesday || 13:15 - 15:15 || 3.6 || Matteo Matteucci || Perceptron learning
+
|09/04/2013 || Tuesday || 13:15 - 15:15 || 4.1 || Matteo Matteucci     || Discriminating functions, decision boundary and Linear Regression (Ch.4.1, Ch. 4.2)
 
|-
 
|-
|20/04/2011 || Wednesday || 14:15 - 16:15 || 4.2 || Davide Eynard || Clustering II: K-Means Alternatives, Hierarchical, SOM
+
|15/04/2013 || Monday  || 13:15 - 15:15 || 3.8 || Matteo Matteucci    || Linear Discriminant Analysis (Ch. 4.3)
 
|-
 
|-
|27/04/2011 || Wednesday || 14:15 - 16:15 || 4.2 || Davide Eynard || Clustering III: Mixture of Gaussians, DBSCAN, Jarvis-Patrick
+
|16/04/2013 || Tuesday || 13:15 - 15:15 || 4.1 || Luigi Malagò    || Linear Regression Methods (Ch. 2, Ch. 3, (*))
 
|-
 
|-
|03/05/2011 || Tuesday || 13:15 - 15:15 || 3.6 || Matteo Matteucci || Maximum margin classificagtion
+
|22/04/2013 || Monday  || 13:15 - 15:15 || 3.8 || ---    || No Lecture
 
|-
 
|-
|04/05/2011 || Wednesday || 14:15 - 16:15 || 4.2 || Davide Eynard || Clustering IV: Evaluation Measures
+
|23/04/2013 || Tuesday || 13:15 - 15:15 || 4.1 || Matteo Matteucci    ||   Linear Discriminant Analysis (Ch. 4.3)
 
|-
 
|-
|10/05/2011 || Tuesday || 13:15 - 15:15 || 3.6 || Matteo Matteucci ||
+
|29/04/2013 || Monday  || 13:15 - 15:15 || 3.8 || Matteo Matteucci     || Linear Discriminant Analysis (Ch. 4.3)
 
|-
 
|-
|11/05/2011 || Wednesday || 14:15 - 16:15 || 4.2 || Matteo Matteucci ||
+
|30/04/2013 || Tuesday || 13:15 - 15:15 || 4.1 || Matteo Matteucci     || Logistic Regression (Ch.4.4)
 
|-
 
|-
|17/05/2011 || Tuesday || || || || No Lecture today!
+
|06/05/2013 || Monday  || 13:15 - 15:15 || 3.8 || Davide Eynard    || Clustering I: Introduction and K-Means
 
|-
 
|-
|18/05/2011 || Wednesday || || || || No Lecture today!
+
|07/05/2013 || Tuesday || 13:15 - 15:15 || 4.1 || Davide Eynard    ||   Clustering II: K-Means Alternatives, Hierarchical, SOM
 
|-
 
|-
|24/05/2011 || Tuesday || 13:15 - 15:15 || 3.6 || Matteo Matteucci ||
+
|13/05/2013 || Monday  || 13:15 - 15:15 || 3.8 || Davide Eynard    ||   Clustering III: Mixture of Gaussians, DBSCAN, Jarvis-Patrick
 
|-
 
|-
|25/05/2011 || Wednesday || 14:15 - 16:15 || 4.2 || Matteo Matteucci ||
+
|14/05/2013 || Tuesday || 13:15 - 15:15 || 4.1 || Davide Eynard    ||   Clustering IV: Spectral Clustering
 
|-
 
|-
|31/05/2011 || Tuesday || 13:15 - 15:15 || 3.6 || Matteo Matteucci ||
+
|20/05/2013 || Monday  || 13:15 - 15:15 || 3.8 || Davide Eynard    || Clustering V: Evaluation Measures
 
|-
 
|-
|01/06/2011 || Wednesday || 14:15 - 16:15 || 4.2 || Matteo Matteucci ||
+
|21/05/2013 || Tuesday || 13:15 - 15:15 || 4.1 || Matteo Matteucci   || Logistic Regression (Ch.4.4)
 
|-
 
|-
|07/06/2011 || Tuesday || 13:15 - 15:15 || 3.6 || Matteo Matteucci ||
+
|27/05/2013 || Monday  || 13:15 - 15:15 || 3.8 || Matteo Matteucci   || Logistic Regression (Ch.4.4) + Perceptron Learning
 
|-
 
|-
|08/06/2011 || Wednesday || || || || No Lecture today!
+
|28/05/2013 || Tuesday || 13:15 - 15:15 || 4.1 || ---    ||   No Lecture
 
|-
 
|-
|14/06/2011 || Tuesday || 13:15 - 15:15 || 3.6 || Matteo Matteucci ||
+
|03/06/2013 || Monday  || 13:15 - 15:15 || 3.8 || Matteo Matteucci   ||  
 
|-
 
|-
|15/06/2011 || Wednesday || 14:15 - 16:15 || 4.2 || Matteo Matteucci ||
+
|04/06/2013 || Tuesday || 13:15 - 15:15 || 4.1 || Matteo Matteucci    || 
 +
|-
 +
|10/06/2013 || Monday  || 13:15 - 15:15 || 3.8 ||  Matteo Matteucci    || 
 +
|-
 +
|11/06/2013 || Tuesday || 13:15 - 15:15 || 4.1 || Matteo Matteucci    ||
 +
|-
 +
|17/06/2013 || Monday  || 13:15 - 15:15 || 3.8 || Matteo Matteucci   ||
 
|}
 
|}
 +
 +
<!--
 +
Kernel Smoothing Methods and Kerned Density Estimation (Ch.6.1, Ch.6.6, Ch.6.9)
 +
Gaussian Mixture Models (Ch.6.8) and the EM Algorithm (Ch.8.5)
 +
Decision Trees ([[Media:PAMI_DTnR.pdf |handout]] + Ch. 9.2)
 +
Perceptron Learning and Support Vector Machines (Ch 4.5)
 +
Maximum margin classification (Ch. 4.5.2)
 +
Support Vector Machines (Ch. 12.1, Ch. 12.2, Ch. 12.3.0, Ch. 12.3.1 + SVM paper)
 +
-->
 +
 +
(*) Linear regression methods (Ch 2.1, 2.2, 2.3 and 2.3.1, 2.4, 2.6 and 2.6.1, 2.7 and 2.7.1, 2.8 and 2.8.1, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.9,  see paper "Least Angle Regression" linked below, pages 1-16)
  
 
===Course Evaluation===
 
===Course Evaluation===
Line 96: Line 129:
  
 
* A homework with exercises covering the whole program that counts for 30% of the course grade
 
* A homework with exercises covering the whole program that counts for 30% of the course grade
* A oral examination covering the whole progran that count for 70% of the course grade
+
* A written examination covering the whole program that count for 70% of the course grade
  
 
The homework is just one per year, it will be published at the end of the course and you will have 15 days to turn it in. It is not mandatory, however if you do not turn it in you loose 30% of the course grade. There is the option of substitute the homework with a practical project, but this has to be discussed and agreed with the course professor.
 
The homework is just one per year, it will be published at the end of the course and you will have 15 days to turn it in. It is not mandatory, however if you do not turn it in you loose 30% of the course grade. There is the option of substitute the homework with a practical project, but this has to be discussed and agreed with the course professor.
  
==Teaching Material==
+
==Teaching Material (the textbook)==
 +
 
 +
Lectures will be based on material taken from the aforementioned slides and from the following book.
 +
 
 +
* [http://http://www-stat.stanford.edu/~tibs/ElemStatLearn/index.html The Elements of Statistical Learning: Data Mining, Inference, and Prediction.] by Trevor Hastie, Robert Tibshirani, and Jerome Friedman.
 +
 
 +
Some additional material that could be used to prepare the oral examination will be provided together with the past homeworks.
 +
 
 +
===Teacher Slides===
  
 
In the following you can find the lecture slides used by the teacher and the teaching assistants during classes:
 
In the following you can find the lecture slides used by the teacher and the teaching assistants during classes:
  
 
* [[Media:PAMI_Intro.pdf | Course introduction]]: introductory slides of the course with useful information about the grading, and the course logistics. Some examples from supervised learning and two algorithms for classification (taken from ''The Elements of Statistical Learning'' book).
 
* [[Media:PAMI_Intro.pdf | Course introduction]]: introductory slides of the course with useful information about the grading, and the course logistics. Some examples from supervised learning and two algorithms for classification (taken from ''The Elements of Statistical Learning'' book).
 +
* [[Media:ProbabilityBasics.pdf | Probability Basics]]: Slides on probability basics used to introduce Statistical Decision Theory.
 
* [[Media:PAMI_LinearClassification.pdf | Linear Classification Examples]]: slides presenting images, tables and examples about (generalized) linear methods for classification (taken from ''The Elements of Statistical Learning'' book).
 
* [[Media:PAMI_LinearClassification.pdf | Linear Classification Examples]]: slides presenting images, tables and examples about (generalized) linear methods for classification (taken from ''The Elements of Statistical Learning'' book).
* Least Angle Regression http://www.stanford.edu/~hastie/Papers/LARS/LeastAngle_2002.pdf
+
* [[Media:PAMI_KernelSmoothing.pdf | Kernel Smoothing Examples]]: slides presenting images, tables and examples about Kernel Smoothing, Kernel Density Estimation and Gaussian Mixture Models (taken from ''The Elements of Statistical Learning'' book).
 +
* [[Media:PAMI_DTnR.pdf | Decision Trees and Classification Rules]]: these slides have been used to present decision trees and decision rules complementing the material in Ch. 9.2 of the ''The Elements of Statistical Learning'' book.
 +
* [[Media:PAMI_SVM.pdf | Support Vector Machines]]: these slides have been used to present Support Vector Machines (taken from ''The Elements of Statistical Learning'' book).
 +
 
 +
===Additional Papers===
 +
Papers used to integrate the textbook
 +
 
 +
* Bradley Efron, Trevor Hastie, Iain Johnstone and Robert Tibshirani, [http://www.stanford.edu/~hastie/Papers/LARS/LeastAngle_2002.pdf Least Angle Regression] Annals of Statistics (with discussion) (2004) 32(2), 407-499.
 +
* Burges, Christopher J. C., 1998. [http://www.svms.org/tutorials/Burges1998.pdf A tutorial on support vector machines for pattern recognition]. Data Mining and Knowledge Discovery, 2(2), 121–167.
 
* ...  
 
* ...  
  
====Clustering====
+
===Clustering Slides===
* Lesson 1: Introduction to Clustering and K-Means ([http://davide.eynard.it/teaching/2011_PAMI/slides-lecture-e1.pdf slides], [http://davide.eynard.it/teaching/2011_PAMI/handout-lecture-e1.pdf handouts])
+
These are the slides used to present clustering algorithms during lectures
  
* Lesson 2: K-Means alternatives, Hierarchical, SOM ([http://davide.eynard.it/teaching/2011_PAMI/slides-lecture-e2.pdf slides], [http://davide.eynard.it/teaching/2011_PAMI/handout-lecture-e2.pdf handouts])
+
* Lesson 1: Introduction to Clustering and K-Means ([http://davide.eynard.it/teaching/2012_PAMI/slides-lecture-e1.pdf slides], [http://davide.eynard.it/teaching/2012_PAMI/handout-lecture-e1.pdf handouts])
  
* Lesson 3: Mixture of Gaussians, DBSCAN, Jarvis-Patrick ([http://davide.eynard.it/teaching/2011_PAMI/slides-lecture-e3.pdf slides], [http://davide.eynard.it/teaching/2011_PAMI/handout-lecture-e3.pdf handouts])
+
* Lesson 2: K-Means alternatives, Hierarchical, SOM ([http://davide.eynard.it/teaching/2012_PAMI/slides-lecture-e2.pdf slides], [http://davide.eynard.it/teaching/2012_PAMI/handout-lecture-e2.pdf handouts])
  
* Lesson 4: Evaluation measures ([http://davide.eynard.it/teaching/2011_PAMI/slides-lecture-e4.pdf slides], [http://davide.eynard.it/teaching/2011_PAMI/handout-lecture-e4.pdf handouts])
+
* Lesson 3: Mixture of Gaussians, DBSCAN, Jarvis-Patrick ([http://davide.eynard.it/teaching/2012_PAMI/slides-lecture-e3.pdf slides], [http://davide.eynard.it/teaching/2012_PAMI/handout-lecture-e3.pdf handouts])
  
 +
* Lesson 4: Evaluation measures ([http://davide.eynard.it/teaching/2012_PAMI/slides-lecture-e4.pdf slides], [http://davide.eynard.it/teaching/2012_PAMI/handout-lecture-e4.pdf handouts]) and Spectral Clustering ([http://davide.eynard.it/teaching/2012_PAMI/Spectral%20Clustering.pdf])
  
 +
===Past Exams and Sample Questions===
 +
These are the text of past exams to give and idea on what to expect during the class exam:
  
Lectures will be based on material taken from the aforementioned slides and from the following book.  
+
* [[Media:2013_01_29_PAMI.pdf |29/01/2013 Exam]]
 +
* [[Media:2012_09_19_PAMI.pdf |19/09/2012 Exam]]
 +
* [[Media:2012_09_04_PAMI.pdf |04/09/2012 Exam]]
 +
* [[Media:2012_07_10_PAMI.pdf |10/07/2012 Exam]]
 +
* [[Media:2012_06_26_PAMI.pdf |26/06/2012 Exam]]
 +
* [[Media:2012_02_03_PAMI.pdf |03/02/2012 Exam]]
 +
* [[Media:2011_09_19_PAMI.pdf |19/09/2011 Exam]]
 +
* [[Media:2011_09_08_PAMI.pdf |08/09/2011 Exam]]
 +
* [[Media:2011_07_15_PAMI.pdf |15/07/2011 Exam]]
 +
* [[Media:2011_06_29_PAMI.pdf |29/06/2011 Exam]]
  
* [http://http://www-stat.stanford.edu/~tibs/ElemStatLearn/index.html The Elements of Statistical Learning: Data Mining, Inference, and Prediction.] by Trevor Hastie, Robert Tibshirani, and Jerome Friedman.
+
== 2013 Homework ==
  
Some additional material that could be used to prepare the oral examination will be provided together with the past homeworks.
+
The 2013 Homework (alike the 2012 one) is organized as an octave series of tutorials. You are requested to go through the tutorials and practice with the algorithms that have been presented in class. To prove us you have done it and that you have understood the code you will be requested to solve few exercises and provide us a pdf report by email
 +
* [[Media:homework_pami_regression_2013.pdf | Homework 2012 Regression]]: this is the text of the first part of the homework; it has been intentionally edited not to allow cut and paste. '''This part of the homework will contribute to the 10% of the grade and the deadline to submit the solution by email to matteucci@elet.polimi.it and malago@di.unimi.it is Sunday 09/06 23:59'''
 +
** [[Media:prostate.data | prostate.data]]: the dataset used for the homework
 +
** [[Media:prostate.info | prostate.info]]: the dataset used for the homework
 +
** [[Media:diabete.mat | diabete.mat]]: the dataset used for the homework
 +
For any question or doubt please sen us an email as soon as possible.
 +
 
 +
<!-- ** [[Media:textread.m | textread.m]]: (optional) function which might be useful depending on your octave version -->
 +
<!-- ** [[Media:strread.m | strread.m]]: (optional) function which might be useful depending on your octave version -->
 +
 
 +
'''Note 1:''' for some strange reason the CSM of the website has decided to rename the files with capitals, please save them in lower case :-(
 +
 
 +
<strike>'''Note 2:''' rename the file Diabete.data into diabete.mat ... still fighting with the CSM :-)</strike>
 +
 
 +
'''Note 3:''' the code has been tested with octave under linux, we suggest to use it not to spend too much time with installing it under windows or using matlab. If you do not have linux installed, try using a live CD as the ubuntu 13.04 live distro ;-)
 +
 
 +
 
 +
<!--
 +
== 2012 Homework ==
 +
 
 +
The Homework of 2012 organized like an octave/matlab series of tutorials. You are requested to go through the tutorials and practice with the algorithms that have been presented in class. To prove us you have done it and that you have understood the code you will be requested to solve few exercises and provide us a pdf report by email
 +
 
 +
* [[Media:PAMI_homework_2012_1.pdf | Homework 2012 part 1]]: this is the text of the first part of the homework; it has been intentionally edited not to allow cut and paste. '''This part of the homework will contribute to the 10% of the grade and the deadline to submit the solution by email to matteucci@elet.polimi.it and malago@elet.polimi.it is Tuesday 5/6 23:59'''
 +
** [[Media:prostate.data | prostate.data]]: the dataset used for the homework
 +
** [[Media:prostate.info | prostate.info]]: the dataset used for the homework
 +
** [[Media:textread.m | textread.m]]: (optional) function which might be useful depending on your octave version
 +
** [[Media:strread.m | strread.m]]: (optional) function which might be useful depending on your octave version
 +
 
 +
'''Note:''' for some strange reason the CSM of the website has decided to rename the files with capitals, please save them in lower case :-(
 +
 
 +
* [[Media:PAMI_homework_2012_2.pdf | Homework 2012 part 2]]: this is the text of the second part of the homework; it has been intentionally edited not to allow cut and paste. '''This part of the homework will contribute to the 10% of the grade; the deadline to submit the solution by email to matteucci@elet.polimi.it is the day before the exam you decide to attend''' (e.g., if you decide to take the exam on the 26/6 then you need to turn it in by 25/6).
 +
** [[Media:SAheart.data | SAheart.data]]: the dataset used for the homework
 +
** [[Media:SAheart.info | SAheart.info]]: the dataset used for the homework
 +
 
 +
'''Errata Corrige''': there were a few bugs a bug in the homework text. I have updated the pdf and they were:
 +
In the code for loading the data I forgot to remove the first column which you do not need
 +
data = dlmread('SAheart.data',',',1,1);
 +
X = data(:,1:9);
 +
Y = data(:,10);
 +
 
 +
In the StratifiedSampling function the sorted verctors should be assigned
 +
% just an ahestetic sorting
 +
testing = sort(testing);
 +
training = sort(training);
 +
 
 +
In the computation of feature projection, the code for the maximization of a'B*a via SVD should be changed as it follows
 +
% maximization of a'*B*a / a'*w*a via SVD
 +
[Vw, Dw, Vw] = svd(W);
 +
Whalf = Vw * sqrt(Dw) * Vw'; % Whalf'*Whalf == W
 +
Wminushalf = inv(Whalf);
 +
Mstar = M*Wminushalf;
 +
    % Add this variable for computing Mstar mean
 +
    meanMstar = mean(Mstar);
 +
for i=1:size(M,1)
 +
    % Remove the mean saved before the loop
 +
    Mstar(i,:) = Mstar(i,:)-meanMstar;
 +
end
 +
Bstar = Mstar'*Mstar;
 +
[Vstar, Db, Vstar] = svd(Bstar);
 +
 
 +
In the expansion to quadratic space the starting index for the inner loop should i and not 1. Moreover in some cases it might be possible to have columns which are duplicated (e.g., with boolean attribute); in this case you should not need the robust version of linear regression.
 +
function extendedX = expandToQuadraticSpace(X)
 +
    % adds new columns to extendedX; keeps X for other calculations
 +
    extendedX = X;
 +
    for i=1:size(X, 2)
 +
        for j=i:size(X, 2)
 +
            newColumn = X(:, i) .* X(:, j);
 +
            extendedX = [extendedX newColumn];
 +
        end
 +
    end
 +
    % remove duplicated columns
 +
    duplicates = [];
 +
    for i=1:size(extendedX, 2)
 +
        for j=i+1:size(extendedX, 2)
 +
            if(sum(extendedX(:,i)==extendedX(:,j)) == size(X,1))
 +
                duplicates = [duplicates j];
 +
            end
 +
        end
 +
    end
 +
    extendedX(:,duplicates) = [];
 +
end
 +
 
 +
* [http://davide.eynard.it/2012/06/05/octave-clustering-demo-part-0-introduction-and-setup/ Homework 2012 part 3]: the third part of the homework is '''optional''', so you are not required to complete it. However, if you want to give it a try and use it to understand the topics covered by Davide Eynard in his lectures you are welcome. As usual, the questions in this homework are very close to the ones you will find in classworks, so we suggest to have a look at hose anyway! '''In case you decide to turn it in and have it contribute with a 10% to the grade, the deadline to submit the solution by email to matteucci@elet.polimi.it and davide.eynard@polimi.it is the day before you decide to take the exam''' (e.g., if you decide to take the exam on the 10/7 then you need to turn it in by 9/7)
 +
 
 +
'''Note:''' homeworks are meant to let you see (and practice) a little bit with the topics presented during the course. They are evaluated because you spent some time on those and thus you deserve some credit for that ;-)
 +
 
 +
== 2011 Homework ==
 +
 
 +
Here you can find the homework for the year 2011 and the material you need to complete it. Please read the F.A.Q. below and for any unsolved doubt contact the teachers of the course.
 +
 
 +
* [[Media:PAMI_homework_2011_v02.pdf | Homework 2011 v02]] a minor change in the signature of the logistic regression function
 +
* [[Media:PAMI_homework_2011_v01.pdf | Homework 2011 v01]] text with questions and exercises
 +
* [[Media:dataset.txt | Dataset]] for the clustering exercise in csv format
 +
 
 +
'''Frequently Asked Questions'''
 +
 
 +
* '''''How do I take the square root of a matrix?''''': check the diagonalization approach from [http://en.wikipedia.org/wiki/Square_root_of_a_matrix].
 +
 
 +
* '''''How do I compute the chi square statistics?'''': in the slide there is a cut and paste error since e_ij=R_it*C_tj as described here [http://en.wikipedia.org/wiki/Pearson's_chi-square_test]
 +
 
 +
* '''''When it is due? In which format?''''': The homework is due on the 29/06 and should be delivered by email. Send us (all the course teachers) the .m files in a zip archive attached to this email and a link to the pdf with the written part (not to flood our mailboxes).
 +
 
 +
* '''''Can we do that in groups? How many people per group?''''': Yes, you can work on the homework in groups, but no more than 3 people per group are allowed. Put the names of all homework authors in the pdf and in all the .m files. If you discuss something with other people, w.r.t. the people in your group, point it out in the pdf file as well.
 +
 
 +
* '''''Can we ask questions about the exercises or the code?''''': Yes you should! First of all, there might be unclear things in the exercise descriptions and those should be clarified as soon as possible for all (this is why the homework is versioned). But you could ask for help as well, our goal is to have you all solving all the questions and get a high grade ... but we will not do the homework on you behalf ;-)
 +
 
 +
* '''''How the optional questions are graded?''''': They compensate for possible errors in the other questions; we suggest to work on them anyway to be sure you get the maximum grading.
 +
 
 +
* '''''How the homework will be graded?''''': we are interested in understanding if you understood or not; thus we are not interested in the result, but we want to check how you get to the result. So please: 1) clarify all the assumptions and all the steps in your exercises 2) comment as much as possible your .m files!
 +
 
 +
-->

Revision as of 00:29, 28 May 2013


The following are last minute news you should be aware of ;-)

26/05/2013: first homework is out -> deadline to turn it in Sunday 09/06/2013
21/05/2013: detailed schedule updated
13/04/2013: change to the schedule to recover missed lecture
05/03/2013: a new edition of the course starts today!
05/03/2013: grades from the 29/01/2013 exam are available at this link

Course Aim & Organization

The objective of this course is to give an advanced presentation of the techniques most used in artificial intelligence and machine learning for pattern recognition, knowledge discovery, and data analysis/modeling.

Teachers

The course is composed by a blending of lectures and exercises by the course teacher and some teaching assistants.

Course Program

Techniques from machine and statistical learning are presented from a theoretical (i.e., statistics and information theory) and practical perspective through the descriptions of algorithms, the theory behind them, their implementation issues, and few examples from real applications. The course follows, at least partially, the outline of The Elements of Statistical Learning book (by Trevor Hastie, Robert Tibshirani, and Jerome Friedman):

  • Machine Learning and Pattern Classification: in this part of the course the general concepts of Machine Learning and Patter Recognition are introduced with a brief review of statistics and information theory;
  • Unsupervised Learning Techniques: the most common approaches to unsupervised learning are described mostly focusing on clustering techniques, rule induction, Bayesian networks and density estimators using mixure models;
  • Supervised Learning Techniques: in this part of the course the most common techniques for Supervised Learning are described: decision trees, decision rules, Bayesian classifiers, hidden markov models, lazy learners, etc.
  • Feature Selection and Reduction: techniques for data rediction and feature selection will be presented with theory and applications
  • Model Validation and Selection: model validation and selection are orthogonal issues to previous technique; during the course the fundamentals are described and discussed (e.g., AIC, BIC, cross-validation, etc. ).

Detailed course schedule

A detailed schedule of the course can be found here; topics are just indicative while days and teachers are correct up to some last minute change (I will notify you by email). Please note that not all days we have lectures!!

Date Day Time Room Teacher Topic
05/03/2013 Tuesday 13:15 - 15:15 4.1 Matteo Matteucci Course Introduction (Ch. 1)
11/03/2013 Monday 13:15 - 15:15 3.8 Matteo Matteucci Two examples from classification (Ch. 2)
12/03/2013 Tuesday 13:15 - 15:15 4.1 Matteo Matteucci Statistical Decision Theory and Bias-Variance trade off (Ch. 2)
18/03/2013 Monday 13:15 - 15:15 3.8 Luigi Malagò Linear Regression Methods (Ch. 2, Ch. 3, (*))
19/03/2013 Tuesday 13:15 - 15:15 4.1 Luigi Malagò Linear Regression Methods (Ch. 2, Ch. 3, (*))
25/03/2013 Monday 13:15 - 15:15 3.8 Luigi Malagò --- CANCELLED ---
26/03/2013 Tuesday 13:15 - 15:15 4.1 Luigi Malagò Linear Regression Methods (Ch. 2, Ch. 3, (*))
01/04/2013 Monday 13:15 - 15:15 3.8 --- No Lecture
02/04/2013 Tuesday 13:15 - 15:15 4.1 --- No Lecture
08/04/2013 Monday 13:15 - 15:15 3.8 Luigi Malagò Linear Regression Methods (Ch. 2, Ch. 3, (*))
09/04/2013 Tuesday 13:15 - 15:15 4.1 Matteo Matteucci Discriminating functions, decision boundary and Linear Regression (Ch.4.1, Ch. 4.2)
15/04/2013 Monday 13:15 - 15:15 3.8 Matteo Matteucci Linear Discriminant Analysis (Ch. 4.3)
16/04/2013 Tuesday 13:15 - 15:15 4.1 Luigi Malagò Linear Regression Methods (Ch. 2, Ch. 3, (*))
22/04/2013 Monday 13:15 - 15:15 3.8 --- No Lecture
23/04/2013 Tuesday 13:15 - 15:15 4.1 Matteo Matteucci Linear Discriminant Analysis (Ch. 4.3)
29/04/2013 Monday 13:15 - 15:15 3.8 Matteo Matteucci Linear Discriminant Analysis (Ch. 4.3)
30/04/2013 Tuesday 13:15 - 15:15 4.1 Matteo Matteucci Logistic Regression (Ch.4.4)
06/05/2013 Monday 13:15 - 15:15 3.8 Davide Eynard Clustering I: Introduction and K-Means
07/05/2013 Tuesday 13:15 - 15:15 4.1 Davide Eynard Clustering II: K-Means Alternatives, Hierarchical, SOM
13/05/2013 Monday 13:15 - 15:15 3.8 Davide Eynard Clustering III: Mixture of Gaussians, DBSCAN, Jarvis-Patrick
14/05/2013 Tuesday 13:15 - 15:15 4.1 Davide Eynard Clustering IV: Spectral Clustering
20/05/2013 Monday 13:15 - 15:15 3.8 Davide Eynard Clustering V: Evaluation Measures
21/05/2013 Tuesday 13:15 - 15:15 4.1 Matteo Matteucci Logistic Regression (Ch.4.4)
27/05/2013 Monday 13:15 - 15:15 3.8 Matteo Matteucci Logistic Regression (Ch.4.4) + Perceptron Learning
28/05/2013 Tuesday 13:15 - 15:15 4.1 --- No Lecture
03/06/2013 Monday 13:15 - 15:15 3.8 Matteo Matteucci
04/06/2013 Tuesday 13:15 - 15:15 4.1 Matteo Matteucci
10/06/2013 Monday 13:15 - 15:15 3.8 Matteo Matteucci
11/06/2013 Tuesday 13:15 - 15:15 4.1 Matteo Matteucci
17/06/2013 Monday 13:15 - 15:15 3.8 Matteo Matteucci


(*) Linear regression methods (Ch 2.1, 2.2, 2.3 and 2.3.1, 2.4, 2.6 and 2.6.1, 2.7 and 2.7.1, 2.8 and 2.8.1, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.9, see paper "Least Angle Regression" linked below, pages 1-16)

Course Evaluation

The course evaluation is composed by two parts:

  • A homework with exercises covering the whole program that counts for 30% of the course grade
  • A written examination covering the whole program that count for 70% of the course grade

The homework is just one per year, it will be published at the end of the course and you will have 15 days to turn it in. It is not mandatory, however if you do not turn it in you loose 30% of the course grade. There is the option of substitute the homework with a practical project, but this has to be discussed and agreed with the course professor.

Teaching Material (the textbook)

Lectures will be based on material taken from the aforementioned slides and from the following book.

Some additional material that could be used to prepare the oral examination will be provided together with the past homeworks.

Teacher Slides

In the following you can find the lecture slides used by the teacher and the teaching assistants during classes:

  • Course introduction: introductory slides of the course with useful information about the grading, and the course logistics. Some examples from supervised learning and two algorithms for classification (taken from The Elements of Statistical Learning book).
  • Probability Basics: Slides on probability basics used to introduce Statistical Decision Theory.
  • Linear Classification Examples: slides presenting images, tables and examples about (generalized) linear methods for classification (taken from The Elements of Statistical Learning book).
  • Kernel Smoothing Examples: slides presenting images, tables and examples about Kernel Smoothing, Kernel Density Estimation and Gaussian Mixture Models (taken from The Elements of Statistical Learning book).
  • Decision Trees and Classification Rules: these slides have been used to present decision trees and decision rules complementing the material in Ch. 9.2 of the The Elements of Statistical Learning book.
  • Support Vector Machines: these slides have been used to present Support Vector Machines (taken from The Elements of Statistical Learning book).

Additional Papers

Papers used to integrate the textbook

Clustering Slides

These are the slides used to present clustering algorithms during lectures

  • Lesson 3: Mixture of Gaussians, DBSCAN, Jarvis-Patrick (slides, handouts)

Past Exams and Sample Questions

These are the text of past exams to give and idea on what to expect during the class exam:

2013 Homework

The 2013 Homework (alike the 2012 one) is organized as an octave series of tutorials. You are requested to go through the tutorials and practice with the algorithms that have been presented in class. To prove us you have done it and that you have understood the code you will be requested to solve few exercises and provide us a pdf report by email

  • Homework 2012 Regression: this is the text of the first part of the homework; it has been intentionally edited not to allow cut and paste. This part of the homework will contribute to the 10% of the grade and the deadline to submit the solution by email to matteucci@elet.polimi.it and malago@di.unimi.it is Sunday 09/06 23:59

For any question or doubt please sen us an email as soon as possible.


Note 1: for some strange reason the CSM of the website has decided to rename the files with capitals, please save them in lower case :-(

Note 2: rename the file Diabete.data into diabete.mat ... still fighting with the CSM :-)

Note 3: the code has been tested with octave under linux, we suggest to use it not to spend too much time with installing it under windows or using matlab. If you do not have linux installed, try using a live CD as the ubuntu 13.04 live distro ;-)