Documente Academic
Documente Profesional
Documente Cultură
Ricco RAKOTOMALALA
Universit Lumire Lyon 2
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
PLAN
1.
Position du problme
2.
3.
4.
Pratique de lACP
5.
6.
7.
8.
9.
Plus loin (3) : ACP sur les corrlations partielles, gestion de leffet taille
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
j : 1,, p
i : 1,, n
Individus actifs
Modele
CYL
Alfasud TI
Audi 100
Simca 1300
Citroen GS Club
Fiat 132
Lancia Beta
Peugeot 504
Renault 16 TL
Renault 30
Toyota Corolla
Alfetta 1.66
Princess 1800
Datsun 200L
Taunus 2000
Rancho
Mazda 9295
Opel Rekord
Lada 1300
PUISS
1350
1588
1294
1222
1585
1297
1796
1565
2664
1166
1570
1798
1998
1993
1442
1769
1979
1294
79
85
68
59
98
82
79
55
128
55
109
82
115
98
80
83
100
68
xij
LARG
393
468
424
412
439
429
449
424
452
399
428
445
469
438
431
440
459
404
POIDS
161
177
168
161
164
169
169
163
173
157
162
172
169
170
166
165
173
161
V.MAX
870
1110
1050
930
1105
1080
1160
1010
1320
815
1060
1160
1370
1080
1129
1095
1120
955
165
160
152
151
165
160
154
140
180
140
175
158
160
167
144
165
173
140
Questions :
(1) Quelles sont les vhicules qui se ressemblent ? (proximit entre les individus)
(2) Sur quelles variables sont fondes les ressemblances / dissemblances
(3) Quelles sont les relations entre les variables
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
2.
CYL x PUIS
3.
Renault 30
Datsun 200L
profils opposs
PUISS
1166
1222
1294
1294
1297
1350
1442
1565
1570
1585
1588
1769
1796
1798
1979
1993
1998
2664
55
59
68
68
82
79
80
55
109
98
85
83
79
82
100
98
115
128
100
Modele
CYL
Toyota Corolla
Citroen GS Club
Simca 1300
Lada 1300
Lancia Beta
Alfasud TI
Rancho
Renault 16 TL
Alfetta 1.66
Fiat 132
Audi 100
Mazda 9295
Peugeot 504
Princess 1800
Opel Rekord
Taunus 2000
Datsun 200L
Renault 30
Fiat 132
Audi 100
Mazda 9295
Lancia Beta
Princess
1800
Rancho
Peugeot 504
Alfasud TI
Opel Rekord
Taunus 2000
Simca
Lada 1300
1300
60
PUISS
80
Alfetta 1.66
Citroen GS Club
Toyota Corolla Renault 16 TL
1000
1500
2000
2500
3000
CYL
100
160
175
140
CYL
100
170
1500 2500
60
PUISS
460
60
2.
175
400
LONG
160
LARG
points atypiques.
170
800
POIDS
140
V.MAX
1500 2500
400 440
800
1200
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
Distance euclidienne
j 1
1
Ip 2
2n
(i, i' )
i 1 i '1
1 n 2
I p d (i, G )
n i 1
60
80
PUISS
100
120
CYL x PUIS
1000
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
1500
2000
CYL
2500
3000
zij
xij x j
xj
1 n
xij
n i 1
sj
s 2j
1 n
2
xij x j
n i 1
F2
1 n 2
1 Fi1 1.796628
n i 1
F1
89.83%
10.17%
Minimisation
(2) Trouver la 2nde composante F2 qui traite linertie nonexplique (rsiduelle) par F1 (par consquent, F2 est non
-1
PUISS.CR
Ip
89.83%
-3
-2
1 n 2
2 Fi 2 0.203372
n i 1
-3
-2
-1
CYL.CR
k 1
Maximisation
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
10.17%
I
1.797 0.203 2 I p
Prservation des
d 2 (2,6) 1.14415
d 2 (1,6) 1.72529
Modele
PUISS
Modele
F1 (89.83%) F2 (10.17%)
1
2
3
Toyota Corolla
Citroen GS Club
Simca 1300
-1.2814
-1.1273
-0.9292
-1.4953
-1.2933
-0.8389
1
2
3
Toyota Corolla
Citroen GS Club
Simca 1300
1.9635
1.7117
1.2502
0.1513
0.1174
-0.0639
4
5
6
7
8
Lada 1300
Lancia Beta
Alfasud TI
Rancho
Renault 16 TL
-0.9292
-0.9209
-0.7751
-0.5219
-0.1835
-0.8389
-0.1319
-0.2834
-0.2329
-1.4953
4
5
6
7
8
Lada 1300
Lancia Beta
Alfasud TI
Rancho
Renault 16 TL
1.2502
0.7444
0.7484
0.5337
1.1871
-0.0639
-0.5580
-0.3477
-0.2044
0.9276
9
10
Alfetta 1.66
Fiat 132
-0.1697
-0.1284
1.2316
0.6761
9
10
Alfetta 1.66
Fiat 132
-0.7509
-0.3873
-0.9909
-0.5689
11
12
13
14
15
16
Audi 100
Mazda 9295
Peugeot 504
Princess 1800
Opel Rekord
Taunus 2000
-0.1202
0.3779
0.4522
0.4577
0.9558
0.9943
0.0196
-0.0814
-0.2834
-0.1319
0.7771
0.6761
11
12
13
14
15
16
Audi 100
Mazda 9295
Peugeot 504
Princess 1800
Opel Rekord
Taunus 2000
0.0711
-0.2097
-0.1194
-0.2304
-1.2254
-1.1812
-0.0989
0.3248
0.5201
0.4169
0.1263
0.2250
17
18
Datsun 200L
Renault 30
1.0081
2.8408
1.5346
2.1911
17
18
Datsun 200L
Renault 30
-1.7980
-3.5581
-0.3723
0.4594
Coordonnes dans
le repre factoriel
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
approximation suffisamment
satisfaisante !!!
10
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
11
100
CYL
460
60
PUISS
LONG
LARG
POIDS
V.MAX
140
140
800
175
175
1
0.797
0.701
0.630
0.789
0.665
160
CYL
160
170
CORR
CYL
PUISS
LONG
LARG
POIDS
V.MAX
100
1500 2500
60
400
1200
1500 2500
400 440
800
1200
POIDS
CYL
PUISS
LONG
LARG
V.MAX
POIDS
1.000
0.789
0.765
0.868
0.717
0.478
CYL
0.789
1.000
0.797
0.701
0.630
0.665
PUISS
0.765
0.797
1.000
0.641
0.521
0.844
LONG
0.868
0.701
0.641
1.000
0.849
0.476
LARG
0.717
0.630
0.521
0.849
1.000
0.473
V.MAX
0.478
0.665
0.844
0.476
0.473
1.000
12
1 rj2 ( F1 )
j 1
Ip p
Lorsque les donnes sont rduites (ACP norme), Inertie totale = Trace(R) = p
1
p
p
k 1
Axis
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
4.421
73.68%
73.68%
0.856
14.27%
87.95%
0.373
6.22%
94.17%
0.214
3.57%
97.73%
0.093
1.55%
99.28%
0.043
0.72%
100.00%
Tot.
13
PCA_1_Axis_2
cercle des0.9corrlations.
rpoids( F1 ) 0.905
0.8
0.7
2
rpoids
( F1 ) 0.819
et
0.6
0.5
LARG
LONG
0.4
14%
0.3
POIDS
0.2
0.1
0
rpoids( F2 ) 0.225
CYL
-0.1
-0.2
-0.3
et
2
rpoids
( F2 ) 0.050
PUISS
-0.4
-0.5
V.M AX
-0.6
-0.7
-0.8
-0.9
-1
k 1
-1 -0.9-0.8-0.7-0.6-0.5-0.4-0.3-0.2-0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
PCA_1_Axis_1
74%
2
poids
( Fk ) 0.819 0.050 1
rpoids,cyl 0.789
q 1
rpoids,v.max 0.478
que q = 1 facteur]
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
14
Les mains dans le cambouis : comment sont obtenus les rsultats de lACP ?
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
15
F1 a11z1 a21z 2 a p1 z p (1 )
Fk a1k z1 a2 k z2 a pk z p (k )
Fp a1 p z1 a2 p z2 a pp z p ( p )
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
rx j ( Fk )
Plus la corrlation est leve en valeur absolue, plus forte
est linfluence de la variable sur le facteur
16
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
17
Valeurs propres = k
Corrlations
#affichage des 2 premires composantes seulement
variables x facteurs
print(cor.factors[,1:2])
rx j ( Fk ) k a jk
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
18
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
19
zij
Fik k uik
Principe de la SVD
Z UV T
avec
Z vk k u k
Z T u k k vk
k2
n
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
20
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
21
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
22
Eigen value
Difference
4.420858
3.564796
73.68%
73.68%
0.856062
0.482996
14.27%
87.95%
0.373066
0.159144
6.22%
94.17%
0.213922
0.121121
3.57%
97.73%
0.092801
0.049511
1.55%
99.28%
0.04329
0.72%
100.00%
Tot.
Scree plot
Component
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
Valeurs propres et dtection numrique du nombre q de facteurs retenir (ACP norme) [1]
Axis
Eigen value
Difference
4.420858
3.564796
73.68%
73.68%
0.856062
0.482996
14.27%
87.95%
0.373066
0.159144
6.22%
94.17%
0.213922
0.121121
3.57%
97.73%
0.092801
0.049511
1.55%
99.28%
0.04329
0.72%
100.00%
Tot.
seuil 1 2
p 1
6 1
1 2
2.08465
n 1
18 1
(n et p) des donnes.
Axis
p 1
1 2
n 1
A droite, nous avons 2 x cart-type des
v.p. sous H0 un test unilatral 5%
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
Eigen value
Difference
4.420858
3.564796
73.68%
73.68%
0.856062
0.482996
14.27%
87.95%
0.373066
0.159144
6.22%
94.17%
0.213922
0.121121
3.57%
97.73%
0.092801
0.049511
1.55%
99.28%
0.04329
0.72%
100.00%
Tot.
24
Valeurs propres et dtection numrique du nombre q de facteurs retenir (ACP norme) [2]
1 1 1 1 1 1
b1 2.45
1 2 3 4 5 6
Eigenvalues - Significance
1
bk
mk m
La composante est valide si :
k bk
Broken-stick
Axis
Eigenvalue
4.420858
2.45
0.856062
1.45
0.373066
0.95
0.213922
0.616667
0.092801
0.366667
0.04329
0.166667
critical values
1 1 1 1
b3 0.95
3 4 5 6
Toutes les approches sont cohrentes : q = 1 seul facteur semble suffire dans cette tude. Par
commodit (hum, pas si sr, cf. interprtation et rotation des axes), on en choisira q = 2.
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
25
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
26
rx2j ( Fk ) k
j 1
Corr.
j 1
Axis_1
reprsentation de la
q premires composantes.
Axis_2
CTR (%)
COS (%)
Corr.
CTR (%)
COS (%)
POIDS
0.905
19%
82 % (82 %)
0.225
6%
5 % (87 %)
CYL
0.893
18%
80 % (80 %)
-0.115
2%
1 % (81 %)
PUISS
0.887
18%
79 % (79 %)
-0.385
17%
15 % (93 %)
LONG
0.886
18%
79 % (79 %)
0.381
17%
15 % (93 %)
LARG
0.814
15%
66 % (66 %)
0.413
20%
17 % (83 %)
V.MAX
0.755
13%
57 % (57 %)
-0.574
38%
33 % (90 %)
74 % (74 %)
0.85606
Var. Expl.
4.42086
COS
k 1
2
jk
14 % (88 %)
PCA_1_Axis_2
On utilise souvent le
0.4
LARG
LONG
0.3
POIDS
0.2
0
-0.1
0.1
CYL
-0.2
-0.3
synthtique immdiate.
PUISS
-0.4
-0.5
V.M AX
-0.6
performances (sportivit).
-0.7
-0.8
-0.9
-1
-1 -0.9-0.8-0.7-0.6-0.5-0.4-0.3-0.2-0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
Ricco Rakotomalala
PCA_1_Axis_1
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
27
donnes AUTOS .
Entre parenthses la diffrence entre les
corrlations.
28
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
29
N.B.
1 n 2
1 n p 2 1 n 2
I p d (i, G ) zij d i
n i 1
n i 1 j 1
n i 1
Axe 1
N Modele
1 Alfasud TI
Axe 2
Coord.
CTR
Cos
Coord.
CTR
Cos
SUM(COS)
-2.139
6%
56%
-1.786
21%
39%
94%
Audi 100
1.561
3%
37%
1.527
15%
35%
71%
Simca 1300
-1.119
2%
58%
0.675
3%
21%
79%
Citroen GS Club
-2.574
8%
98%
-0.113
0%
0%
98%
5
6
Fiat 132
0.428
-0.304
0%
0%
16%
8%
-0.696
0.196
3%
0%
41%
3%
57%
12%
7
8
Peugeot 504
Renault 16 TL
0.684
-1.948
1%
5%
31%
67%
0.933
0.980
6%
6%
58%
17%
88%
84%
Renault 30
4.410
24%
89%
-1.064
7%
5%
94%
10 Toyota Corolla
11 Alfetta 1.66
-3.986
20%
98%
-0.236
0%
0%
98%
0.438
0%
4%
-1.912
24%
82%
86%
12 Princess 1800
13 Datsun 200L
14 Taunus 2000
1.018
2.941
1%
11%
53%
78%
0.842
0.559
5%
2%
36%
3%
89%
81%
1.315
2%
70%
-0.487
2%
10%
80%
15 Rancho
16 Mazda 9295
-0.691
1%
24%
0.898
5%
41%
65%
0.386
0%
22%
-0.356
1%
19%
40%
17 Opel Rekord
18 Lada 1300
2.290
-2.709
7%
9%
86%
93%
-0.104
0.144
0%
0%
0%
0%
86%
93%
Lancia Beta
CTRik
2
ik
F
; CTRik 1
n k i 1
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
COSik2
Fik2 p
; COSik2 1
2
d i j 1
30
Datsun 200L
Lancia Beta
Opel Rekord
Mazda 9295
Taunus 2000
Fiat 132
Renault 30
Alfasud TI
-2
Audi 100
Comp.2 (14%)
Alfetta 1.66
0.9
0.8
0.6
PCA_1_Axis_2
0.5
0.4
LARG
LONG
0.3
POIDS
-4
0.7
0.2
0.1
0
-0.1
CYL
-4
-2
-0.2
-0.3
Comp.1 (74%)
PUISS
-0.4
-0.5
V.M AX
-0.6
-0.7
-0.8
-0.9
-1
-1 -0.9-0.8-0.7-0.6-0.5-0.4-0.3-0.2-0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
PCA_1_Axis_1
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
31
Variables illustratives
Renforcer linterprtation des composantes
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
32
Variables illustratives
Var. illustrative qualitative
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
Modele
Alfasud TI
Audi 100
Simca 1300
Citroen GS Club
Fiat 132
Lancia Beta
Peugeot 504
Renault 16 TL
Renault 30
Toyota Corolla
Alfetta-1.66
Princess-1800
Datsun-200L
Taunus-2000
Rancho
Mazda-9295
Opel-Rekord
Lada-1300
FINITION
2_B
3_TB
1_M
1_M
2_B
3_TB
2_B
2_B
3_TB
1_M
3_TB
2_B
3_TB
2_B
3_TB
1_M
2_B
1_M
PRIX
R.POID.PUIS
30570
11.01
39990
13.06
29600
15.44
28250
15.76
34900
11.28
35480
13.17
32300
14.68
32000
18.36
47700
10.31
26540
14.82
42395
9.72
33990
14.15
43980
11.91
35010
11.02
39450
14.11
27900
13.19
32700
11.20
22100
14.04
33
1 n
1 n
Fik yi y
yi y Fik Fk n
n i 1
i 1
ry ( Fk )
s y sFk
s y k
0.9
0.8
0.6
des corrlations.
CORR
PRIX
R.POID.PUIS
Comp.1
0.772
-0.589
Comp.2
-0.087
0.673
PCA_1_Axis_2
0.7
R.Poid.Puis
0.5
0.4
LARG
LONG
0.3
POIDS
0.2
0.1
0
Prix CYL
-0.1
-0.2
-0.3
PUISS
-0.4
-0.5
-0.7
V.M AX
-0.6
-0.8
1 1 r
u y n 3 ln
2 1 r
SIGNIF.
PRIX
R.POID.PUIS
-0.9
-1
uy 2
Comp.1
3.975
-2.619
Comp.2
-0.337
3.158
-1 -0.9-0.8-0.7-0.6-0.5-0.4-0.3-0.2-0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
PCA_1_Axis_1
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
34
gk
1
ng
i: yi g
ik
FINITION
1_M
2_B
3_TB
Comp.1
Comp.2
Moyenne Valeur.Test Moyenne Valeur.Test
-2.0004
-2.43
0.0226
0.06
0.2353
0.37
-0.0453
-0.16
1.3924
1.93
0.0340
0.11
n_g
5
7
6
n ng
n 1
2
Fk
ng
n ng
n 1
k
ng
VTgk 2
gk 0
Datsun 200L
Lancia Beta
TBOpel Rekord
Mazda
B9295
Taunus 2000
Fiat 132
Renault 30
Alfasud TI
-2
VTgk
gk Fk
Audi 100
-4
Comp.2 (14%)
Alfetta 1.66
-2
Comp.1 (74%)
35
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
36
Modele
CYL
Peugeot 604
Peugeot 304 S
PUISS
2664
1288
LONG
136
74
LARG
472
414
POIDS
177
157
V.MAX
1410
915
180
160
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
37
PUISS
LONG
LARG
POIDS
V.MAX
2664
1288
136
74
472
414
177
157
1410
915
180
160
1631.667
363.394
84.611
19.802
433.500
21.484
166.667
5.164
1078.833
133.099
158.278
11.798
Modele
CYL
PUISS
LONG
LARG
POIDS
V.MAX
Peugeot 604
2.8408
2.5951
1.7920
2.0010
2.4881
1.8411
Peugeot 304 S
-0.9457
-0.5359
-0.9076
-1.8719
-1.2309
0.1460
Attribute
Comp.1
Comp.2
CYL
0.424936
-0.1241911
PUISS
0.4217944
-0.4157739
fonctions de
LONG
0.4214599
0.4118177
projection =
LARG
0.3869222
0.446087
POIDS
0.430512
0.2426758
V.MAX
0.3589443
-0.6198626
Comp.1
5.5633
-2.2122
Comp.2
-0.3386
-1.2578
vecteurs propres
Audi 100
Opel Rekord
Mazda 9295
Taunus 2000
Fiat 132
Peugeot 604
Renault 30
Peugeot 304 S
Alfasud TI
Datsun 200L
Lancia Beta
Lada 1300
Citroen GS Club
Toyota Corolla
-2
issus de lACP
Comp.2 (14%)
Modele
Peugeot 604
Peugeot 304 S
Coefficients des
Alfetta 1.66
-4
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
-2
0
Comp.1 (74%)
38
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
39
r
j 1
2
j
( F1 )
Mais, il se peut trs bien que chaque variable prsente individuellement une
corrlation moyenne avec la composante. Linterprtation est difficile.
Attribute
-
Axis_1
Corr.
Axis_2
% (Tot. %)
Corr.
% (Tot. %)
LONG
0.88615 79 % (79 %)
0.38103 15 % (93 %)
LARG
0.81354 66 % (66 %)
0.41274 17 % (83 %)
POIDS
0.90519 82 % (82 %)
0.22453
5 % (87 %)
CYL
0.89346 80 % (80 %)
-0.11491
1 % (81 %)
V.MAX
0.75471 57 % (57 %)
-0.57352 33 % (90 %)
0.7
0.6
0.88686 79 % (79 %)
-0.38469 15 % (93 %)
4.42086 74 % (74 %)
0.85606 14 % (88 %)
0.9
0.8
F2*
liaisons des variables avec lun des facteurs (on peut prserver ou
non lorthogonalit). Linterprtation des facteurs est facilit.
F2
F1*
0.5
PCA_1_Axis_2
PUISS
Var. Expl.
0.4
LARG
LONG
0.3
POIDS
0.2
FF1
0.1
0
CYL 1
-0.1
-0.2
-0.3
PUISS
-0.4
-0.5
V.M AX
-0.6
Attribute
-
Axis_1
Corr.
Axis_2
% (Tot. %)
Corr.
% (Tot. %)
LONG
0.91748 84 % (84 %)
-0.2978
9 % (93 %)
LARG
0.88379 78 % (78 %)
-0.22608
5 % (83 %)
POIDS
0.8286 69 % (69 %)
-0.42801 18 % (87 %)
CYL
0.59598 36 % (36 %)
-0.67549 46 % (81 %)
V.MAX
0.18928
4 % (4 %)
-0.92881 86 % (90 %)
PUISS
0.41314 17 % (17 %)
-0.87397 76 % (93 %)
Var. Expl.
2.87114 48 % (48 %)
2.40578 40 % (88 %)
-0.7
-0.8
-0.9
-1
-1 -0.9-0.8-0.7-0.6-0.5-0.4-0.3-0.2-0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
PCA_1_Axis_1
des autres).
Cf. https://onlinecourses.science.psu.edu/stat505/node/86
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
40
Rancho
Simca 1300
Citroen GS Club
Lancia Beta
Audi 100
Peugeot 504
Princess 1800
Mazda 9295
Datsun 200L
Fiat 132
Opel Rekord
Taunus 2000
-1
Alfasud TI
Alfetta 1.66
-2
Comp.2* (40%)
Renault 16 TL
Renault 30
-2
-1
Comp.1* (48%)
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
Modele
Alfasud TI
Toyota Corolla
Lada 1300
Citroen GS Club
Simca 1300
Renault 16 TL
Alfetta 1.66
Lancia Beta
Rancho
Taunus 2000
Fiat 132
Mazda 9295
Princess 1800
Peugeot 504
Renault 30
Opel Rekord
Audi 100
Datsun 200L
41
Prambule : les signes des vecteurs propres sont fixs arbitrairement, ils
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
42
SPAD
La rfrence de lanalyse de
donnes la franaise .
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
43
cos
sin
sin
cos
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
44
R
Avec plthore de packages : ade4, ca, FactoMineR, psych, etc.
#exemple avec le package psych qui propose la rotation VARIMAX
library(psych)
library(GPArotation)
autos.varimax <- principal(autos,nfactors=2,rotate="varimax")
print(autos.varimax,digits=4)
45
Tanagra
ACP et Rotation VARIMAX
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
46
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
47
Analyse parallle
Dterminer la distribution des k sous H0 (absence de lien entre les variables)
Variante : On peut aussi gnrer
Dmarche :
1.
2.
entre les variables est compltement cass (on est sous H0)
moyenne et cart-type.
3.
4.
5.
(0.95) Critical
Component
Eigenvalue
4.4209
2.2255
0.8561
1.6438
0.3731
1.2513
0.2139
0.9783
0.0928
0.7357
0.0433
0.4874
value
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
k sous Tanagra
48
Analyse bootstrap
Evaluer la significativit des v.p. successifs c.--d. k > 1 significativement ?
Dmarche :
1.
2.
Raliser lACP sur cette nouvelle version des donnes, collecter les v.p.
3.
4.
5.
>1
Component
3.692685
0.513354
0.229661
0.096113
0.037946
0.006305
3.692685
4.975922
0.513354
1.42439
0.229661
0.577211
0.096113
0.295001
0.037946
0.122611
0.006305
0.052366
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
49
Analyse bootstrap
Evaluer le recouvrement entre les k successifs. La composante k est pertinente si k > k+1 significativement.
Dmarche :
1.
2.
3.
4.
5.
3.692685
4.975922
0.513354
1.42439
0.229661
0.577211
0.096113
0.295001
0.037946
0.122611
0.006305
0.052366
Eigenvalue
Component
Scree test
5
3
Component
50
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
51
R = matrice unit
|R| = 0, il y a une colinarit parfaite (le 1er facteur explique 100% de linertie totale)
Statistique de test :
R
CYL
PUISS
LONG
LARG
POIDS
V.MAX
CYL
1
0.797
0.701
0.630
0.789
0.665
2p 5
2 p ( p 1)
B n 1
ln R
6
2
PUISS
LONG
LARG
POIDS
V.MAX
0.797
0.701
0.630
0.789
0.665
1
0.641
0.521
0.765
0.844
0.641
1
0.849
0.868
0.476
0.521
0.849
1
0.717
0.473
0.765
0.868
0.717
1
0.478
0.844
0.476
0.473
0.478
1
Donnes
AUTOS
95.11988
15
<0.00001
Conclusion : rejet de H0, les variables ne sont pas indp. 2 2. Il est possible de
compresser linformation avec lACP. Efficacement mme si lon en juge la valeur de |R|.
Effectivement, on a vu que F1 reprsentait 74% de linfo dispo.
Remarque : une variante de ce test peut tre utilise pour dtecter le nombre de
composantes significatives , mais elle savre trop permissive en pratique.
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
52
MSA : Measure of sampling adequacy [ou indice KMO (Kaiser Mayer Olkin)]
Ide du MSA : confronter la matrice des corrlations brutes avec la matrice des corrlations partielles.
Si MSA 1, lACP peut agir efficacement parce que corrlations partielles sont quasi-nulles (en valeur
absolue) ; si MSA << 1, problme car pas de redondance entre les variables.
R
CYL
PUISS
LONG
LARG
POIDS
V.MAX
CYL
1
0.797
0.701
0.630
0.789
0.665
PUISS LONG
LARG
POIDS V.MAX
0.797
0.701
0.630
0.789
0.665
1
0.641
0.521
0.765
0.844
0.641
1
0.849
0.868
0.476
0.521
0.849
1
0.717
0.473
0.765
0.868
0.717
1
0.478
0.844
0.476
0.473
0.478
1
PARTIAL R CYL
PUISS LONG
LARG
POIDS V.MAX
CYL
1
0.107
-0.060
0.109
0.320
0.189
PUISS
0.107
1
-0.083
-0.334
0.652
0.841
LONG
-0.060
-0.083
1
0.582
0.530
0.090
LARG
0.109
-0.334
0.582
1
0.127
0.331
POIDS
0.320
0.652
0.530
0.127
1
-0.611
V.MAX
0.189
0.841
0.090
0.331
-0.611
1
Les corrlations brutes et partielles sont majoritairement diffrentes, les relations entre 2 variables
quelconques sont fortement dtermines par les autres.
r
MSA
r r
2
j m j
jm
j m j
jm
j m j
* 2
jm
Donnes AUTOS
MSA = 0.740
FACTORanalysis3a.html
53
partielle reste proche de la corrlation brute c.--d. qui participent peu la redondance globale
plus lindice est faible, plus la variable est faiblement lie globalement aux autres.
r r
2
MSAj
m j
jm
m j
jm
m j
MSACYL
CYL
PUISS
LONG
LARG
POIDS
V.MAX
* 2
jm
CYL
CYL
1
PUISS LONG
LARG
POIDS V.MAX
0.797
0.701
0.630
0.789
0.665
r*
PARTIAL R CYL
CYL
PUISS LONG
LARG
POIDS V.MAX
0.107
-0.060
0.109
0.320
0.189
MSA
0.940
0.674
0.803
0.784
0.693
0.598
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
54
Retrancher linfluence dune ou plusieurs variables qui psent sur toutes les
autres dans lanalyse
Une manire de grer leffet taille qui crase souvent la 1re composante
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
55
0.8
0.7
0.6
0.4
LARG
LONG
0.3
POIDS
0.2
PCA_1_Axis_2
0.5
CYL
-0.1
-0.2
-0.3
PUISS
-0.4
-0.5
variables, dterminant
le 1er facteur, et
0.1
lensemble des
V.M AX
-0.6
-0.7
-0.8
-0.9
-1
-1 -0.9-0.8-0.7-0.6-0.5-0.4-0.3-0.2-0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
PCA_1_Axis_1
Corrlation
brutes
CORR
CYL
PUISS
LONG
LARG
POIDS
V.MAX
Corrlations
partielles / CYL
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
1
0.797
0.701
0.630
0.789
0.665
CORR/CYL
CYL
PUISS
LONG
LARG
POIDS
V.MAX
Matrice diagonaliser
56
Il y a 2 composantes
analyser, de manire
vidente maintenant : avec
1 = 2.41 et 2 = 1.61.
Peugeot 504
0.9
0.8
0.7
Princess 1800
Rancho
1 100
Audi
0.6
0.5
Datsun 200L
PCA_2_Axis_2
PCA_2_Axis_2
0.4
LongLarg
0.1
Poids
0.3
0.2
Renault 16 TL
r s_LARG_1
r s_LONG_1
r s_POI DS_1
0
-0.1
Lada 1300
Simca 1300
Opel Rekord
Toyota Cor
Citroen GS Club
Mazda 9295
Taunus 2000
Renault 30
Lancia Beta
-1
Fiat 132
-0.2
-0.3
-0.4
-2
-0.5
Alfasud TI
-0.6
-0.7
-0.8
-0.9
Puiss
V.max
r s_PUI SS_1
r s_V. MAX_1
-1
-1 -0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
PCA_2_Axis_1
-3
Alfetta 1.66
-3
-2
-1
0
PCA_2_Axis_1
Ricco Rakotomalala
ncessaire
de post-traiter cette fois-ci (rotation des axes).
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
58
CYL
1350
1588
1294
1222
1585
1297
1796
1565
2664
1166
1570
1798
1998
1993
1442
1769
1979
1294
PUISS
79
85
68
59
98
82
79
55
128
55
109
82
115
98
80
83
100
68
LONG
393
468
424
412
439
429
449
424
452
399
428
445
469
438
431
440
459
404
LARG
POIDS V.MAX
161
870
165
177
1110
160
168
1050
152
161
930
151
164
1105
165
169
1080
160
169
1160
154
163
1010
140
173
1320
180
157
815
140
162
1060
175
172
1160
158
169
1370
160
170
1080
167
166
1129
144
165
1095
165
173
1120
173
161
955
140
RND1
1.029
0.379
-0.346
0.849
-1.425
0.890
-0.860
2.379
-0.578
0.381
0.204
0.216
0.603
-0.326
-0.787
-0.931
0.984
0.986
RND2
0.109
0.367
0.737
0.494
-0.210
0.071
-0.001
-1.367
0.705
0.330
0.287
0.549
0.914
0.857
0.948
1.222
0.831
0.791
RND3
0.267
-1.054
-0.056
-0.320
0.535
-1.308
-0.315
-0.633
-1.304
0.121
-2.117
-0.619
1.403
-0.565
-1.389
-0.133
-0.138
-0.100
RND4
-0.949
0.106
-0.430
0.729
-0.200
-0.971
-1.329
-1.448
2.124
-1.285
-1.675
-0.096
-0.371
1.455
-0.377
-1.090
0.545
0.037
RND5
0.053
1.316
0.274
0.637
-1.983
-0.131
-0.605
0.609
-1.132
0.570
0.111
-1.632
-1.892
0.370
-0.139
-1.201
-1.730
0.221
RND6
-1.144
1.632
1.044
0.793
0.832
-1.134
1.299
-0.175
-2.091
-1.628
2.773
-0.066
0.681
-0.656
-0.721
0.187
1.459
0.764
Ces variables additionnelles vont masquer les relations existantes entre les autres
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
59
Attribute
variables bruites
Nombre de composantes
Scree plot
5
2 (?)
4 (?)
CYL
PUISS
LONG
LARG
POIDS
V.MAX
RND1
RND2
RND3
RND4
RND5
RND6
Var. Expl.
Axis_1
Corr.
% (Tot. %)
-0.8847 78 % (78 %)
-0.8912 79 % (79 %)
-0.8452 71 % (71 %)
-0.7702 59 % (59 %)
-0.8905 79 % (79 %)
-0.7541 57 % (57 %)
0.4695 22 % (22 %)
-0.4413 19 % (19 %)
0.0474
0 % (0 %)
-0.5592 31 % (31 %)
0.6468 42 % (42 %)
-0.0811
1 % (1 %)
5.40111 45 % (45 %)
Axis_2
Corr.
% (Tot. %)
-0.0295 0 % (78 %)
-0.0157 0 % (79 %)
-0.2290 5 % (77 %)
-0.3696 14 % (73 %)
-0.0488 0 % (80 %)
-0.1145 1 % (58 %)
-0.3550 13 % (35 %)
0.4068 17 % (36 %)
0.7548 57 % (57 %)
0.0730 1 % (32 %)
-0.4995 25 % (67 %)
-0.3246 11 % (11 %)
1.42714 12 % (57 %)
Axis_3
Corr.
% (Tot. %)
-0.1463 2 % (80 %)
-0.0217 0 % (79 %)
0.3167 10 % (87 %)
-0.0191 0 % (73 %)
0.1851 3 % (83 %)
-0.0820 1 % (59 %)
0.0293 0 % (35 %)
-0.2630 7 % (43 %)
0.3744 14 % (71 %)
-0.6058 37 % (69 %)
-0.3422 12 % (78 %)
0.7132 51 % (62 %)
1.36642 11 % (68 %)
Axis_4
Corr.
% (Tot. %)
-0.2681 7 % (88 %)
0.0356 0 % (80 %)
-0.0911 1 % (88 %)
-0.1024 1 % (74 %)
-0.1536 2 % (85 %)
0.1318 2 % (61 %)
-0.5753 33 % (68 %)
0.5380 29 % (72 %)
-0.3263 11 % (82 %)
-0.0873 1 % (69 %)
0.1718 3 % (81 %)
0.4404 19 % (81 %)
1.09082 9 % (77 %)
encombrement / gamme
Comp.2
Datsun 200L
Mazda 9295
0
1
10
11
12
Component
Alf asud TI
Lada 1300
Simca 1300
0
PCA_1_Axis_2
Rancho
Princess 1800
Taunus 2000
Renault 30
Citroen GS Club
Opel Rekord
Comp.1
Peugeot 504
-1
Lancia Beta
Renault 16 TL
-2
-4
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
-3
-2
-1
0
PCA_1_Axis_1
60
x a F a F a F e
p1 1
p2 2
pq q
p
p
61
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
62
Analyse en facteurs principaux [AFP] (Outil Principal Factor Analysis dans Tanagra)
CYL
CYL
Matrice des
corrlations (usuelle)
PUISS LONG LARG POIDS V_MA RND1 RND2 RND3 RND4 RND5 RND6
X
1
0.80
0.70
0.63
0.79
0.66
-0.28
0.24 -0.06
0.57 -0.55 -0.13
PUISS
0.80
0.64
0.52
0.77
0.84
-0.38
0.35
-0.11
0.43
-0.58
0.07
LONG
0.70
LARG
0.63
0.64
0.85
0.87
0.48
-0.29
0.22
-0.01
0.31
-0.48
0.31
0.52
0.85
0.72
0.47
-0.19
0.25
-0.19
0.48
-0.26
0.11
POIDS
V_MA
X
RND1
0.79
0.77
0.87
0.72
0.48
-0.36
0.27
-0.01
0.35
-0.62
0.09
0.66
0.84
0.48
0.47
0.48
-0.31
0.27
-0.19
0.38
-0.45
0.11
-0.28
-0.38
-0.29
-0.19
-0.36
-0.31
-0.44
0.02
-0.18
0.37
-0.02
RND2
0.24
0.35
0.22
0.25
0.27
0.27
-0.44
0.08
0.43
-0.25
0.01
(trs malencontreusement)
RND3
-0.06
-0.11
-0.01
-0.19
-0.01
-0.19
0.02
0.08
-0.03
-0.38
-0.02
RND4
0.57
0.43
0.31
0.48
0.35
0.38
-0.18
0.43
-0.03
-0.14
-0.24
RND5
-0.55
-0.58
-0.48
-0.26
-0.62
-0.45
0.37
-0.25
-0.38
-0.14
-0.02
RND6
-0.13
0.07
0.31
0.11
0.09
0.11
-0.02
0.01
-0.02
-0.24
-0.02
CYL
Matrice H = (hjm)
PUISS LONG LARG POIDS V_MA RND1 RND2 RND3 RND4 RND5 RND6
X
0.80
0.70
0.63
0.79
0.66
-0.28
0.24 -0.06
0.57 -0.55 -0.13
CYL
0.84
PUISS
0.80
0.92
0.64
0.52
0.77
0.84
-0.38
0.35
-0.11
0.43
-0.58
0.07
LONG
0.70
0.64
0.93
0.85
0.87
0.48
-0.29
0.22
-0.01
0.31
-0.48
0.31
LARG
0.63
0.52
0.85
0.88
0.72
0.47
-0.19
0.25
-0.19
0.48
-0.26
0.11
POIDS
0.79
0.77
0.87
0.72
0.92
0.48
-0.36
0.27
-0.01
0.35
-0.62
0.09
V_MA
X
RND1
0.66
0.84
0.48
0.47
0.48
0.88
-0.31
0.27
-0.19
0.38
-0.45
0.11
-0.28
-0.38
-0.29
-0.19
-0.36
-0.31
0.34
-0.44
0.02
-0.18
0.37
-0.02
communalits dans la
RND2
0.24
0.35
0.22
0.25
0.27
0.27
-0.44
0.39
0.08
0.43
-0.25
0.01
RND3
-0.06
-0.11
-0.01
-0.19
-0.01
-0.19
0.02
0.08
0.45
-0.03
-0.38
-0.02
diagonale.
RND4
0.57
0.43
0.31
0.48
0.35
0.38
-0.18
0.43
-0.03
0.61
-0.14
-0.24
RND5
-0.55
-0.58
-0.48
-0.26
-0.62
-0.45
0.37
-0.25
-0.38
-0.14
0.69
-0.02
RND6
-0.13
0.07
0.31
0.11
0.09
0.11
-0.02
0.01
-0.02
-0.24
-0.02
0.51
Rcyl = 0.84 coefficient de dtermination de la rgression de CYL sur les autres variables
(PUISS, LONG, , RND6). Seule cette fraction doit tre intgre dans la modlisation.
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
63
AFP sur les donnes AUTOS + RND Tableau des valeurs propres
On en slectionne 4 si on
se fie ce critre
v.p. ngatives
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
64
PFA_1_Axis_1
PFA_1_Axis_4
Princess vs.
1800
Rancho
Datsun 200L
Lada 1300
Simca 1300
Citroen GS Club
Toyota Coroll
Opel Rekord
Mazda 9295Lancia Beta
PFA_1_Axis_4
Peugeot 504
Audi 100
Taunus 2000
Renault 16 TL
Fiat 132
-1
Alfasud TI
-2
Alfetta 1.66
-1
0
PFA_1_Axis_1
65
Linertie
explique par
les 4 facteurs
reste la mme
aprs rotation.
Encombrement /
gamme
On peut oublier
66
Analyse de Harris
Exacerber les corrlations en les divisant par les uniqueness
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
67
PUISS LONG LARG POIDS V_MA RND1 RND2 RND3 RND4 RND5 RND6
X
7.24
6.50
4.59
7.22
4.89
-0.88
0.76 -0.20
2.29 -2.48 -0.45
CYL
5.35
PUISS
7.24
11.94
8.49
5.41
10.00
8.87
-1.67
1.61
-0.53
2.49
-3.72
0.37
LONG
6.50
8.49
12.55
9.00
11.57
5.10
-1.30
1.03
-0.07
1.82
-3.17
1.62
LARG
4.59
5.41
9.00
7.33
7.50
3.98
-0.67
0.91
-0.75
2.23
-1.35
0.46
POIDS
7.22
10.00
11.57
7.50
12.10
5.05
-1.58
1.28
-0.06
2.05
-4.02
0.48
V_MAX
4.89
8.87
5.10
3.98
5.05
7.48
-1.12
1.00
-0.76
1.75
-2.37
0.46
RND1
-0.88
-1.67
-1.30
-0.67
-1.58
-1.12
0.51
-0.70
0.03
-0.35
0.82
-0.04
RND2
0.76
1.61
1.03
0.91
1.28
1.00
-0.70
0.64
0.14
0.88
-0.57
0.02
RND3
-0.20
-0.53
-0.07
-0.75
-0.06
-0.76
0.03
0.14
0.82
-0.06
-0.93
-0.04
autres (Rj 1 uj 0)
RND4
2.29
2.49
1.82
2.23
2.05
1.75
-0.35
0.88
-0.06
1.56
-0.40
-0.55
RND5
-2.48
-3.72
-3.17
-1.35
-4.02
-2.37
0.82
-0.57
-0.93
-0.40
2.21
-0.04
RND6
-0.45
0.37
1.62
0.46
0.48
0.46
-0.04
0.02
-0.04
-0.55
-0.04
1.03
h*jm
h jm
u j um
Scree plot
48
46
44
42
40
38
36
34
32
Eigenvalue
30
28
26
24
22
2 facteurs
20
18
16
14
12
10
8
6
4
2
0
1
10
11
12
Component
68
(6.03354/8.36437) = 72% de la
variabilit initiale a t reproduite.
Renault 16 TL
Peugeot 504
1
Harris_1_Axis_2
Rancho
Simca 1300
Princess 1800
Datsun 200L
Lancia Beta
0
Lada GS
1300
Citroen
Club
Toyota Corolla
Opel Rekord
Mazda 9295
Taunus 2000
Fiat 132
-1
Renault 30
Alfasud TI
-1
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
Alfetta 1.66
0
Harris_1_Axis_1
69
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
70
Ricco Rakotomalala
Tutoriels Tanagra - http://tutoriels-data-mining.blogspot.fr/
71
Escofier B., Pags J., Analyses factorielles simples et multiples , Dunod, 2008.
Lebart L., Morineau A., Piron M., Statistique exploratoire multidimensionnelle , Dunod, 3me
dition, 2000.
Saporta G., Probabilits, Analyse des Donnes et Statistique , Technip, 2006.
Tenenhaus M., Statistique : Mthodes pour dcrire, expliquer et prvoir , Dunod, 2006.
72