Difference between revisions of "Machine Learning Bio"

From Chrome
Jump to: navigation, search
(Created page with "Work in progress, coming soon ...")
 
Line 1: Line 1:
Work in progress, coming soon ...
+
__FORCETOC__
 +
 
 +
The following are last minute news you should be aware of ;-)
 +
* 03/03/2020: The course is going to start soon ...
 +
 
 +
==Course Aim & Organization==
 +
<!--
 +
The objective of this course is to give an advanced presentation, i.e., a statistical perspective, of the techniques most used in artificial intelligence and machine learning for pattern recognition, knowledge discovery, and data analysis/modeling. The course will provide the basics of Regression, Classification, and Clustering with practical exercises using the R language.
 +
-->
 +
 
 +
===Teachers===
 +
 
 +
The course is composed by a blending of lectures and exercises by the course teacher and a teaching assistant.
 +
 
 +
* [http://www.deib.polimi.it/ita/personale/dettagli/267262 Matteo Matteucci]: the course teacher
 +
* [http://www.deib.polimi.it/ita/personale/dettagli/910274 Marco Cannici]: the teaching assistant
 +
 
 +
===Course Program===
 +
 
 +
Techniques from machine and statistical learning are presented from a theoretical (i.e., based on 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 mostly follows the following book which is also available for download in pdf
 +
 
 +
* [http://www-bcf.usc.edu/~gareth/ISL/ An Introduction to Statistical Learning with Applications in R] by Gareth James, Daniela Witten, Trevor Hastie and Robert Tibshirani
 +
 
 +
The course is composed by a set of ex-cattedra lectures on specific techniques (e.g., linear regression, linear discriminant analysis, clustering, etc.). Supervised and unsupervised learning are discussed in the framework of classification and clustering problems. The course outline is:
 +
 
 +
* '''''Machine Learning and Pattern Classification''''': the general concepts of Machine Learning and Patter Recognition are introduced with a brief review of Statistical Decision Theory;
 +
* '''''Linear Regression Techniques''''': linear methods for regression will be disccussed and compared (e.g., Linear Regression and Ridge Regression).
 +
* '''''Linear Classification Techniques''''': linear methods for classification will be presented as the starting point for more complex methods  (e.g., Linera Regression on the indicator matrix, Linear and Quadratic Discriminant Analysis, Logistic Regression, Percptron rule and Optimal Separating Hyperplanes, a.k.a., Support Vector Machines)
 +
* '''''Unsupervised Learning Techniques''''': the most common approaches to unsupervised learning are described mostly focusing on clustering techniques such as hierarchical clustering, k-means, k-medoids, Mixture of Gaussians, DBSCAN, Jarvis-Patrick, etc.;
 +
* '''''Model Validation and Selection''''': model validation and selection are orthogonal issues to all previous techniques; during the course their fundamentals are described and discussed in the framework of linear models for regression (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!!
 +
 
 +
Note: Lecture timetable interpretation
 +
* On Monday, in room V.S7-A, starts at 08:15 (cum tempore), ends at 10:15
 +
* On Tuesday, in room V.S7-A, starts at 09:15 (cum tempore), ends at 12:15
 +
 
 +
{| border="1" align="center" style="text-align:center;"
 +
|-
 +
|Date || Day || Time || Room || Teacher || Topic
 +
|-
 +
|17/09/2017 || Monday  || 08:15 - 10:15 || V.S7-A || Matteo Matteucci || Course Introduction (Ch. 1 ISL)
 +
|-
 +
|18/09/2017 || Tuesday || --- || --- || --- || No Lecture
 +
|-
 +
|24/09/2017 || Monday  || 08:15 - 10:15 || V.S7-A || Matteo Matteucci || Statistical Decision Theory and Bias-Variance trade off. (Ch. 2 ISL)
 +
|-
 +
|25/09/2017 || Tuesday || 09:15 - 12:15 || V.S7-A || Matteo Matteucci || Statistical Decision Theory and Model Assessment. (Ch. 2 ISL)
 +
|-
 +
|01/10/2017 || Monday  || 08:15 - 10:15 || V.S7-A || Davide Eynard || Introduction to R (Ch. 2 ISL)
 +
|-
 +
|02/10/2017 || Tuesday || 09:15 - 11:15 || V.S7-A || Davide Eynard || Statistical Decision Theory Exercises (Ch. 2 ISL)
 +
|-
 +
|08/10/2017 || Monday  || 08:15 - 10:15 || V.S7-A || Matteo Matteucci || Statistical Decision Theory and Model Assessment. (Ch. 2 ISL)
 +
|-
 +
|09/10/2017 || Tuesday || 09:15 - 12:15 || V.S7-A || Matteo Matteucci || Linear Regression (Ch. 2 ISL + Ch. 3 ISL)
 +
|-
 +
|15/10/2017 || Monday  || 08:15 - 10:15 || V.S7-A || Davide Eynard || Exercises on Simple Linear Regression (Ch. 3 ISL)
 +
|-
 +
|16/10/2017 || Tuesday || 09:15 - 12:15 || V.S7-A || Matteo Matteucci || Linear Regression (Ch. 2 ISL + Ch. 3 ISL)
 +
|-
 +
|22/10/2017 || Monday  || 08:15 - 10:15 || V.S7-A || Matteo Matteucci || Linear Regression and Feature Selection (Ch. 3 + Ch. 6 ISL)
 +
|-
 +
|23/10/2017 || Tuesday || 09:15 - 12:15 || V.S7-A || Matteo Matteucci || Linear Regression and Feature Selection (Ch. 3 + Ch. 6 ISL)
 +
|-
 +
|29/10/2017 || Monday  || 08:15 - 10:15 || V.S7-A || Matteo Matteucci || Linear Regression and Feature Selection (Ch. 3 + Ch. 6 ISL)
 +
|-
 +
|30/10/2017 || Tuesday || 09:15 - 12:15 || V.S7-A || Matteo Matteucci || Classification by Logistic Regression (Ch. 4 ISL + Ch. 4 ESL)
 +
|-
 +
|05/11/2017 || Monday  || --- || --- || --- || No Lecture (Suspension)
 +
|-
 +
|06/11/2017 || Tuesday || --- || --- || --- || No Lecture (Suspension)
 +
|-
 +
|12/11/2017 || Monday  || 08:15 - 10:15 || V.S7-A || Matteo Matteucci || Classification by Logistic Regression (Ch. 4 ISL + Ch. 4 ESL)
 +
|-
 +
|13/11/2017 || Tuesday || 09:15 - 11:15 || V.S7-A || Davide Eynard || Exercises on Linear Regression and Feature Selection
 +
|-
 +
|19/11/2017 || Monday  || 08:15 - 10:15 || V.S7-A || Davide Eynard || Exercises on Classification by Logistic Regression
 +
|-
 +
|20/11/2017 || Tuesday || 09:15 - 12:15 || V.S7-A || Davide Eynard || Exercises on Shrinkage methods
 +
|-
 +
|26/11/2017 || Monday  || 08:15 - 10:15 || V.S7-A || Matteo Matteucci || Classification by Linear Discriminant Analysis (Ch. 4 ISL)
 +
|-
 +
|27/11/2017 || Tuesday || 09:15 - 12:15 || V.S7-A || Matteo Matteucci || Classification by Linear Discriminant Analysis (Ch. 4 ISL)
 +
|-
 +
|03/12/2017 || Monday  || 08:15 - 10:15 || V.S7-A || Davide Eynard || Exercises on Classification by Linear Discriminant Analysis
 +
|-
 +
|04/12/2017 || Tuesday || --- || --- || --- || No Lecture
 +
|-
 +
|10/12/2017 || Monday  || 08:15 - 10:15 || V.S7-A || Davide Eynard || Clustering: Intro, k-means and the alike, GMM, and hierachical
 +
|-
 +
|11/12/2017 || Tuesday || 09:15 - 12:15 || V.S7-A || Davide Eynard || Clustering: Density-based, Spectral + Evaluation
 +
|-
 +
|14/12/2017 || Friday || 10:15 - 13:15 || TBD || Matteo Matteucci || Classification: from generative to discriminative approaches (Ch. 4 ISL + Ch. 4 ESL)
 +
|-
 +
|17/12/2017 || Monday  || 08:15 - 10:15 || V.S7-A || Matteo Matteucci || Support Vector Machines (Ch. 4 ESL, Ch. 9 ISL, Ch. 12 ESL)
 +
|-
 +
|18/12/2017 || Tuesday || 09:15 - 12:15 || V.S7-A || Matteo Matteucci || Support Vector Machines (Ch. 4 ESL, Ch. 9 ISL, Ch. 12 ESL)
 +
|-
 +
|}
 +
 
 +
Chapters are intended as complete except for
 +
* Ch.4 ESL: Section 4.5
 +
* Ch.12 ESL: Sections 12.1, 12.2, 12.3
 +
* Ch.9 ISL: Sections 9.1, 9.2, 9.3
 +
-->
 +
<!--
 +
{| border="1" align="center" style="text-align:center;"
 +
|-
 +
|Date || Day || Time || Room || Teacher || Topic
 +
|-
 +
|18/09/2017 || Monday  || 10:15 - 13:15 || V.S8-A || Matteo Matteucci || Course Introduction (Ch. 1 ISL)
 +
|-
 +
|19/09/2017 || Tuesday || 08:15 - 10:15 || V.S8-B || Matteo Matteucci || Statistical Decision Theory and Bias-Variance trade off. (Ch. 2 ISL)
 +
|-
 +
|25/09/2017 || Monday  || 10:15 - 13:15 || V.S8-A || --- || No Lecture
 +
|-
 +
|26/09/2017 || Tuesday || 08:15 - 10:15 || V.S8-B || Davide Eynard    || Introduction to R (Ch. 2 ISL)
 +
|-
 +
|02/10/2017 || Monday  || 10:15 - 13:15 || V.S8-A || Matteo Matteucci || Statistical Decision Theory and Model Assessment. (Ch. 2 ISL)
 +
|-
 +
|03/10/2017 || Tuesday || 08:15 - 10:15 || V.S8-B || Davide Eynard || Statistical Decision Theory Exercises (Ch. 2 ISL)
 +
|-
 +
|09/10/2017 || Monday  || 10:15 - 13:15 || V.S8-A || Matteo Matteucci || Statistical Decision Theory and Model Assessment. (Ch. 2 ISL)
 +
|-
 +
|10/10/2017 || Tuesday || 08:15 - 10:15 || V.S8-B || Davide Eynard || Statistical Decision Theory Exercises (Ch. 2 ISL)
 +
|-
 +
|16/10/2017 || Monday  || 10:15 - 13:15 || V.S8-A || Matteo Matteucci || Linear Regression (Ch. 2 ISL + Ch. 3 ISL)
 +
|-
 +
|17/10/2017 || Tuesday || 08:15 - 10:15 || V.S8-B || Davide Eynard || Exercises on Simple Linear Regression (Ch. 3 ISL)
 +
|-
 +
|23/10/2017 || Monday  || 10:15 - 13:15 || V.S8-A || --- || No Lecture
 +
|-
 +
|24/10/2017 || Tuesday  || 08:15 - 10:15 || V.S8-B || --- || No Lecture
 +
|-
 +
|30/10/2017 || Monday  || 10:15 - 13:15 || V.S8-A || Matteo Matteucci || Linear Regression (Ch. 2 ISL + Ch. 3 ISL)
 +
|-
 +
|31/10/2017 || Tuesday || 08:15 - 10:15 || V.S8-B || Davide Eynard || Exercises on Simple Linear Regression (Ch. 3 ISL)
 +
|-
 +
|06/11/2017 || Monday  || 10:15 - 13:15 || V.S8-A || Matteo Matteucci || Linear Regression and Feature Selection (Ch. 3 + Ch. 6 ISL)
 +
|-
 +
|07/11/2017 || Tuesday || 08:15 - 10:15 || V.S8-B || Davide Eynard || Exercises on Linear Regression and Feature Selection
 +
|-
 +
|13/11/2017 || Monday  || 10:15 - 13:15 || V.S8-A || --- || No Lecture (Suspension)
 +
|-
 +
|14/11/2017 || Tuesday  || 08:15 - 10:15 || V.S8-B || --- || No Lecture (Suspension)
 +
|-
 +
|20/11/2017 || Monday  || 10:15 - 13:15 || V.S8-A || Matteo Matteucci || Classification by Logistic Regression (Ch. 4 ISL + Ch. 4 ESL)
 +
|-
 +
|21/11/2017 || Tuesday || 08:15 - 10:15 || V.S8-B || Davide Eynard || Exercises on Classification by Logistic Regression
 +
|-
 +
|27/11/2017 || Monday  || 10:15 - 13:15 || V.S8-A || Matteo Matteucci || Classification by Linear Discriminant Analysis (Ch. 4 ISL)
 +
|-
 +
|28/11/2017 || Tuesday || 08:15 - 10:15 || V.S8-B || Davide Eynard || Lecture canceled
 +
|-
 +
|04/12/2017 || Monday  || 10:15 - 13:15 || V.S8-A || Matteo Matteucci || Classification: from generative to discriminative approaches (Ch. 4 ISL + Ch. 4 ESL)
 +
|-
 +
|05/12/2017 || Tuesday || 08:15 - 10:15 || V.S8-B || Davide Eynard || Exercises on Classification by Linear Discriminant Analysis
 +
|-
 +
|11/12/2017 || Monday  || 10:15 - 13:15 || V.S8-A || Matteo Matteucci || Support Vector Machines (Ch. 4 ESL, Ch. 9 ISL, Ch. 12 ESL)
 +
|-
 +
|12/12/2017 || Tuesday || 08:15 - 10:15 || V.S8-B || Davide Eynard || Clustering: Intro, k-means and the alike
 +
|-
 +
|18/12/2017 || Monday  || 10:15 - 13:15 || V.S8-A || Matteo Matteucci || Support Vector Machines (Ch. 4 ESL, Ch. 9 ISL, Ch. 12 ESL)
 +
|-
 +
|19/12/2017 || Tuesday || 08:15 - 10:15 || V.S8-B || Davide Eynard || Clustering: GMM, Hierarchical and Density-based
 +
|-
 +
|19/12/2017 || Tuesday || 10:15 - 12:15 || V.S8-B || Davide Eynard || Clustering: Spectral + Evaluation
 +
|-
 +
|}
 +
-->
 +
 
 +
===Course Evaluation===
 +
 
 +
The course evaluation is composed by two parts:
 +
 
 +
* HW: Homework with exercises covering the whole program
 +
* WE: A written examination covering the whole program
 +
 
 +
<!--
 +
the final score will take the '''MAXIMUM''' between '''WE''' and the combination '''0.7*WE + 0.3*HW'''. In practice
 +
 
 +
* the homework can only increase your score
 +
* the homework can only impact for the 30% of the score
 +
* the homework is not mandatory
 +
-->
 +
<!--
 +
===Homeworks===
 +
 
 +
Please keep in mind:
 +
* the homework is not meant to get more grade, it is intended for you to understand better, i.e., from a practical perspective too, the topics of the course
 +
* provided you attended the lab lectures, and you have the R environment set up, the homework should require not more than 1 day per part
 +
* the deadline to turn the homework is the 28th of February 2019 we will grade it when grading your classwork
 +
* you can make the homework in groups up to 2/3 people
 +
 
 +
====Homework 2018/201====
 +
 
 +
We have published the [http://davide.eynard.it/2019/01/28/statistical-learning-with-r-2019-edition/ Homework 2018/2019].
 +
 
 +
====Homework 2017/2018====
 +
 
 +
We have published the [http://davide.eynard.it/2017/12/27/statistical-learning-with-r-2018-edition/ Homework 2017/2018].
 +
 
 +
====Homework 2016/2017====
 +
 
 +
We have published the [http://davide.eynard.it/2017/01/19/statistical-learning-with-r-2017-edition/ Homework 2016/2017].
 +
 
 +
====Homework 2015/2016====
 +
 
 +
We have published the [http://davide.eynard.it/2016/01/11/statistical-learning-with-r-2016-edition/ Homework 2015/2016].
 +
 
 +
====Homework 2014/2015====
 +
 
 +
We have published the [http://davide.eynard.it/2015/01/05/statistical-learning-with-r-introduction-and-setup/ Homework 2014/2015].
 +
 
 +
==Teaching Material (the textbook)==
 +
 
 +
Lectures will be based on material taken from the book.
 +
 
 +
* [http://www-bcf.usc.edu/~gareth/ISL/ An Introduction to Statistical Learning with Applications in R] by Gareth James, Daniela Witten, Trevor Hastie and Robert Tibshirani
 +
 
 +
If you are interested in a more deep treatment of the topics you can refer to the following book from the same authors
 +
 
 +
* [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.
 +
 
 +
Lectures:
 +
* [[Media:ML-2017-01-Intro.pdf | [2017] Course introduction]]: introductory slides of the course with useful information about the grading, and the course logistics. Some examples from supervised and unsupervised learning. Regression, classification, clustering terminology and examples.
 +
* [[Media:ML-2017-02-StatisticalLearning.pdf | [2017] Statistical Learning Introduction]]: Statistical Learning definition, rationale, and trade-offs (e.g., prediction vs. inference, parametric vs non parametric models, flexibility vs. interpretability, etc.)
 +
* [[Media:ML-2016-03-AssessingModelAccuracy.pdf | [2016] Statistical Learning and Model Assessment]]: Model Assessment for Regression and Classification, Bias-Variance trade-off, Model complexity and overfitting, K-Nearest Neighbors Classifier vs. Bayes Classifier.
 +
* [[Media:ML-2016-04-LinearRegression.pdf | [2016] Linear Regression]]: Simple Linear Regression and Multiple Linear Regression. Feature selection. Ridge Regression and Lasso.
 +
* [[Media:ML-2016-05-LinearClassification.pdf | [2016] Linear Classification]]: From Linear Regression to Logistic Regression. Linear Discriminant Analysis and Quadratic Discriminant Analysis. Comparison between linear classification methods.
 +
* [[Media:ML-2016-06-SupportVectorMachines.pdf | [2016] Support Vector Machines]]: Discriminative vs. generative methids. Hyperplanes learning and Perceptron. Maximum Margin Classifiers. The Kernel trick and Support Vector Machines.
 +
 
 +
For exercises and lab material please refer to [http://davide.eynard.it/pattern-analysis-and-machine-intelligence-2015-2016/ Davide Eynard website].
 +
 
 +
===Additional Resources===
 +
Papers and links useful to integrate the textbook
 +
 
 +
* [http://scott.fortmann-roe.com/docs/BiasVariance.html Bias vs. Variance]: "Understanding the Bias-Variance Tradeoff" essay by Scott Fortmann-Roe
 +
* [http://www.onmyphd.com/?p=kkt.karush.kuhn.tucker Karush Kuhn Tucker Conditions]: a short note on their meaning with references to relevant wikipedia pages
 +
* [http://students.brown.edu/seeing-theory/ Seeing Theory]: a website where the basic concepts of probability and statistics are explained in a visual way.
 +
 
 +
===Past Exams and Sample Questions===
 +
For some samples of exams you can check the last year PAMI ones
 +
 
 +
* [[Media:2016_02_03_PAMI.pdf |03/02/2016 PAMI Exam]]
 +
* [[Media:2016_02_19_PAMI.pdf |19/02/2016 PAMI Exam]]
 +
* [[Media:2016_07_06_PAMI.pdf |06/07/2016 PAMI Exam]]
 +
* [[Media:2016_09_09_PAMI.pdf |09/09/2016 PAMI Exam]]
 +
* [[Media:2016_09_28_PAMI.pdf |28/09/2016 PAMI Exam]]
 +
 
 +
===Online Resources===
 +
 
 +
The following are links to online sources which might be useful to complement the material above
 +
 
 +
* [http://math.arizona.edu/~hzhang/math574m.html MATH 574M] University of Arizona Course on ''Statistical Machine Learning and Data Mining''; here you can find slides covering part of the course topics (the reference book for this course is again ''The Elements of Statistical Learning'')
 +
-->
 +
<!--
 +
== 2013-2014 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
 +
 
 +
=== Part 1: Linear Classification Methods ===
 +
 
 +
* [[Media:homework_pami_classification_2013_2014.pdf | Homework 2013-2014 on Classification]]: 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 Sunday 17/11 23:59'''
 +
** [[Media:SAheart.data | SAheart.data]]: the dataset used for the homework
 +
** [[Media:SAheart.info | SAheart.info]]: the dataset used for the homework
 +
 
 +
'''Note 1:''' Submit the solution by loading it on www.dropitto.me/matteucci (pwd is dropittome)
 +
 
 +
'''Note 2:''' please name your pdf as pami_SURNAME_STUDENTID_classification.pdf; if you submit a homework for different people, please pick one of the names for the file but PUT ALL THE NAMES IN THE COVER PAGE!!
 +
 
 +
=== Part 2: Regression ===
 +
* [[Media:homework_pami_regression_2013_2014.pdf | Homework 2013-2014 Regression]]: 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 and the deadline to submit the solution by email to malago@di.unimi.it (cc to matteo.matteucci@polimi.it) is Friday 20/12 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
 +
** [[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
 +
 
 +
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 :-(
 +
 
 +
<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 ;-)
 +
 
 +
=== Part 3: Clustering ===
 +
 
 +
The code and the text of the third part of the homework are available online at this post
 +
 
 +
* [http://davide.eynard.it/2013/12/30/octave-clustering-demo-part-6-more-evaluation/ Homework 2013-2014 on clustering evaluation]
 +
 
 +
As usual, '''this part of the homework will contribute to the 10% of the grade'''; the deadline to submit the solution is the end of the course. You have to '''send it to davide.eynard_at_gmail.com Friday 24/01 23:59'''.
 +
 
 +
'''Note 1:''' for any doubt or question send an email, as soon as possible, to Davide Eynard so to have a prompt reply and not get stuck during homework execution.
 +
 
 +
'''Note 2:''' you have to turn in only the solution of "Ocatave clustering demo part 6", while the other parts can be used as reference to improve your understanding in basic clustering algorithms.
 +
 
 +
=== Part 2: Classification ===
 +
 
 +
* [[Media:homework_pami_classification_2013.pdf | Homework 2013 Classification]]: 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 and the deadline to submit the solution by Sunday 23/06 23:59'''
 +
** [[Media:SAheart.data | SAheart.data]]: the dataset used for the homework
 +
** [[Media:SAheart.info | SAheart.info]]: the dataset used for the homework
 +
 
 +
'''Note 1:''' Submit the solution by loading it on www.dropitto.me/matteucci (pwd is dropittome)
 +
 
 +
'''Note 2:''' please name your pdf as pami_SURNAME_STUDENTID_classification.pdf; if you submit a homework for different people, please pick one of the names for the file but PUT ALL THE NAMES IN THE COVER PAGE!!
 +
 
 +
 
 +
 
 +
'''Errata Corrige''': there were a few bugs in the homework text. I have updated the pdf and they were:
 +
 
 +
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 Fisher projection it is more correct to use only the training data to learn the projection and then we can train and test on the corresponding subsets
 +
 
 +
a = FisherProjection(X(training,:),Y(training,:));
 +
reducedX = X*a(:,1);
 +
[mu_0, mu_1, sigma, p_0, p_1] = linearDiscriminantAnalysis_train(reducedX(training), Y(training))
 +
 
 +
I forgot to filter for just the training samples when performing Quadratic Discriminant Analysis
 +
 
 +
quadX = expandToQuadraticSpace(X);
 +
%check this out!
 +
size(quadX)
 +
beta = linearRegression_train(quadX(training), Y(training));
 +
 
 +
And in general you should always train on the training data and test on the testing data ;-).
 +
 
 +
=== Part 3: Clustering ===
 +
 
 +
The code and the text of the third part of the homework are available online at these posts
 +
 
 +
* [http://davide.eynard.it/2013/06/18/octave-clustering-demo-part-4-k-medoids/ Homework 2013 on k-medoids]
 +
* [http://davide.eynard.it/2013/06/18/octave-clustering-demo-part-5-hierarchical-clustering/ Homework 2013 on hierarchical clustering]
 +
 
 +
As usual, '''this part of the homework will contribute to the 10% of the grade'''; the deadline to submit the solution is '''before the you take the exam''' sending it to davide.eynard_at_gmail.com.
 +
 
 +
* [http://davide.eynard.it/2012/06/05/octave-clustering-demo-part-0-introduction-and-setup/ Homework 2012 part 3:] follow this tutorial and answer the questions from all 5 sub-tutorials.
 +
 
 +
== 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 17:38, 3 March 2020


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

* 03/03/2020: The course is going to start soon ...

Course Aim & Organization

Teachers

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

Course Program

Techniques from machine and statistical learning are presented from a theoretical (i.e., based on 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 mostly follows the following book which is also available for download in pdf

The course is composed by a set of ex-cattedra lectures on specific techniques (e.g., linear regression, linear discriminant analysis, clustering, etc.). Supervised and unsupervised learning are discussed in the framework of classification and clustering problems. The course outline is:

  • Machine Learning and Pattern Classification: the general concepts of Machine Learning and Patter Recognition are introduced with a brief review of Statistical Decision Theory;
  • Linear Regression Techniques: linear methods for regression will be disccussed and compared (e.g., Linear Regression and Ridge Regression).
  • Linear Classification Techniques: linear methods for classification will be presented as the starting point for more complex methods (e.g., Linera Regression on the indicator matrix, Linear and Quadratic Discriminant Analysis, Logistic Regression, Percptron rule and Optimal Separating Hyperplanes, a.k.a., Support Vector Machines)
  • Unsupervised Learning Techniques: the most common approaches to unsupervised learning are described mostly focusing on clustering techniques such as hierarchical clustering, k-means, k-medoids, Mixture of Gaussians, DBSCAN, Jarvis-Patrick, etc.;
  • Model Validation and Selection: model validation and selection are orthogonal issues to all previous techniques; during the course their fundamentals are described and discussed in the framework of linear models for regression (e.g., AIC, BIC, cross-validation, etc. ).

Detailed course schedule

Course Evaluation

The course evaluation is composed by two parts:

  • HW: Homework with exercises covering the whole program
  • WE: A written examination covering the whole program