APPLIED MACHINE LEARNING
1
MSc Course MACHINE LEARNING TECHNIQUES AND APPLICATIONS - - PowerPoint PPT Presentation
APPLIED MACHINE LEARNING MSc Course MACHINE LEARNING TECHNIQUES AND APPLICATIONS Classification with GMM + Bayes 1 APPLIED MACHINE LEARNING Clustering, semi-supervised clustering and classification Classification Clustering
APPLIED MACHINE LEARNING
1
APPLIED MACHINE LEARNING
2
Labels class 1 Labels class 2 Unlabeled
Clustering No labels for the points!
Group points according to the geometrical distribution of points
Semi-supervised clustering Labels a faction of the points Classification All points are labelled
Use the labels to choose hyperparameters of clustering using F1-measure. Use the labels to determine the boundary between the two classes
APPLIED MACHINE LEARNING
3
APPLIED MACHINE LEARNING
4
Solution of GMM clustering with two Gaussian functions with isotropic/spherical covariance
APPLIED MACHINE LEARNING
5
1
1
2
2
APPLIED MACHINE LEARNING
6
1 1 1 1 1 1 2 2 2
1 1/2 /2 1 2 2 1/2 /2 2
T T
x x N x x N
APPLIED MACHINE LEARNING
7
1 1 1 1 1 1 2 2 2 2
| By Bayes: | , 1,2. Assuming equal class distribution, 1 2 and replacing in (1) | 1 | 1 1 ln | 2 | 2 log log
T T
p x y i p y i p y i x i p x p y p y p x y p x y p x y p x y x x x x
APPLIED MACHINE LEARNING
8
APPLIED MACHINE LEARNING
9
APPLIED MACHINE LEARNING
10
APPLIED MACHINE LEARNING
11
k
k k k
APPLIED MACHINE LEARNING
12
k k
1
T k k k k k k
APPLIED MACHINE LEARNING
13
APPLIED MACHINE LEARNING
14
APPLIED MACHINE LEARNING
16
APPLIED MACHINE LEARNING
17
1
l k k
K k k
l l
APPLIED MACHINE LEARNING
18
APPLIED MACHINE LEARNING
19
k
1,... 1,... 1 1
k k k k i k k k k i i k
k K k k i i n n k k i n T k k k i
APPLIED MACHINE LEARNING
20
APPLIED MACHINE LEARNING
21
Clustering with GMM Classification with GMM using Naïve Bayes Clustering does not have the class labels and hence end-up merging the classes
APPLIED MACHINE LEARNING
22
APPLIED MACHINE LEARNING
23
If one trains the algorithm with all datapoints, one cannot test if the algorithm can predict well. To test the ability of the mode to predict correctly the class labels, one trains the model using only a subset of datapoints sampled randomly and one tests the prediction of the model on the datapoints not used during training.
Class 1 Class 2
APPLIED MACHINE LEARNING
24
1) Sample the datapoints 2) Train the algorithm on the sampled points 3) Test the prediction of the learned model on the rest of the points
Class 1 Class 2 Sampled datapoints used for training Learned boundary between the classes Misclassified datapoint
APPLIED MACHINE LEARNING
25
1) Pick another sample of datapoints 2) Train the algorithm on the new sampled points 3) Test the prediction of the learned model on the rest of the points
Class 1 Class 2 Sampled datapoints used for training Learned boundary between the classes Misclassified datapoint
Crossvalidation: repeat training/testing procedure several times and compute average performance.
APPLIED MACHINE LEARNING
26
Training Set Testing Set
Crossvalidation
APPLIED MACHINE LEARNING
27
Training and validation sets are used to determine the sensitivity of the learning to the choice of hyperparameters (i.e. parameters not learned during training). Values for the hyperparameters are set through a grid search. Once the optimal hyperparameters have been picked, the model is trained with complete training + validation set and tested on the testing set. In practice, one often uses solely training and testing sets and performs crossvalidation directly on these.
Training Set Validation Set Testing Set
Crossvalidation Crossvalidation
APPLIED MACHINE LEARNING
28
Definition: “Cross validation is the practice
confirming an experimental finding by repeating the experiment using an independent assay technique"
Train data Test data All dataset
Random splits
f = 1 f = 2 f = F F folds
f-fold cross validation
1) Random split of the data between Train and Test 2) Repetition of classification
APPLIED MACHINE LEARNING
29
APPLIED MACHINE LEARNING
30
True Positives( ) : nm of datapoints of class 1 that are correctly classified False Negatives ( ) : nm of datapoints of class 1 that are incorrectly classified False Positives( ) : nm of datapoints of TP FN FP class 2 that are incorrectly classified Recall: Precision: 2*Precision*Recall Precision+Recall TP TP FN TP TP FP F
(careful: similar but not the same F-measure as the F-measure we saw for clustering!)
Tradeoff between classifying correctly all datapoints of the same class and making sure that each class contains points of only one class. Recall: Proportion of datapoints correctly classified in Class 1 Precision: proportion of datapoints of class 1 correctly classified over all datapoints classified in class 1
APPLIED MACHINE LEARNING
31
Class 1 Class 2 Sampled datapoints used for training Learned boundary between the classes Misclassified datapoint True Positive False Negative
True Positives( ) : nm of datapoints of class 1 that are correctly classified False Negatives ( ) : nm of datapoints of class 1 that are incorrectly classified False Positives( ) : nm of datapoints of TP FN FP class 2 that are incorrectly classified Recall: Precision: 2*Precision*Recall Precision+Recall TP TP FN TP TP FP F
False Positive
APPLIED MACHINE LEARNING
32
classification performance across the different folds
crossvalidation measures the sensitivity of the classifier to the choice of training/testing ratio and hyperparameters.
robustness of classification.
APPLIED MACHINE LEARNING
33
Model learned with SVM (see next week)
APPLIED MACHINE LEARNING
34
Situation worse for testing dataset!
Model learned with SVM (see next week)
APPLIED MACHINE LEARNING
35
GMM + Bayes less sensitive to unbalanced data as it trains each model on each class separately
Model learned with GMM + Bayes, 2 Gauss functions each
APPLIED MACHINE LEARNING
36
1| 2 | P y x P y x
| 1 | 2 , P x y P x y
APPLIED MACHINE LEARNING
37
0% 100% p(FP) p(TP) 100% Performance drops Performance improves
True Positives( ) : nm of datapoints of class 1 that are correctly classified False Positives( ) : nm of datapoints of class 2 that are incorrectly classified TP FP
Perfect classification Always negative Always positive
APPLIED MACHINE LEARNING
38
APPLIED MACHINE LEARNING
39
39
APPLIED MACHINE LEARNING
40
40
APPLIED MACHINE LEARNING
41
41
APPLIED MACHINE LEARNING
42
42
APPLIED MACHINE LEARNING
43
N: Nb of dimensions M: Nb of datapoints Computational Costs
APPLIED MACHINE LEARNING
44
(1 Gaussian per model, spherical covariance matrix)
APPLIED MACHINE LEARNING
45
(1 Gaussian per model, full covariance matrix)
APPLIED MACHINE LEARNING
46