SOLUTION DETAILLEE
Prenez le temps de comparer avec vos reponses. Verifiez chaque etape !
RAPPEL DU MODELE
$$\hat{y} = \textcolor{#e67e22}{a_1} \cdot x_1 + \textcolor{#e67e22}{a_2} \cdot x_2 + \textcolor{#9B7AC4}{b}$$
Avec : $\textcolor{#e67e22}{a_1 = 2\,450}$, $\textcolor{#e67e22}{a_2 = 8\,500}$, $\textcolor{#9B7AC4}{b = 32\,000}$
PARTIE 1 : Predictions multi-variables
Bien A ($x_1 = \textcolor{#3498db}{55}$ m², $x_2 = \textcolor{#3498db}{2}$ pieces) :
$$\hat{y}_A = \textcolor{#e67e22}{2\,450} \times \textcolor{#3498db}{55} + \textcolor{#e67e22}{8\,500} \times \textcolor{#3498db}{2} + \textcolor{#9B7AC4}{32\,000}$$
- Contribution surface : $2\,450 \times 55 = \textcolor{#e67e22}{134\,750}$ EUR
- Contribution pieces : $8\,500 \times 2 = \textcolor{#e67e22}{17\,000}$ EUR
- Intercept : $\textcolor{#9B7AC4}{32\,000}$ EUR
$$\hat{y}_A = 134\,750 + 17\,000 + 32\,000 = \textcolor{#F7E64D}{\mathbf{183\,750}} \text{ EUR}$$
$\boxed{\hat{y}_A = \textcolor{#F7E64D}{183\,750} \text{ EUR}}$
Bien B ($x_1 = \textcolor{#3498db}{78}$ m², $x_2 = \textcolor{#3498db}{3}$ pieces) :
$$\hat{y}_B = \textcolor{#e67e22}{2\,450} \times \textcolor{#3498db}{78} + \textcolor{#e67e22}{8\,500} \times \textcolor{#3498db}{3} + \textcolor{#9B7AC4}{32\,000}$$
- Contribution surface : $2\,450 \times 78 = \textcolor{#e67e22}{191\,100}$ EUR
- Contribution pieces : $8\,500 \times 3 = \textcolor{#e67e22}{25\,500}$ EUR
- Intercept : $\textcolor{#9B7AC4}{32\,000}$ EUR
$$\hat{y}_B = 191\,100 + 25\,500 + 32\,000 = \textcolor{#F7E64D}{\mathbf{248\,600}} \text{ EUR}$$
$\boxed{\hat{y}_B = \textcolor{#F7E64D}{248\,600} \text{ EUR}}$
Bien C ($x_1 = \textcolor{#3498db}{120}$ m², $x_2 = \textcolor{#3498db}{5}$ pieces) :
$$\hat{y}_C = \textcolor{#e67e22}{2\,450} \times \textcolor{#3498db}{120} + \textcolor{#e67e22}{8\,500} \times \textcolor{#3498db}{5} + \textcolor{#9B7AC4}{32\,000}$$
- Contribution surface : $2\,450 \times 120 = \textcolor{#e67e22}{294\,000}$ EUR
- Contribution pieces : $8\,500 \times 5 = \textcolor{#e67e22}{42\,500}$ EUR
- Intercept : $\textcolor{#9B7AC4}{32\,000}$ EUR
$$\hat{y}_C = 294\,000 + 42\,500 + 32\,000 = \textcolor{#F7E64D}{\mathbf{368\,500}} \text{ EUR}$$
$\boxed{\hat{y}_C = \textcolor{#F7E64D}{368\,500} \text{ EUR}}$
PARTIE 2 : Calcul des erreurs
| Bien | Prix reel | Prix predit | Erreur | Interpretation |
|---|
| A | 190 000 € | 183 750 € | +6 250 € | Sous-estime |
| B | 248 000 € | 248 600 € | -600 € | Sur-estime |
| C | 378 000 € | 368 500 € | +9 500 € | Sous-estime |
- $e_A = 190\,000 - 183\,750 = \textcolor{#3498db}{+6\,250}$ EUR
- $e_B = 248\,000 - 248\,600 = \textcolor{#e74c3c}{-600}$ EUR
- $e_C = 378\,000 - 368\,500 = \textcolor{#3498db}{+9\,500}$ EUR
| Bien | Erreur | Erreur² |
|---|
| A | +6 250 | 39 062 500 |
| B | -600 | 360 000 |
| C | +9 500 | 90 250 000 |
PARTIE 3 : Metriques de performance
$$MSE = \frac{1}{n} \sum_{i=1}^{n} e_i^2 = \frac{1}{3} \times (e_A^2 + e_B^2 + e_C^2)$$
$$MSE = \frac{1}{3} \times (\textcolor{#e67e22}{39\,062\,500} + \textcolor{#e67e22}{360\,000} + \textcolor{#e67e22}{90\,250\,000})$$
$$MSE = \frac{\textcolor{#9B7AC4}{129\,672\,500}}{3} = \textcolor{#27ae60}{\mathbf{43\,224\,167}} \text{ EUR}^2$$
$\boxed{MSE = \textcolor{#27ae60}{43\,224\,167} \text{ EUR}^2}$
$$RMSE = \sqrt{MSE} = \sqrt{43\,224\,167} \approx \textcolor{#27ae60}{\mathbf{6\,575}} \text{ EUR}$$
Interpretation : En moyenne, le modele se trompe d'environ 6 575 EUR sur le prix.
$\boxed{RMSE \approx \textcolor{#27ae60}{6\,575} \text{ EUR}}$
$$MAE = \frac{1}{n} \sum_{i=1}^{n} |e_i| = \frac{1}{3} \times (|e_A| + |e_B| + |e_C|)$$
$$MAE = \frac{1}{3} \times (|\textcolor{#3498db}{6\,250}| + |\textcolor{#e74c3c}{-600}| + |\textcolor{#3498db}{9\,500}|)$$
$$MAE = \frac{1}{3} \times (6\,250 + 600 + 9\,500) = \frac{16\,350}{3} = \textcolor{#27ae60}{\mathbf{5\,450}} \text{ EUR}$$
$\boxed{MAE = \textcolor{#27ae60}{5\,450} \text{ EUR}}$
Note : MAE < RMSE car le RMSE penalise davantage les grandes erreurs (bien C).
PARTIE 4 : Interpretation des coefficients
- $+1$ m² $\rightarrow$ $+\textcolor{#e67e22}{2\,450}$ EUR
- $+1$ piece $\rightarrow$ $+\textcolor{#e67e22}{8\,500}$ EUR
$\boxed{\text{Le nombre de pieces a plus d'impact par unite } (8\,500 > 2\,450)}$
Cependant, en pratique, il est plus facile d'ajouter des m² que des pieces !
Option A - Agrandir de 10 m² :
$$\Delta y_A = \textcolor{#e67e22}{a_1} \times 10 = 2\,450 \times 10 = \textcolor{#27ae60}{\mathbf{+24\,500}} \text{ EUR}$$
Option B - Ajouter 1 piece :
$$\Delta y_B = \textcolor{#e67e22}{a_2} \times 1 = 8\,500 \times 1 = \textcolor{#27ae60}{\mathbf{+8\,500}} \text{ EUR}$$
$\boxed{\text{Option A est meilleure : } +24\,500 \text{ EUR vs } +8\,500 \text{ EUR}}$
Conclusion : Meme si une piece individuelle vaut plus qu'un m², agrandir de 10 m² rapporte presque 3 fois plus !
$$\bar{y} = \frac{190\,000 + 248\,000 + 378\,000}{3} = \frac{816\,000}{3} = \textcolor{#9B7AC4}{272\,000} \text{ EUR}$$
$$\text{Erreur \%} = \frac{RMSE}{\bar{y}} \times 100 = \frac{6\,575}{272\,000} \times 100 \approx \textcolor{#27ae60}{\mathbf{2.4\%}}$$
$\boxed{\text{Erreur relative} \approx \textcolor{#27ae60}{2.4\%}}$
Conclusion : Une erreur de ~2.4% est tres bonne pour un modele a 2 variables !
RESUME DES RESULTATS
| Metrique | Valeur | Interpretation |
|---|
| MSE | 43 224 167 EUR² | Difficile a interpreter (unite carree) |
| RMSE | 6 575 EUR | Erreur typique de prediction |
| MAE | 5 450 EUR | Erreur moyenne absolue |
| Erreur % | 2.4% | Tres bon pour l'immobilier |
- $\textcolor{#3498db}{Bleu}$ : valeurs d'entree, erreurs positives (sous-estimation)
- $\textcolor{#e67e22}{Orange}$ : coefficients, calculs intermediaires
- $\textcolor{#9B7AC4}{Violet}$ : intercept, sommes, moyennes
- $\textcolor{#F7E64D}{Jaune}$ : valeurs predites
- $\textcolor{#27ae60}{Vert}$ : resultats finaux, prix reels
- $\textcolor{#e74c3c}{Rouge}$ : erreurs negatives (sur-estimation)