Blame

36084c lugonthier 2026-07-02 14:39:19
Add new content and images for Linear Models, Regularization, SVMs, and Decision Trees - Added images for linear regression, logistic regression, and perceptron. - Introduced a new section on Regularization and High-Dimensional Inference with detailed explanations and images. - Added content on Support Vector Machines, including definitions, loss functions, and kernel methods. - Created a new section on Decision Trees and Ensemble Methods, covering CART, bagging, random forests, and boosting. - Included relevant images to illustrate concepts in Decision Trees and Ensemble Methods.
1
# 4. Modèles linéaires
1c3139 Lucas Gonthier 2026-06-30 12:04:21
Initial commit: course content (Machine Learning, MLOps) in EN and FR Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2
3
Les modèles linéaires prédisent à partir d'un score linéaire $\theta^T x$. Ce module couvre la régression linéaire (cibles continues), la régression logistique (classification binaire) et le cadre des modèles linéaires généralisés qui unifie les deux via la famille exponentielle. Chaque modèle est ajusté par maximum de vraisemblance et partage la même mise à jour par gradient.
4
5
**Objectifs**
6
- Définir l'hypothèse linéaire et ajuster $\theta$ par la mise à jour LMS ou par l'équation normale en forme close.
7
- Comprendre pourquoi les moindres carrés sont l'estimation du maximum de vraisemblance sous bruit gaussien.
8
- Transformer le score linéaire en probabilité via la sigmoïde et l'ajuster par montée de gradient ou méthode de Newton.
9
- Classer avec le perceptron et savoir quand sa règle d'apprentissage converge.
10
- Reconnaître la forme de la famille exponentielle et construire un MLG à partir de ses trois hypothèses.
11
- Retrouver les régressions linéaire, logistique et softmax comme cas particuliers.
12
36084c lugonthier 2026-07-02 14:39:19
Add new content and images for Linear Models, Regularization, SVMs, and Decision Trees - Added images for linear regression, logistic regression, and perceptron. - Introduced a new section on Regularization and High-Dimensional Inference with detailed explanations and images. - Added content on Support Vector Machines, including definitions, loss functions, and kernel methods. - Created a new section on Decision Trees and Ensemble Methods, covering CART, bagging, random forests, and boosting. - Included relevant images to illustrate concepts in Decision Trees and Ensemble Methods.
13
## 4.1 Régression linéaire
1c3139 Lucas Gonthier 2026-06-30 12:04:21
Initial commit: course content (Machine Learning, MLOps) in EN and FR Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
14
36084c lugonthier 2026-07-02 14:39:19
Add new content and images for Linear Models, Regularization, SVMs, and Decision Trees - Added images for linear regression, logistic regression, and perceptron. - Introduced a new section on Regularization and High-Dimensional Inference with detailed explanations and images. - Added content on Support Vector Machines, including definitions, loss functions, and kernel methods. - Created a new section on Decision Trees and Ensemble Methods, covering CART, bagging, random forests, and boosting. - Included relevant images to illustrate concepts in Decision Trees and Ensemble Methods.
15
### 4.1.1 Hypothèse
1c3139 Lucas Gonthier 2026-06-30 12:04:21
Initial commit: course content (Machine Learning, MLOps) in EN and FR Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
16
17
L'hypothèse est linéaire en l'entrée augmentée $x \in \mathbb{R}^{n+1}$ avec $x_0 = 1$ et les paramètres $\theta \in \mathbb{R}^{n+1}$ :
18
19
$$\boxed{ h_\theta(x) = \theta^T x }$$
20
36084c lugonthier 2026-07-02 14:39:19
Add new content and images for Linear Models, Regularization, SVMs, and Decision Trees - Added images for linear regression, logistic regression, and perceptron. - Introduced a new section on Regularization and High-Dimensional Inference with detailed explanations and images. - Added content on Support Vector Machines, including definitions, loss functions, and kernel methods. - Created a new section on Decision Trees and Ensemble Methods, covering CART, bagging, random forests, and boosting. - Included relevant images to illustrate concepts in Decision Trees and Ensemble Methods.
21
### 4.1.2 Fonction de coût
1c3139 Lucas Gonthier 2026-06-30 12:04:21
Initial commit: course content (Machine Learning, MLOps) in EN and FR Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
22
23
Le coût est défini comme la demi-somme des carrés des résidus sur les $m$ exemples :
24
25
$$\boxed{ J(\theta) = \tfrac{1}{2}\sum_{i=1}^{m}\left(h_\theta(x^{(i)}) - y^{(i)}\right)^2 }$$
26
36084c lugonthier 2026-07-02 14:39:19
Add new content and images for Linear Models, Regularization, SVMs, and Decision Trees - Added images for linear regression, logistic regression, and perceptron. - Introduced a new section on Regularization and High-Dimensional Inference with detailed explanations and images. - Added content on Support Vector Machines, including definitions, loss functions, and kernel methods. - Created a new section on Decision Trees and Ensemble Methods, covering CART, bagging, random forests, and boosting. - Included relevant images to illustrate concepts in Decision Trees and Ensemble Methods.
27
### 4.1.3 Mise à jour LMS
1c3139 Lucas Gonthier 2026-06-30 12:04:21
Initial commit: course content (Machine Learning, MLOps) in EN and FR Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
28
29
La descente de gradient sur $J$ donne la mise à jour des moindres carrés moyens (Widrow-Hoff), appliquée par exemple $(x^{(i)}, y^{(i)})$ :
30
31
$$\boxed{ \theta_j \leftarrow \theta_j + \alpha\left(y^{(i)} - h_\theta(x^{(i)})\right)x_j^{(i)} }$$
32
33
avec un taux d'apprentissage $\alpha > 0$.
34
35
| variante | règle de mise à jour | par étape | à utiliser quand |
36
| --- | --- | --- | --- |
37
| GD par lots | somme sur les $m$ exemples | $O(mn)$ | $m$ petit à modéré |
38
| GD stochastique (SGD) | un exemple à la fois | $O(n)$ | $m$ grand, flux de données |
39
36084c lugonthier 2026-07-02 14:39:19
Add new content and images for Linear Models, Regularization, SVMs, and Decision Trees - Added images for linear regression, logistic regression, and perceptron. - Introduced a new section on Regularization and High-Dimensional Inference with detailed explanations and images. - Added content on Support Vector Machines, including definitions, loss functions, and kernel methods. - Created a new section on Decision Trees and Ensemble Methods, covering CART, bagging, random forests, and boosting. - Included relevant images to illustrate concepts in Decision Trees and Ensemble Methods.
40
### 4.1.4 Équation normale
1c3139 Lucas Gonthier 2026-06-30 12:04:21
Initial commit: course content (Machine Learning, MLOps) in EN and FR Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
41
42
Annuler $\nabla_\theta J(\theta) = 0$ donne une solution en forme close à partir de la matrice de conception $X$ et du vecteur cible $y$ :
43
44
$$\boxed{ \theta = (X^T X)^{-1}X^T y }$$
45
46
*Remarque :* l'équation normale ne demande ni taux d'apprentissage ni itération, mais inverser $X^T X$ coûte $O(n^3)$, donc pour $n$ grand la mise à jour itérative LMS est préférée.
47
36084c lugonthier 2026-07-02 14:39:19
Add new content and images for Linear Models, Regularization, SVMs, and Decision Trees - Added images for linear regression, logistic regression, and perceptron. - Introduced a new section on Regularization and High-Dimensional Inference with detailed explanations and images. - Added content on Support Vector Machines, including definitions, loss functions, and kernel methods. - Created a new section on Decision Trees and Ensemble Methods, covering CART, bagging, random forests, and boosting. - Included relevant images to illustrate concepts in Decision Trees and Ensemble Methods.
48
### 4.1.5 Interprétation probabiliste
1c3139 Lucas Gonthier 2026-06-30 12:04:21
Initial commit: course content (Machine Learning, MLOps) in EN and FR Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
49
50
Supposons $y^{(i)} = \theta^T x^{(i)} + \varepsilon^{(i)}$ avec un bruit gaussien i.i.d. $\varepsilon^{(i)} \sim \mathcal{N}(0, \sigma^2)$. Maximiser la log-vraisemblance revient alors à minimiser le coût des moindres carrés :
51
52
$$\boxed{ \arg\max_\theta \ell(\theta) = \arg\min_\theta J(\theta) }$$
53
54
*Remarque :* c'est pourquoi les moindres carrés sont un objectif fondé et pas seulement commode.
55
36084c lugonthier 2026-07-02 14:39:19
Add new content and images for Linear Models, Regularization, SVMs, and Decision Trees - Added images for linear regression, logistic regression, and perceptron. - Introduced a new section on Regularization and High-Dimensional Inference with detailed explanations and images. - Added content on Support Vector Machines, including definitions, loss functions, and kernel methods. - Created a new section on Decision Trees and Ensemble Methods, covering CART, bagging, random forests, and boosting. - Included relevant images to illustrate concepts in Decision Trees and Ensemble Methods.
56
![Ajustement par régression linéaire](/fr/Machine%20Learning/04%20Linear%20models/a/linear-regression.png)
1c3139 Lucas Gonthier 2026-06-30 12:04:21
Initial commit: course content (Machine Learning, MLOps) in EN and FR Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
57
58
*Les moindres carrés ajustent la droite qui minimise les résidus au carré (segments gris).*
59
36084c lugonthier 2026-07-02 14:39:19
Add new content and images for Linear Models, Regularization, SVMs, and Decision Trees - Added images for linear regression, logistic regression, and perceptron. - Introduced a new section on Regularization and High-Dimensional Inference with detailed explanations and images. - Added content on Support Vector Machines, including definitions, loss functions, and kernel methods. - Created a new section on Decision Trees and Ensemble Methods, covering CART, bagging, random forests, and boosting. - Included relevant images to illustrate concepts in Decision Trees and Ensemble Methods.
60
## 4.2 Régression logistique
1c3139 Lucas Gonthier 2026-06-30 12:04:21
Initial commit: course content (Machine Learning, MLOps) in EN and FR Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
61
36084c lugonthier 2026-07-02 14:39:19
Add new content and images for Linear Models, Regularization, SVMs, and Decision Trees - Added images for linear regression, logistic regression, and perceptron. - Introduced a new section on Regularization and High-Dimensional Inference with detailed explanations and images. - Added content on Support Vector Machines, including definitions, loss functions, and kernel methods. - Created a new section on Decision Trees and Ensemble Methods, covering CART, bagging, random forests, and boosting. - Included relevant images to illustrate concepts in Decision Trees and Ensemble Methods.
62
### 4.2.1 Sigmoïde
1c3139 Lucas Gonthier 2026-06-30 12:04:21
Initial commit: course content (Machine Learning, MLOps) in EN and FR Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
63
64
La fonction sigmoïde (logistique) comprime un score brut $z \in \mathbb{R}$ en une probabilité :
65
66
$$\boxed{ g(z) = \frac{1}{1 + e^{-z}} \in (0, 1) }$$
67
68
Sa dérivée a la forme commode $g'(z) = g(z)\left(1 - g(z)\right)$.
69
36084c lugonthier 2026-07-02 14:39:19
Add new content and images for Linear Models, Regularization, SVMs, and Decision Trees - Added images for linear regression, logistic regression, and perceptron. - Introduced a new section on Regularization and High-Dimensional Inference with detailed explanations and images. - Added content on Support Vector Machines, including definitions, loss functions, and kernel methods. - Created a new section on Decision Trees and Ensemble Methods, covering CART, bagging, random forests, and boosting. - Included relevant images to illustrate concepts in Decision Trees and Ensemble Methods.
70
### 4.2.2 Modèle
1c3139 Lucas Gonthier 2026-06-30 12:04:21
Initial commit: course content (Machine Learning, MLOps) in EN and FR Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
71
72
L'hypothèse renvoie la probabilité de la classe positive, $\phi$ étant la probabilité prédite :
73
74
$$\boxed{ \phi = h_\theta(x) = g(\theta^T x) = p(y = 1 \mid x; \theta) }$$
75
76
Les étiquettes valent $y \in \{0, 1\}$, donc la loi conditionnelle est de Bernoulli :
77
78
$$\boxed{ p(y \mid x; \theta) = \phi^{y}(1 - \phi)^{1 - y} }$$
79
36084c lugonthier 2026-07-02 14:39:19
Add new content and images for Linear Models, Regularization, SVMs, and Decision Trees - Added images for linear regression, logistic regression, and perceptron. - Introduced a new section on Regularization and High-Dimensional Inference with detailed explanations and images. - Added content on Support Vector Machines, including definitions, loss functions, and kernel methods. - Created a new section on Decision Trees and Ensemble Methods, covering CART, bagging, random forests, and boosting. - Included relevant images to illustrate concepts in Decision Trees and Ensemble Methods.
80
### 4.2.3 Log-vraisemblance
1c3139 Lucas Gonthier 2026-06-30 12:04:21
Initial commit: course content (Machine Learning, MLOps) in EN and FR Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
81
82
Sur $m$ exemples i.i.d. la log-vraisemblance est l'opposé de l'entropie croisée sommée sur les données :
83
84
$$\boxed{ \ell(\theta) = \sum_{i=1}^{m}\left[ y^{(i)}\log \phi^{(i)} + (1 - y^{(i)})\log(1 - \phi^{(i)}) \right] }$$
85
86
avec $\phi^{(i)} = h_\theta(x^{(i)})$.
87
36084c lugonthier 2026-07-02 14:39:19
Add new content and images for Linear Models, Regularization, SVMs, and Decision Trees - Added images for linear regression, logistic regression, and perceptron. - Introduced a new section on Regularization and High-Dimensional Inference with detailed explanations and images. - Added content on Support Vector Machines, including definitions, loss functions, and kernel methods. - Created a new section on Decision Trees and Ensemble Methods, covering CART, bagging, random forests, and boosting. - Included relevant images to illustrate concepts in Decision Trees and Ensemble Methods.
88
### 4.2.4 Montée de gradient
1c3139 Lucas Gonthier 2026-06-30 12:04:21
Initial commit: course content (Machine Learning, MLOps) in EN and FR Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
89
90
Maximiser $\ell$ par montée de gradient donne la même forme que la mise à jour LMS :
91
92
$$\boxed{ \theta_j \leftarrow \theta_j + \alpha\left(y^{(i)} - h_\theta(x^{(i)})\right)x_j^{(i)} }$$
93
94
*Remarque :* la mise à jour a la même forme que la régression linéaire, bien que $h_\theta$ soit maintenant la sigmoïde. Ce n'est pas un hasard, les deux sont des modèles linéaires généralisés.
95
36084c lugonthier 2026-07-02 14:39:19
Add new content and images for Linear Models, Regularization, SVMs, and Decision Trees - Added images for linear regression, logistic regression, and perceptron. - Introduced a new section on Regularization and High-Dimensional Inference with detailed explanations and images. - Added content on Support Vector Machines, including definitions, loss functions, and kernel methods. - Created a new section on Decision Trees and Ensemble Methods, covering CART, bagging, random forests, and boosting. - Included relevant images to illustrate concepts in Decision Trees and Ensemble Methods.
96
### 4.2.5 Méthode de Newton
1c3139 Lucas Gonthier 2026-06-30 12:04:21
Initial commit: course content (Machine Learning, MLOps) in EN and FR Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
97
98
La méthode de Newton converge plus vite près de l'optimum. En une dimension :
99
100
$$\boxed{ \theta \leftarrow \theta - \frac{\ell'(\theta)}{\ell''(\theta)} }$$
101
102
Dans le cas vectoriel elle utilise la hessienne $H$ de $\ell$ :
103
104
$$\boxed{ \theta \leftarrow \theta - H^{-1}\nabla_\theta \ell(\theta) }$$
105
106
*Remarque :* la régression logistique n'a pas de solution en forme close pour $\theta$, elle est donc toujours ajustée itérativement (montée de gradient ou Newton).
107
36084c lugonthier 2026-07-02 14:39:19
Add new content and images for Linear Models, Regularization, SVMs, and Decision Trees - Added images for linear regression, logistic regression, and perceptron. - Introduced a new section on Regularization and High-Dimensional Inference with detailed explanations and images. - Added content on Support Vector Machines, including definitions, loss functions, and kernel methods. - Created a new section on Decision Trees and Ensemble Methods, covering CART, bagging, random forests, and boosting. - Included relevant images to illustrate concepts in Decision Trees and Ensemble Methods.
108
![Sigmoïde et frontière de décision logistique](/fr/Machine%20Learning/04%20Linear%20models/a/logistic-regression.png)
1c3139 Lucas Gonthier 2026-06-30 12:04:21
Initial commit: course content (Machine Learning, MLOps) in EN and FR Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
109
110
*À gauche : la sigmoïde envoie les scores dans l'intervalle (0,1). À droite : la frontière de décision et la probabilité prédite.*
111
36084c lugonthier 2026-07-02 14:39:19
Add new content and images for Linear Models, Regularization, SVMs, and Decision Trees - Added images for linear regression, logistic regression, and perceptron. - Introduced a new section on Regularization and High-Dimensional Inference with detailed explanations and images. - Added content on Support Vector Machines, including definitions, loss functions, and kernel methods. - Created a new section on Decision Trees and Ensemble Methods, covering CART, bagging, random forests, and boosting. - Included relevant images to illustrate concepts in Decision Trees and Ensemble Methods.
112
## 4.3 Perceptron
1c3139 Lucas Gonthier 2026-06-30 12:04:21
Initial commit: course content (Machine Learning, MLOps) in EN and FR Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
113
114
Le perceptron est le premier classifieur linéaire. Il conserve le score linéaire $\theta^T x$ de la régression logistique mais remplace la sigmoïde par un seuil dur, donc la sortie est une étiquette de classe et non une probabilité. Les étiquettes valent $y \in \{0, 1\}$.
115
36084c lugonthier 2026-07-02 14:39:19
Add new content and images for Linear Models, Regularization, SVMs, and Decision Trees - Added images for linear regression, logistic regression, and perceptron. - Introduced a new section on Regularization and High-Dimensional Inference with detailed explanations and images. - Added content on Support Vector Machines, including definitions, loss functions, and kernel methods. - Created a new section on Decision Trees and Ensemble Methods, covering CART, bagging, random forests, and boosting. - Included relevant images to illustrate concepts in Decision Trees and Ensemble Methods.
116
### 4.3.1 Activation et hypothèse
1c3139 Lucas Gonthier 2026-06-30 12:04:21
Initial commit: course content (Machine Learning, MLOps) in EN and FR Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
117
118
L'activation est la fonction échelon :
119
120
$$\boxed{ g(z) = \begin{cases} 1 & \text{si } z \ge 0 \\ 0 & \text{sinon} \end{cases} }$$
121
122
et l'hypothèse l'applique au score linéaire :
123
124
$$\boxed{ h_\theta(x) = g(\theta^T x) }$$
125
36084c lugonthier 2026-07-02 14:39:19
Add new content and images for Linear Models, Regularization, SVMs, and Decision Trees - Added images for linear regression, logistic regression, and perceptron. - Introduced a new section on Regularization and High-Dimensional Inference with detailed explanations and images. - Added content on Support Vector Machines, including definitions, loss functions, and kernel methods. - Created a new section on Decision Trees and Ensemble Methods, covering CART, bagging, random forests, and boosting. - Included relevant images to illustrate concepts in Decision Trees and Ensemble Methods.
126
### 4.3.2 Règle d'apprentissage
1c3139 Lucas Gonthier 2026-06-30 12:04:21
Initial commit: course content (Machine Learning, MLOps) in EN and FR Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
127
128
Le perceptron est entraîné en ligne, un exemple à la fois, et ne corrige $\theta$ que sur un point mal classé :
129
130
$$\boxed{ \theta_j \leftarrow \theta_j + \alpha\left(y^{(i)} - h_\theta(x^{(i)})\right)x_j^{(i)} }$$
131
132
*Remarque :* c'est la même forme que la mise à jour LMS et que la montée de gradient logistique. Seule l'activation $g$ change (identité, sigmoïde, échelon). Quand la prédiction est correcte, le facteur $y^{(i)} - h_\theta(x^{(i)})$ est nul, donc les points bien classés laissent $\theta$ inchangé.
133
36084c lugonthier 2026-07-02 14:39:19
Add new content and images for Linear Models, Regularization, SVMs, and Decision Trees - Added images for linear regression, logistic regression, and perceptron. - Introduced a new section on Regularization and High-Dimensional Inference with detailed explanations and images. - Added content on Support Vector Machines, including definitions, loss functions, and kernel methods. - Created a new section on Decision Trees and Ensemble Methods, covering CART, bagging, random forests, and boosting. - Included relevant images to illustrate concepts in Decision Trees and Ensemble Methods.
134
![Frontière de décision du perceptron](/fr/Machine%20Learning/04%20Linear%20models/a/perceptron.png)
1c3139 Lucas Gonthier 2026-06-30 12:04:21
Initial commit: course content (Machine Learning, MLOps) in EN and FR Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
135
136
*Le perceptron trouve un hyperplan séparateur. Ce n'est pas nécessairement celui à marge maximale que choisira le SVM.*
137
36084c lugonthier 2026-07-02 14:39:19
Add new content and images for Linear Models, Regularization, SVMs, and Decision Trees - Added images for linear regression, logistic regression, and perceptron. - Introduced a new section on Regularization and High-Dimensional Inference with detailed explanations and images. - Added content on Support Vector Machines, including definitions, loss functions, and kernel methods. - Created a new section on Decision Trees and Ensemble Methods, covering CART, bagging, random forests, and boosting. - Included relevant images to illustrate concepts in Decision Trees and Ensemble Methods.
138
### 4.3.3 Convergence
1c3139 Lucas Gonthier 2026-06-30 12:04:21
Initial commit: course content (Machine Learning, MLOps) in EN and FR Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
139
140
| données | comportement |
141
| --- | --- |
142
| linéairement séparables | converge en un nombre fini de mises à jour |
143
| non séparables | ne converge jamais, les poids oscillent |
144
145
*Remarque :* le perceptron s'arrête au premier hyperplan qui sépare les données, généralement pas celui à la marge la plus large. Cet écart motive la machine à vecteurs de support (qui maximise la marge) et, empilé en couches, le réseau de neurones (un perceptron est une unité).
146
36084c lugonthier 2026-07-02 14:39:19
Add new content and images for Linear Models, Regularization, SVMs, and Decision Trees - Added images for linear regression, logistic regression, and perceptron. - Introduced a new section on Regularization and High-Dimensional Inference with detailed explanations and images. - Added content on Support Vector Machines, including definitions, loss functions, and kernel methods. - Created a new section on Decision Trees and Ensemble Methods, covering CART, bagging, random forests, and boosting. - Included relevant images to illustrate concepts in Decision Trees and Ensemble Methods.
147
## 4.4 Modèles linéaires généralisés
1c3139 Lucas Gonthier 2026-06-30 12:04:21
Initial commit: course content (Machine Learning, MLOps) in EN and FR Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
148
36084c lugonthier 2026-07-02 14:39:19
Add new content and images for Linear Models, Regularization, SVMs, and Decision Trees - Added images for linear regression, logistic regression, and perceptron. - Introduced a new section on Regularization and High-Dimensional Inference with detailed explanations and images. - Added content on Support Vector Machines, including definitions, loss functions, and kernel methods. - Created a new section on Decision Trees and Ensemble Methods, covering CART, bagging, random forests, and boosting. - Included relevant images to illustrate concepts in Decision Trees and Ensemble Methods.
149
### 4.4.1 Famille exponentielle
1c3139 Lucas Gonthier 2026-06-30 12:04:21
Initial commit: course content (Machine Learning, MLOps) in EN and FR Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
150
151
Une distribution appartient à la famille exponentielle si sa densité s'écrit avec le paramètre naturel $\eta$, la statistique suffisante $T(y)$, la log-partition $a(\eta)$ et la mesure de base $b(y)$ :
152
153
$$\boxed{ p(y; \eta) = b(y)\exp\left(\eta\, T(y) - a(\eta)\right) }$$
154
36084c lugonthier 2026-07-02 14:39:19
Add new content and images for Linear Models, Regularization, SVMs, and Decision Trees - Added images for linear regression, logistic regression, and perceptron. - Introduced a new section on Regularization and High-Dimensional Inference with detailed explanations and images. - Added content on Support Vector Machines, including definitions, loss functions, and kernel methods. - Created a new section on Decision Trees and Ensemble Methods, covering CART, bagging, random forests, and boosting. - Included relevant images to illustrate concepts in Decision Trees and Ensemble Methods.
155
### 4.4.2 Hypothèses du MLG
1c3139 Lucas Gonthier 2026-06-30 12:04:21
Initial commit: course content (Machine Learning, MLOps) in EN and FR Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
156
157
Un MLG repose sur trois choix. La réponse appartient à la famille exponentielle, le paramètre naturel est linéaire en l'entrée, et la prédiction est la statistique suffisante espérée :
158
159
$$\boxed{ \eta = \theta^T x }$$
160
161
$$\boxed{ h_\theta(x) = \mathbb{E}\left[T(y) \mid x; \theta\right] }$$
162
36084c lugonthier 2026-07-02 14:39:19
Add new content and images for Linear Models, Regularization, SVMs, and Decision Trees - Added images for linear regression, logistic regression, and perceptron. - Introduced a new section on Regularization and High-Dimensional Inference with detailed explanations and images. - Added content on Support Vector Machines, including definitions, loss functions, and kernel methods. - Created a new section on Decision Trees and Ensemble Methods, covering CART, bagging, random forests, and boosting. - Included relevant images to illustrate concepts in Decision Trees and Ensemble Methods.
163
### 4.4.3 Tableau des familles
1c3139 Lucas Gonthier 2026-06-30 12:04:21
Initial commit: course content (Machine Learning, MLOps) in EN and FR Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
164
165
| Distribution | $\eta$ | $T(y)$ | $a(\eta)$ | $b(y)$ |
166
| --- | --- | --- | --- | --- |
167
| Bernoulli | $\log\dfrac{\phi}{1-\phi}$ | $y$ | $\log(1 + e^{\eta})$ | $1$ |
168
| Gaussienne ($\sigma^2 = 1$) | $\mu$ | $y$ | $\tfrac{1}{2}\eta^2$ | $\dfrac{1}{\sqrt{2\pi}}e^{-y^2/2}$ |
169
| Poisson | $\log\lambda$ | $y$ | $e^{\eta}$ | $\dfrac{1}{y!}$ |
170
| Géométrique | $\log(1-\phi)$ | $y$ | $\log\dfrac{e^{\eta}}{1 - e^{\eta}}$ | $1$ |
171
172
*Remarque :* pour la Bernoulli, $\eta$ est le log-rapport de cotes et son inverse est la sigmoïde, $\phi = g(\eta)$. C'est pourquoi la régression logistique a cette forme.
173
36084c lugonthier 2026-07-02 14:39:19
Add new content and images for Linear Models, Regularization, SVMs, and Decision Trees - Added images for linear regression, logistic regression, and perceptron. - Introduced a new section on Regularization and High-Dimensional Inference with detailed explanations and images. - Added content on Support Vector Machines, including definitions, loss functions, and kernel methods. - Created a new section on Decision Trees and Ensemble Methods, covering CART, bagging, random forests, and boosting. - Included relevant images to illustrate concepts in Decision Trees and Ensemble Methods.
174
### 4.4.4 Régression softmax
1c3139 Lucas Gonthier 2026-06-30 12:04:21
Initial commit: course content (Machine Learning, MLOps) in EN and FR Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
175
176
Pour des étiquettes multiclasses $y \in \{1, \dots, k\}$ le MLG donne la régression softmax, avec un vecteur de paramètres $\theta_k$ par classe :
177
178
$$\boxed{ p(y = k \mid x; \theta) = \frac{\exp(\theta_k^T x)}{\sum_{j}\exp(\theta_j^T x)} }$$
179
36084c lugonthier 2026-07-02 14:39:19
Add new content and images for Linear Models, Regularization, SVMs, and Decision Trees - Added images for linear regression, logistic regression, and perceptron. - Introduced a new section on Regularization and High-Dimensional Inference with detailed explanations and images. - Added content on Support Vector Machines, including definitions, loss functions, and kernel methods. - Created a new section on Decision Trees and Ensemble Methods, covering CART, bagging, random forests, and boosting. - Included relevant images to illustrate concepts in Decision Trees and Ensemble Methods.
180
### 4.4.5 Recette du MLG
1c3139 Lucas Gonthier 2026-06-30 12:04:21
Initial commit: course content (Machine Learning, MLOps) in EN and FR Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
181
182
```mermaid
183
graph TD
184
A["choisir une distribution de reponse"] --> B["l ecrire en forme de famille exponentielle"]
185
B --> C["poser le parametre naturel eta lineaire en x"]
186
C --> D["la prediction est la statistique suffisante esperee"]
187
D --> E["ajuster theta par maximum de vraisemblance"]
188
```
189
190
*Les modèles linéaires, y compris le perceptron, se contentent d'une frontière qui sépare les classes. La partie suivante cherche la meilleure : la machine à vecteurs de support maximise la marge.*
191
192
---
36084c lugonthier 2026-07-02 14:39:19
Add new content and images for Linear Models, Regularization, SVMs, and Decision Trees - Added images for linear regression, logistic regression, and perceptron. - Introduced a new section on Regularization and High-Dimensional Inference with detailed explanations and images. - Added content on Support Vector Machines, including definitions, loss functions, and kernel methods. - Created a new section on Decision Trees and Ensemble Methods, covering CART, bagging, random forests, and boosting. - Included relevant images to illustrate concepts in Decision Trees and Ensemble Methods.
193
Suivant : [Régularisation et inférence en grande dimension](/fr/Machine%20Learning/05%20Regularization%20and%20high-dimensional%20inference) · [Vue d'ensemble du cours](/fr/Machine%20Learning)