apprentissage statistique en bio-informatique...
TRANSCRIPT
![Page 1: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/1.jpg)
Apprentissage statistique enBio-Informatique
Régularisation et noyaux
ES APPRENTISSAGE ARTIFICIEL
Judith AbécassisCentre for Computational Biology, Mines ParisTechjudith.abecassis@minesparistech.fr
Material by Chloé-Agathe Azencott
![Page 2: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/2.jpg)
Centre for Computational Biology● Centre de recherche des MINES● Associé à un centre de recherche cancer
(Institut Curie)● Thématique : développement et mise en œuvre
de méthodes de machine learning pour la bioinformatique du cancer
![Page 3: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/3.jpg)
Supervised machine learning in bioinformatics
● Quelles données ?– Images biologiques– Données génomiques
● Reads de séquençage ADN ou ARN, mutations d'une seule paire de base (SNPs), méthylation, etc
– Screens de composés chimiques– De plus en plus : dossiers patients
![Page 4: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/4.jpg)
Supervised machine learning in bioinformatics
● Quels problèmes ?● Régression :
– Gene expression regulation: how much of this gene will be expressed?
– When will this patient relapse?– Drug eff icacy: how well does this drug work on this
tumor?– What is the binding aff inity between these two
molecules?– How soluble is this chemical in water?
![Page 5: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/5.jpg)
Small n, large p problems● Few patients, many features (cost of data, rare
diseases, invasiveness of data collection)● Challenges of high-dimension:
– Curse of dimensionality (intuitions that work in 2D may not work in higher dimensions)
– Overf itting is more likely– Problems become ill-posed
![Page 6: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/6.jpg)
6
Linear regression
typical length of a human protein: 100-600 amino acids
![Page 7: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/7.jpg)
7
Linear regression least-squares f it
● Minimize the residual sum of squares
![Page 8: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/8.jpg)
8
Linear regression least-squares f it
● Minimize the residual sum of squares
Historically:– Carl Friedrich Gauss (to predict the location of
Ceres)– Adrien Marie Legendre
![Page 9: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/9.jpg)
9
Linear regression least-squares f it
● Minimize the residual sum of squares
Estimate � :
![Page 10: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/10.jpg)
10
Linear regression least-squares f it
● Minimize the residual sum of squares
● Assuming X has full column rank (and hence XTX invertible):
![Page 11: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/11.jpg)
11
If n << p● X (dimensions n x p) cannot have full column
rank● Therefore XTX cannot be inverted● An inf inity of solutions exist
– One can be found using gradient descent or a pseudo-inverse
– High variance of the estimator● Large p reduces the interpretability of the model
– Very important in many bioinformatics applications, but not only
![Page 12: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/12.jpg)
12
Linear regression when p >> n
Simulated data: p=1000, n=100, 10 causal features
True coeff icients
Predicted coeff icients
![Page 13: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/13.jpg)
13
Linear regression when p >> n
Simulated data: p=1000, n=100, 10 causal features
True coeff icients
Predicted coeff icients
![Page 14: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/14.jpg)
14
Regularization
![Page 15: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/15.jpg)
15
Regularization● Minimize
Prediction error + � penalty on model complexity● Biased estimator when � � 0.● Trade bias for a smaller variance.● � can be set by cross-validation.
● Simpler model � fewer parameters � shrinkage: drive the coeff icients of the parameters towards 0.
![Page 16: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/16.jpg)
16
Ridge regression
![Page 17: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/17.jpg)
17
Ridge regression● Sum-of-squares penalty
● Equivalent to
for a unique one-to-one match between t and � .
● Ridge regression estimator:
= always!
![Page 18: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/18.jpg)
18
Ridge regression solution path
decreasing value of �
fea
ture
co
eff
icie
nts
![Page 19: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/19.jpg)
19
Standardization
● Multiply xj by a constant:
– For standard linear regression:
– For ridge regression:Not so clear, because of the penalization term
● Need to standardize the features
average value of xj
![Page 20: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/20.jpg)
20
Ridge regression● Grouped selection:
– correlated variables get similar weights– identical variables get identical weights
● Ridge regression shrinks coeff icients towards 0 but does not result in a sparse model.
● Sparsity: – many coeff icients get a weight of 0 – they can be eliminated from the model.
![Page 21: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/21.jpg)
21
Lasso
![Page 22: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/22.jpg)
22
Lasso● L1 penalty
● aka basis pursuit (signal processing)● no closed-form solution● Equivalent to
for a unique one-to-one match between t and � .
![Page 23: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/23.jpg)
23
Geometric interpretation
iso-contours of the least-squares error
L1 norm L2 norm
� 1
� 2
feasible region:|� 1| + |� 2| � t
unconstrained min.= least-squares sol.
� 1
� 2
feasible region:� 1² + � 2² � t
constrained minimum: where the iso-contrours of the error meet the feasible region. Because l1 balls are squares, this is more likely to happen on a corner, where some of the coordinates are 0.
![Page 24: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/24.jpg)
24
Lasso solution path
decreasing value of �
fea
ture
co
eff
icie
nts
![Page 25: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/25.jpg)
25
Linear regression when p >> n
Simulated data: p=1000, n=100, 10 causal features
True coeff icients
Predicted coeff icients
![Page 26: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/26.jpg)
26
Elastic Net
![Page 27: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/27.jpg)
27
Elastic Net● Combine lasso and ridge regression
– Select variables like the lasso.– Shrinks together coeff icients of correlated
variables like the ridge regression.
![Page 28: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/28.jpg)
28
E.g. Leukemia data
Elastic Net results in more non-zero coeff icients than Lasso, but with smaller amplitudes.
![Page 29: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/29.jpg)
Supervised machine learning in bioinformatics
● Quels problèmes ?● Classif ication :
– What is the function of this gene?– Is this DNA sequence a micro-RNA?– Does this blood sample come from a diseased or a
healthy individual?– Is this drug appropriate for this patient?– What side effects could this new drug have?
![Page 30: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/30.jpg)
30
Logistic regression
![Page 31: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/31.jpg)
31
Classif ication● Ridge regression:
● Uses the squared loss● For classif ication, use
– a different decision/prediction function– a different loss
![Page 32: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/32.jpg)
32
Classif ication● Ridge regression:
● Uses the squared loss● For classif ication, use
– a different decision function– a different loss
![Page 33: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/33.jpg)
33
Classif ication● Model P(Y=1|x) as a linear function?
– Problem: P(Y=1|x) must be between 0 and 1.– Use a logit transformation
� Logistic regression.p f(x)
![Page 34: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/34.jpg)
34
Classif ication● Ridge regression:
● Uses the squared loss● For classif ication, use
– a different decision function– a different loss
![Page 35: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/35.jpg)
35
Classif ication● Ridge regression:
● Uses the squared loss● For classif ication, use
– a different decision function– a different loss: the logistic loss
![Page 36: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/36.jpg)
36
Classif ication● Ridge regression:
● Uses the squared loss● For classif ication, use
– a different decision function– a different loss: the logistic loss
![Page 37: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/37.jpg)
37
Classif ication
– a different decision function– a different loss: the logistic loss
y = 1 y = 0
f(x) f(x)
Err
or
Err
or
![Page 38: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/38.jpg)
38
Support vector machines
![Page 39: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/39.jpg)
39
Linear classif ier
Assume data is linearly separable: there exists a line that separates + from -
![Page 40: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/40.jpg)
40
Linear classif ier
![Page 41: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/41.jpg)
41
Linear classif ier
![Page 42: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/42.jpg)
42
Linear classif ier
![Page 43: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/43.jpg)
43
Linear classif ier
![Page 44: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/44.jpg)
44
Linear classif ier
![Page 45: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/45.jpg)
45
Linear classif ier
![Page 46: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/46.jpg)
46
Linear classif ier
Which one is better?
![Page 47: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/47.jpg)
47
Margin of a linear classif ier
Margin: Twice the distance from the separatinghyperplane to the closest training point.
![Page 48: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/48.jpg)
48
Largest margin hyperplane
![Page 49: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/49.jpg)
49
Classif ication of the training points
● We want the training points to be on the correct side of the “road” def ined by the separating hyperplane + margin
● Correct classif ication of the training points:– For positive examples:
– For negative examples:
– Summarized as
![Page 50: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/50.jpg)
50
Hinge loss
● We want for all i:● Hinge loss function:
1
1
![Page 51: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/51.jpg)
51
Classif ication● Ridge regression:
● Uses the squared loss● For classif ication, use a different loss
– Hinge loss:
![Page 52: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/52.jpg)
52
Classif ication● Ridge regression:
● Uses the squared loss● For classif ication, use a different loss
– Hinge loss:
– Support Vector Machine:
![Page 53: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/53.jpg)
53
Large margin classif ier● Minimizing the l2 norm of the regression
coeff icient is equivalent to maximizing the margin
![Page 54: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/54.jpg)
54
Margin of a linear classif ier
![Page 55: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/55.jpg)
55
Margin of a linear classif ier
![Page 56: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/56.jpg)
56
Largest margin classif ier:Support vector machines
![Page 57: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/57.jpg)
57
Dual formulation of the SVM
● Equivalently, maximize
● under the constraints
![Page 58: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/58.jpg)
58
From optimization theory● Slater's condition (strong duality) primal and
dual problems have the same optimum.
● Karush-Kuhn-Tucker Conditions give us a relation between dual and primal solution
● Geometric interpretation
“easy” “hard” “somewhat hard”
![Page 59: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/59.jpg)
59
Support vectors of the soft-margin SVM
� = 0
0< � < C
� = C
![Page 60: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/60.jpg)
60
Primal vs. dual● What is the dimension of the primal
problem?
● What is the dimension of the dual problem?
![Page 61: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/61.jpg)
61
Primal vs. dual● Primal: (w, b) has dimension (p+1).
Favored if the data is low-dimensional.
● Dual: � has dimension n.
Favored is there is little data available.
![Page 62: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/62.jpg)
62
Kernel methods
![Page 63: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/63.jpg)
63
Non-linear SVMs
![Page 64: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/64.jpg)
64
Non-linear mapping to a feature space
R
![Page 65: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/65.jpg)
65
Non-linear mapping to a feature space
R R2
![Page 66: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/66.jpg)
66
SVM in the feature space● Train:
under the constraints
● Predict with the decision function
![Page 67: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/67.jpg)
67
Kernels
For a given mapping
from the space of objects X to some Hilbert space H, the kernel between two objects x and x' is the inner product of their images in the feature spaces.
e.g.
![Page 68: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/68.jpg)
68
SVM with a kernel● Train:
under the constraints
● Predict with the decision function
![Page 69: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/69.jpg)
69
Kernel trick● Many linear algorithms (in particular, linear
SVMs) can be performed in the feature space H without explicitly computing the images � (x), but instead by computing kernels K(x, x'):– SVMs, but also– Ridge regression (but not the Lasso)– Dimensionality reduction: PCA– Clustering: k-means
● It is sometimes easy to compute kernels which correspond to large-dimensional feature spaces: K(x, x') is often much simpler to compute than � (x).
![Page 70: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/70.jpg)
70
Exemple 1: Polynomial kernels
More generally, for
is an inner product in a feature space of all monomials of degree up to d.
K is much easier to compute than � .
![Page 71: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/71.jpg)
71
Which functions are kernels?● A function K(x, x') def ined on a set X is a kernel iff it
exists a Hilbert space H and a mapping � : X � H such that, for any x, x' in X:
● A function K(x, x') def ined on a set X is positive def inite iff it is symmetric and satisf ies:
● Theorem [Aronszajn, 1950]: K is a kernel iff it is positive def inite.
● Matrix K(x,x') for any x, x' in X is called Gram matrix
![Page 72: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/72.jpg)
72
Exemple 1: Gaussian RBF kernel
● Corresponds to a feature space of inf inite dimension (containing all monomials)
![Page 73: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/73.jpg)
73
Exemple 2: String kernels● Exemple of application: protein classif ication
Goal: predict which proteins are secreted or not, based on their sequence.
![Page 74: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/74.jpg)
74
Substring-based representations● Represent strings based on the
presence/absence of substrings of f ixed length.
– Number of occurrences of u in x: spectrum kernel [Leslie et al., 2002].
![Page 75: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/75.jpg)
75
Spectrum kernel
● Implementation:– Formally, a sum over |Ak|terms– At most |x| - k + 1 non-zero terms in – Hence: Computation in O(|x|+|x'|)
● Fast prediction for a new sequence x:
![Page 76: Apprentissage statistique en Bio-Informatique ...members.cbio.mines-paristech.fr/~jabecassis/files/ES_Apprentissage... · Apprentissage statistique en Bio-Informatique Régularisation](https://reader033.vdocuments.net/reader033/viewer/2022041519/5e2d919b89eb9d25b60ec97c/html5/thumbnails/76.jpg)
76
Spectrum kernel
● Implementation:– Formally, a sum over |Ak|terms– At most |x| - k + 1 non-zero terms in – Hence: Computation in O(|x|+|x'|)
● Fast prediction for a new sequence x:
for proteins: alphabet of 22 amino acidsconsidering 5-mers: 215 > 4 million