1 Introduction

Ce jeu de données est constitué de caractéristiques de chiffres manuscrits (0'--9’) extrait d’une collection de cartes d’utilité publique néerlandaises. Les modèles ont été numérisés en images binaire. Ces chiffres sont représentés par les six des ensembles de fonctionnalités suivantes :

  1. mfeat-fou: 76 Fourier coefficients of the character shapes;
  2. mfeat-fac: 216 profile correlations;
  3. mfeat-kar: 64 Karhunen-Love coefficients;
  4. mfeat-pix: 240 pixel averages in 2 x 3 windows;
  5. mfeat-zer: 47 Zernike moments;
  6. mfeat-mor: 6 morphological features.

Nous n’avons pas de valeurs manquantes. La problématique: en analysant les 6 groupes séparement on gardera dans chaque groupe les variables qui influence le plus le choix des classes et cherchera le meilleur algorithme qui peut predire les classes.

2 Importation des données

## Warning: package 'factoextra' was built under R version 3.6.3
## Loading required package: ggplot2
## Warning: package 'ggplot2' was built under R version 3.6.3
## Welcome! Want to learn more? See two factoextra-related books at https://goo.gl/ve3WBa
## Warning: package 'data.table' was built under R version 3.6.3
##    class pix_1 pix_2 pix_3 pix_4 pix_5 pix_6 pix_7 pix_8 pix_9 pix_10 pix_11
## 1      0     0     3     4     4     4     4     4     4     4      4      4
## 2      0     0     0     3     6     6     6     6     6     6      5      4
## 3      0     0     0     0     2     5     5     4     6     4      4      1
## 4      0     0     0     0     0     0     0     0     0     1      3      5
## 5      0     0     5     6     6     6     6     6     6     6      5      2
## 6      0     0     0     0     0     1     3     4     4     4      3      2
## 7      0     0     0     0     1     5     6     6     6     6      5      3
## 8      0     0     5     6     6     6     6     6     6     6      6      4
## 9      0     0     3     4     6     6     5     2     0     0      0      0
## 10     0     0     3     6     6     6     6     6     6     5      1      0
##    pix_12 pix_13 pix_14 pix_15 pix_16 pix_17 pix_18 pix_19 pix_20 pix_21 pix_22
## 1       1      0      0      0      0      6      6      6      6      6      4
## 2       3      0      0      0      0      3      6      6      6      6      6
## 3       0      0      0      0      0      1      5      6      6      6      6
## 4       6      4      4      1      0      0      0      0      1      5      6
## 5       0      0      0      0      3      6      6      6      6      5      4
## 6       4      1      0      0      0      0      0      3      6      3      0
## 7       1      0      0      0      0      1      4      6      6      6      6
## 8       1      0      0      0      4      6      6      6      6      6      6
## 9       0      0      0      0      5      6      6      6      6      6      6
## 10      0      0      0      0      0      6      6      6      6      6      6
##    pix_23 pix_24 pix_25 pix_26 pix_27 pix_28 pix_29 pix_30 pix_31 pix_32 pix_33
## 1       6      6      6      6      4      0      0      0      0      6      6
## 2       6      6      6      6      6      1      0      0      2      6      6
## 3       6      6      6      3      0      0      0      0      1      6      6
## 4       6      6      6      6      6      6      6      5      0      0      0
## 5       5      6      6      6      5      3      0      0      3      6      6
## 6       0      3      6      6      6      6      1      0      0      0      3
## 7       6      6      6      6      6      2      0      0      0      6      6
## 8       6      6      6      6      4      0      0      0      5      6      6
## 9       6      3      0      0      0      0      0      0      6      6      6
## 10      6      6      5      1      0      0      0      0      0      6      6
##    pix_34 pix_35 pix_36 pix_37 pix_38 pix_39 pix_40 pix_41 pix_42 pix_43 pix_44
## 1       6      6      1      0      1      5      6      6      6      2      0
## 2       6      6      4      2      2      2      5      6      6      5      1
## 3       6      6      6      6      6      6      6      6      1      0      0
## 4       0      5      6      6      3      0      0      0      4      6      6
## 5       6      4      0      0      0      2      5      6      6      6      4
## 6       6      6      0      0      0      0      2      6      6      6      3
## 7       6      6      5      2      2      4      6      6      6      3      0
## 8       6      6      1      0      0      1      6      6      6      5      0
## 9       6      4      5      6      6      6      4      0      0      0      0
## 10      6      6      5      3      6      6      6      6      0      0      0
##    pix_45 pix_46 pix_47 pix_48 pix_49 pix_50 pix_51 pix_52 pix_53 pix_54 pix_55
## 1       0      0      3      6      6      6      0      0      0      0      5
## 2       0      4      6      6      6      1      0      0      0      0      3
## 3       0      3      6      6      6      6      3      3      6      6      6
## 4       3      0      0      0      4      6      6      3      0      0      0
## 5       0      2      6      6      6      3      0      0      0      0      0
## 6       0      0      5      6      6      6      0      0      0      0      0
## 7       0      0      6      6      6      4      0      0      0      0      3
## 8       0      3      6      6      6      6      0      0      0      0      6
## 9       0      6      6      6      3      0      0      3      6      6      6
## 10      0      2      6      6      6      5      1      0      3      6      6
##    pix_56 pix_57 pix_58 pix_59 pix_60 pix_61 pix_62 pix_63 pix_64 pix_65 pix_66
## 1       6      6      5      0      0      0      3      6      6      6      0
## 2       6      6      6      2      0      6      6      6      6      5      1
## 3       6      5      1      0      0      4      6      6      6      3      0
## 4       0      3      6      6      6      0      0      0      6      6      6
## 5       5      6      6      6      0      0      3      6      6      3      0
## 6       6      6      6      4      0      0      4      6      6      6      0
## 7       6      6      6      3      0      0      6      6      6      6      2
## 8       6      6      6      1      0      5      6      6      5      1      0
## 9       6      2      0      0      0      6      6      6      5      0      0
## 10      6      4      0      0      0      6      6      6      6      0      0
##    pix_67 pix_68 pix_69 pix_70 pix_71 pix_72 pix_73 pix_74 pix_75 pix_76 pix_77
## 1       0      0      0      1      6      6      6      0      0      0      3
## 2       0      0      0      1      5      6      6      2      0      3      6
## 3       0      5      6      6      6      6      6      0      0      5      6
## 4       0      0      0      0      0      3      6      6      4      0      0
## 5       0      0      0      0      2      6      6      6      1      0      5
## 6       0      0      0      0      3      6      6      5      0      1      6
## 7       0      0      0      3      6      6      6      6      0      0      6
## 8       0      0      0      5      6      6      6      3      0      3      6
## 9       0      2      6      6      6      4      0      0      0      2      6
## 10      0      2      6      6      6      6      0      0      0      5      6
##    pix_78 pix_79 pix_80 pix_81 pix_82 pix_83 pix_84 pix_85 pix_86 pix_87 pix_88
## 1       6      6      6      0      0      0      0      2      6      6      6
## 2       6      6      6      3      0      0      0      0      5      6      6
## 3       6      6      3      0      0      1      6      6      6      6      6
## 4       0      6      6      6      0      0      0      0      0      3      6
## 5       6      6      3      0      0      0      0      0      0      6      6
## 6       6      6      5      0      0      0      0      2      6      6      6
## 7       6      6      6      3      0      0      1      5      6      6      6
## 8       6      4      0      0      0      0      0      1      6      6      6
## 9       6      6      0      0      0      0      2      6      6      6      3
## 10      6      6      0      0      0      0      4      6      6      6      1
##    pix_89 pix_90 pix_91 pix_92 pix_93 pix_94 pix_95 pix_96 pix_97 pix_98 pix_99
## 1       0      0      0      6      6      6      6      0      0      0      0
## 2       6      2      4      6      6      6      3      0      0      0      0
## 3       0      0      1      6      6      6      5      0      0      0      6
## 4       6      3      0      1      5      6      6      2      0      0      0
## 5       6      3      0      6      6      6      3      0      0      0      0
## 6       3      0      3      6      6      6      4      0      0      0      0
## 7       6      0      1      6      6      6      3      0      0      0      1
## 8       4      0      4      6      6      6      3      0      0      0      0
## 9       0      0      0      6      6      6      0      0      0      0      0
## 10      0      0      1      6      6      6      0      0      0      0      1
##    pix_100 pix_101 pix_102 pix_103 pix_104 pix_105 pix_106 pix_107 pix_108
## 1        2       6       6       6       0       0       0       3       6
## 2        0       3       6       6       6       2       6       6       6
## 3        6       6       6       6       2       0       0       6       6
## 4        0       0       3       6       6       3       0       1       6
## 5        0       0       6       6       6       5       0       6       6
## 6        1       6       6       6       3       0       3       6       6
## 7        5       6       6       6       1       0       2       6       6
## 8        0       6       6       6       6       3       5       6       6
## 9        4       6       6       6       0       0       0       4       6
## 10       6       6       6       5       0       0       2       6       6
##    pix_109 pix_110 pix_111 pix_112 pix_113 pix_114 pix_115 pix_116 pix_117
## 1        6       3       0       0       0       0       0       6       6
## 2        6       0       0       0       0       0       0       0       6
## 3        6       6       2       0       0       5       6       6       6
## 4        6       6       0       0       0       0       0       1       6
## 5        6       6       1       0       0       0       0       0       5
## 6        6       5       0       0       0       0       0       6       6
## 7        6       1       0       0       0       0       4       6       6
## 8        6       0       0       0       0       0       0       6       6
## 9        6       3       0       0       0       0       3       6       6
## 10       6       0       0       0       0       0       3       6       6
##    pix_118 pix_119 pix_120 pix_121 pix_122 pix_123 pix_124 pix_125 pix_126
## 1        6       3       0       0       3       6       6       0       0
## 2        6       6       2       6       6       6       6       0       0
## 3        6       6       0       0       6       6       6       4       0
## 4        6       5       0       0       1       6       6       3       0
## 5        6       6       6       0       5       6       6       6       3
## 6        6       6       1       3       6       6       6       1       0
## 7        6       5       0       1       6       6       6       6       2
## 8        6       6       1       3       6       6       6       5       0
## 9        6       0       0       0       0       6       6       6       3
## 10       6       0       0       6       6       6       6       0       0
##    pix_127 pix_128 pix_129 pix_130 pix_131 pix_132 pix_133 pix_134 pix_135
## 1        0       0       0       0       6       6       6       3       0
## 2        0       0       0       0       0       6       6       6       3
## 3        0       0       1       6       6       6       6       6       0
## 4        0       0       0       0       3       6       6       3       0
## 5        0       0       0       0       0       5       6       6       6
## 6        0       0       0       0       6       6       6       6       3
## 7        0       0       2       6       6       6       6       6       1
## 8        0       0       0       0       6       6       6       6       2
## 9        0       0       0       0       4       6       6       3       0
## 10       0       0       0       3       6       6       6       0       0
##    pix_136 pix_137 pix_138 pix_139 pix_140 pix_141 pix_142 pix_143 pix_144
## 1        0       3       6       6       3       0       0       0       0
## 2        6       6       6       6       0       0       0       0       0
## 3        3       6       6       6       6       1       0       0       1
## 4        0       3       6       6       2       0       0       0       0
## 5        0       3       6       6       6       5       0       0       0
## 6        3       6       6       6       6       0       0       0       0
## 7        5       6       6       6       5       1       0       0       0
## 8        3       6       6       6       6       0       0       0       0
## 9        0       0       5       6       6       4       0       0       0
## 10       2       6       6       6       0       0       0       0       0
##    pix_145 pix_146 pix_147 pix_148 pix_149 pix_150 pix_151 pix_152 pix_153
## 1        0       6       6       6       3       0       0       3       6
## 2        0       3       6       6       6       0       6       6       6
## 3        5       6       6       6       6       1       0       5       6
## 4        0       3       6       6       0       0       0       3       6
## 5        0       0       4       6       6       6       0       3       6
## 6        0       6       6       6       6       3       3       6       6
## 7        3       6       6       6       6       3       6       6       6
## 8        0       6       6       6       6       5       1       6       6
## 9        0       5       6       6       3       0       0       0       1
## 10       3       6       6       6       4       0       0       6       6
##    pix_154 pix_155 pix_156 pix_157 pix_158 pix_159 pix_160 pix_161 pix_162
## 1        6       6       0       0       0       0       0       6       6
## 2        6       0       0       0       0       0       3       6       6
## 3        6       6       5       1       0       0       3       6       6
## 4        4       0       0       0       0       0       2       6       6
## 5        6       6       4       0       0       0       0       0       3
## 6        6       6       0       0       0       0       0       6       6
## 7        6       5       1       0       0       0       3       6       6
## 8        6       6       1       0       0       0       2       6       6
## 9        6       6       6       2       0       0       0       0       6
## 10       6       0       0       0       0       0       3       6       6
##    pix_163 pix_164 pix_165 pix_166 pix_167 pix_168 pix_169 pix_170 pix_171
## 1        6       4       0       0       3       6       6       6       0
## 2        6       6       0       6       6       6       6       0       0
## 3        6       6       3       0       0       6       6       6       6
## 4        6       0       0       1       6       6       3       0       0
## 5        6       6       6       0       0       6       6       6       4
## 6        6       6       3       3       6       6       6       6       0
## 7        6       6       0       3       6       6       6       6       4
## 8        6       6       3       0       6       6       6       6       5
## 9        6       5       0       0       0       0       2       6       6
## 10       6       6       2       2       6       6       6       0       0
##    pix_172 pix_173 pix_174 pix_175 pix_176 pix_177 pix_178 pix_179 pix_180
## 1        0       0       0       0       6       6       6       6       0
## 2        0       0       0       5       6       6       6       4       0
## 3        6       3       0       4       6       6       6       6       5
## 4        0       0       0       6       6       5       1       0       0
## 5        0       0       0       0       0       4       6       6       6
## 6        0       0       0       2       6       6       6       6       2
## 7        0       0       0       4       6       6       6       6       0
## 8        0       0       0       3       6       6       6       6       5
## 9        6       1       0       0       0       5       6       6       0
## 10       0       0       0       5       6       6       6       6       2
##    pix_181 pix_182 pix_183 pix_184 pix_185 pix_186 pix_187 pix_188 pix_189
## 1        0       3       6       6       6       3       0       0       0
## 2        6       6       6       6       0       0       0       0       4
## 3        0       0       5       6       6       6       6       6       6
## 4        3       6       6       3       0       0       0       0       3
## 5        0       0       6       6       6       6       5       0       0
## 6        1       6       6       6       6       1       0       0       1
## 7        5       6       6       6       6       6       3       0       3
## 8        0       5       6       6       6       6       0       0       0
## 9        0       0       0       0       3       6       6       4       0
## 10       3       6       6       6       0       0       0       0       3
##    pix_190 pix_191 pix_192 pix_193 pix_194 pix_195 pix_196 pix_197 pix_198
## 1        1       6       6       6       5       0       0       3       6
## 2        6       6       6       6       0       0       6       6       6
## 3        6       6       6       6       6       6       0       0       0
## 4        6       6       2       0       0       0       3       6       6
## 5        0       2       6       6       6       6       0       0       5
## 6        6       6       6       6       2       0       0       6       6
## 7        6       6       6       6       3       0       4       6       6
## 8        5       6       6       6       6       1       0       1       6
## 9        0       0       3       6       6       1       0       0       0
## 10       6       6       6       6       3       0       2       6       6
##    pix_199 pix_200 pix_201 pix_202 pix_203 pix_204 pix_205 pix_206 pix_207
## 1        6       6       5       1       0       1       5       6       6
## 2        6       3       2       2       5       6       6       6       6
## 3        4       6       6       6       6       6       6       6       6
## 4        6       3       3       4       5       6       5       1       0
## 5        6       6       6       6       3       2       2       5       6
## 6        6       6       6       4       4       6       6       6       6
## 7        6       6       6       5       2       5       6       6       6
## 8        6       6       6       1       1       3       6       6       6
## 9        0       0       3       6       6       5       2       3       6
## 10       6       5       4       4       4       6       6       6       6
##    pix_208 pix_209 pix_210 pix_211 pix_212 pix_213 pix_214 pix_215 pix_216
## 1        6       0       0       0       3       6       6       6       6
## 2        5       0       0       6       6       6       6       6       6
## 3        6       6       3       0       0       0       0       3       6
## 4        0       0       0       3       6       6       6       6       6
## 5        6       6       5       0       0       0       3       6       6
## 6        3       0       0       0       5       6       6       6       6
## 7        5       0       0       0       5       6       6       6       6
## 8        6       6       0       0       0       5       6       6       6
## 9        6       6       5       0       0       0       0       0       0
## 10       6       0       0       0       5       6       6       6       6
##    pix_217 pix_218 pix_219 pix_220 pix_221 pix_222 pix_223 pix_224 pix_225
## 1        6       4       6       6       6       6       5       0       0
## 2        6       6       6       6       6       5       1       0       0
## 3        6       6       6       6       6       6       5       1       0
## 4        6       6       4       0       0       0       0       0       0
## 5        6       6       6       6       6       6       6       3       0
## 6        6       6       6       6       4       4       1       0       0
## 7        6       6       6       6       5       3       0       0       0
## 8        6       6       6       6       6       6       6       3       0
## 9        5       6       6       6       6       6       6       5       1
## 10       6       6       6       6       6       6       5       0       0
##    pix_226 pix_227 pix_228 pix_229 pix_230 pix_231 pix_232 pix_233 pix_234
## 1        0       1       2       4       4       4       4       4       4
## 2        3       4       4       4       4       4       4       4       4
## 3        0       0       0       0       0       1       4       4       4
## 4        0       2       4       4       4       4       4       4       1
## 5        0       0       0       0       1       4       4       4       4
## 6        0       0       1       4       4       4       4       3       2
## 7        0       0       2       4       4       4       4       4       4
## 8        0       0       0       3       4       4       4       4       4
## 9        0       0       0       0       0       0       2       4       4
## 10       0       0       3       4       4       4       4       4       4
##    pix_235 pix_236 pix_237 pix_238 pix_239 pix_240
## 1        4       4       1       0       0       0
## 2        4       3       0       0       0       0
## 3        4       4       3       0       0       0
## 4        0       0       0       0       0       0
## 5        4       3       0       0       0       0
## 6        0       0       0       0       0       0
## 7        2       0       0       0       0       0
## 8        4       4       2       0       0       0
## 9        4       3       1       0       0       0
## 10       4       4       3       0       0       0

3 Aperçu général

## 
##  factor numeric 
##       1     240
## [1] 1500
## [1] 241
## NULL
## [1] 150
## [1] 150

REPRESENTATION GRAPHIQUE DES GROUPES DE PIXELS

4 Exploration

4.1 Analyse univariée

Representation des 240 groupes de pixels: sur chaque groupe, supprimer ce qui ne servent à rien.on supprime les colonnes selon le résultat du fichier excel sélection de variables

4.2 Analyse bivariée

  1. pix
##   pix_153   pix_138    pix_57    pix_72   pix_152   pix_168   pix_139   pix_154 
## 0.7113043 0.6790212 0.6727874 0.6534527 0.6477325 0.6397767 0.6393719 0.6325938 
##    pix_58   pix_123 
## 0.6222215 0.6032054
##     pix_36     pix_37    pix_204    pix_205    pix_203    pix_202    pix_131 
## 0.02720639 0.03493618 0.08567808 0.09472063 0.10449521 0.12044912 0.12727255 
##     pix_38    pix_186     pix_51 
## 0.13499050 0.17389801 0.18931691

Voici la matrice des corrélations :

Nous observons de tres fortes corrélations

Voici la matrice des corrélations avec coefficient de spearman par rang :

4.3 Analyse multivariée

4.3.1 Analyse factorielle

4.3.2 ACP sur les données quantitatives

Transformation de variables

## Loading required package: ggplot2
## Welcome! Want to learn more? See two factoextra-related books at https://goo.gl/ve3WBa

Exploitation de l’acp garder les 50 premieres composante principales

## Importance of components:
##                            PC1     PC2      PC3     PC4     PC5     PC6     PC7
## Standard deviation     16.2462 12.4069 11.95148 9.82256 9.18245 7.87848 7.37105
## Proportion of Variance  0.1783  0.1040  0.09651 0.06519 0.05697 0.04194 0.03671
## Cumulative Proportion   0.1783  0.2823  0.37885 0.44405 0.50102 0.54296 0.57967
##                            PC8     PC9    PC10    PC11    PC12    PC13   PC14
## Standard deviation     6.88477 6.62678 5.93165 5.27942 5.01733 4.79990 4.6481
## Proportion of Variance 0.03203 0.02967 0.02377 0.01883 0.01701 0.01557 0.0146
## Cumulative Proportion  0.61169 0.64137 0.66514 0.68397 0.70098 0.71655 0.7311
##                           PC15    PC16    PC17    PC18    PC19    PC20    PC21
## Standard deviation     4.35925 4.30979 3.95707 3.78329 3.69746 3.63423 3.41547
## Proportion of Variance 0.01284 0.01255 0.01058 0.00967 0.00924 0.00892 0.00788
## Cumulative Proportion  0.74398 0.75654 0.76712 0.77679 0.78602 0.79495 0.80283
##                           PC22    PC23   PC24    PC25    PC26    PC27    PC28
## Standard deviation     3.34112 3.15763 3.1261 2.92363 2.88227 2.82266 2.64167
## Proportion of Variance 0.00754 0.00674 0.0066 0.00578 0.00561 0.00538 0.00472
## Cumulative Proportion  0.81037 0.81711 0.8237 0.82949 0.83510 0.84048 0.84520
##                           PC29    PC30   PC31    PC32    PC33    PC34    PC35
## Standard deviation     2.53246 2.47004 2.4323 2.32352 2.29095 2.25418 2.15915
## Proportion of Variance 0.00433 0.00412 0.0040 0.00365 0.00355 0.00343 0.00315
## Cumulative Proportion  0.84953 0.85365 0.8577 0.86130 0.86485 0.86828 0.87143
##                           PC36   PC37    PC38    PC39    PC40    PC41    PC42
## Standard deviation     2.13652 2.1084 2.00353 1.97731 1.94658 1.92636 1.88226
## Proportion of Variance 0.00308 0.0030 0.00271 0.00264 0.00256 0.00251 0.00239
## Cumulative Proportion  0.87451 0.8775 0.88023 0.88287 0.88543 0.88794 0.89033
##                           PC43    PC44   PC45    PC46    PC47    PC48    PC49
## Standard deviation     1.85614 1.83292 1.8055 1.75732 1.71123 1.69259 1.68218
## Proportion of Variance 0.00233 0.00227 0.0022 0.00209 0.00198 0.00194 0.00191
## Cumulative Proportion  0.89266 0.89493 0.8971 0.89922 0.90120 0.90313 0.90505
##                           PC50    PC51    PC52    PC53    PC54    PC55   PC56
## Standard deviation     1.66331 1.65462 1.61436 1.60210 1.57443 1.56411 1.5383
## Proportion of Variance 0.00187 0.00185 0.00176 0.00173 0.00167 0.00165 0.0016
## Cumulative Proportion  0.90692 0.90876 0.91053 0.91226 0.91394 0.91559 0.9172
##                           PC57    PC58    PC59    PC60   PC61    PC62    PC63
## Standard deviation     1.51217 1.50537 1.46663 1.44998 1.4374 1.41689 1.40245
## Proportion of Variance 0.00155 0.00153 0.00145 0.00142 0.0014 0.00136 0.00133
## Cumulative Proportion  0.91873 0.92026 0.92172 0.92314 0.9245 0.92589 0.92722
##                          PC64   PC65    PC66    PC67   PC68    PC69    PC70
## Standard deviation     1.3894 1.3873 1.37731 1.37151 1.3338 1.32533 1.31292
## Proportion of Variance 0.0013 0.0013 0.00128 0.00127 0.0012 0.00119 0.00116
## Cumulative Proportion  0.9285 0.9298 0.93111 0.93238 0.9336 0.93476 0.93593
##                           PC71    PC72    PC73    PC74    PC75   PC76    PC77
## Standard deviation     1.30214 1.28515 1.27198 1.26555 1.24697 1.2174 1.20583
## Proportion of Variance 0.00115 0.00112 0.00109 0.00108 0.00105 0.0010 0.00098
## Cumulative Proportion  0.93708 0.93819 0.93928 0.94037 0.94142 0.9424 0.94340
##                           PC78    PC79    PC80    PC81    PC82    PC83    PC84
## Standard deviation     1.19493 1.18509 1.17186 1.16930 1.16256 1.13641 1.13202
## Proportion of Variance 0.00096 0.00095 0.00093 0.00092 0.00091 0.00087 0.00087
## Cumulative Proportion  0.94437 0.94531 0.94624 0.94717 0.94808 0.94895 0.94982
##                           PC85    PC86    PC87    PC88    PC89    PC90    PC91
## Standard deviation     1.12732 1.09692 1.08397 1.07456 1.06498 1.05839 1.05702
## Proportion of Variance 0.00086 0.00081 0.00079 0.00078 0.00077 0.00076 0.00075
## Cumulative Proportion  0.95068 0.95149 0.95228 0.95306 0.95383 0.95459 0.95534
##                           PC92    PC93    PC94   PC95    PC96    PC97    PC98
## Standard deviation     1.04942 1.04068 1.02956 1.0207 1.01104 1.00178 0.98958
## Proportion of Variance 0.00074 0.00073 0.00072 0.0007 0.00069 0.00068 0.00066
## Cumulative Proportion  0.95609 0.95682 0.95753 0.9582 0.95893 0.95961 0.96027
##                           PC99   PC100   PC101   PC102   PC103   PC104  PC105
## Standard deviation     0.98133 0.97493 0.96711 0.96005 0.95249 0.94900 0.9422
## Proportion of Variance 0.00065 0.00064 0.00063 0.00062 0.00061 0.00061 0.0006
## Cumulative Proportion  0.96092 0.96156 0.96219 0.96282 0.96343 0.96404 0.9646
##                          PC106   PC107   PC108   PC109   PC110   PC111   PC112
## Standard deviation     0.93331 0.92744 0.92434 0.91707 0.91334 0.90579 0.89454
## Proportion of Variance 0.00059 0.00058 0.00058 0.00057 0.00056 0.00055 0.00054
## Cumulative Proportion  0.96523 0.96581 0.96638 0.96695 0.96752 0.96807 0.96861
##                          PC113   PC114   PC115   PC116  PC117   PC118   PC119
## Standard deviation     0.88852 0.88538 0.88153 0.87332 0.8604 0.85586 0.85356
## Proportion of Variance 0.00053 0.00053 0.00053 0.00052 0.0005 0.00049 0.00049
## Cumulative Proportion  0.96914 0.96967 0.97020 0.97071 0.9712 0.97171 0.97220
##                          PC120   PC121   PC122   PC123   PC124   PC125   PC126
## Standard deviation     0.84424 0.84106 0.83472 0.82672 0.81983 0.81178 0.80954
## Proportion of Variance 0.00048 0.00048 0.00047 0.00046 0.00045 0.00045 0.00044
## Cumulative Proportion  0.97268 0.97316 0.97363 0.97409 0.97455 0.97499 0.97544
##                          PC127   PC128   PC129   PC130   PC131  PC132  PC133
## Standard deviation     0.80687 0.79798 0.78907 0.78571 0.77906 0.7726 0.7664
## Proportion of Variance 0.00044 0.00043 0.00042 0.00042 0.00041 0.0004 0.0004
## Cumulative Proportion  0.97588 0.97631 0.97673 0.97714 0.97755 0.9780 0.9784
##                          PC134   PC135   PC136   PC137   PC138   PC139   PC140
## Standard deviation     0.75974 0.75402 0.74896 0.74257 0.73827 0.73179 0.72864
## Proportion of Variance 0.00039 0.00038 0.00038 0.00037 0.00037 0.00036 0.00036
## Cumulative Proportion  0.97874 0.97913 0.97951 0.97988 0.98025 0.98061 0.98097
##                          PC141   PC142   PC143   PC144   PC145   PC146   PC147
## Standard deviation     0.72688 0.71970 0.71734 0.71193 0.70752 0.70174 0.69439
## Proportion of Variance 0.00036 0.00035 0.00035 0.00034 0.00034 0.00033 0.00033
## Cumulative Proportion  0.98133 0.98168 0.98202 0.98237 0.98270 0.98304 0.98336
##                          PC148   PC149   PC150   PC151   PC152  PC153  PC154
## Standard deviation     0.69355 0.69161 0.68868 0.68024 0.67937 0.6688 0.6680
## Proportion of Variance 0.00033 0.00032 0.00032 0.00031 0.00031 0.0003 0.0003
## Cumulative Proportion  0.98369 0.98401 0.98433 0.98464 0.98496 0.9853 0.9856
##                         PC155   PC156   PC157   PC158   PC159   PC160   PC161
## Standard deviation     0.6636 0.65940 0.65025 0.64626 0.64167 0.63747 0.63302
## Proportion of Variance 0.0003 0.00029 0.00029 0.00028 0.00028 0.00027 0.00027
## Cumulative Proportion  0.9859 0.98615 0.98644 0.98672 0.98700 0.98727 0.98754
##                          PC162   PC163   PC164   PC165   PC166   PC167   PC168
## Standard deviation     0.63157 0.62512 0.62030 0.61510 0.61181 0.60843 0.60701
## Proportion of Variance 0.00027 0.00026 0.00026 0.00026 0.00025 0.00025 0.00025
## Cumulative Proportion  0.98781 0.98808 0.98834 0.98859 0.98884 0.98909 0.98934
##                          PC169   PC170   PC171   PC172   PC173   PC174   PC175
## Standard deviation     0.60405 0.59925 0.59291 0.58859 0.58481 0.58138 0.57603
## Proportion of Variance 0.00025 0.00024 0.00024 0.00023 0.00023 0.00023 0.00022
## Cumulative Proportion  0.98959 0.98983 0.99007 0.99030 0.99054 0.99076 0.99099
##                          PC176   PC177   PC178   PC179   PC180   PC181  PC182
## Standard deviation     0.56909 0.56546 0.56319 0.56158 0.55628 0.55334 0.5450
## Proportion of Variance 0.00022 0.00022 0.00021 0.00021 0.00021 0.00021 0.0002
## Cumulative Proportion  0.99121 0.99142 0.99164 0.99185 0.99206 0.99227 0.9925
##                         PC183  PC184   PC185   PC186   PC187   PC188   PC189
## Standard deviation     0.5415 0.5379 0.53412 0.52771 0.52553 0.52172 0.52104
## Proportion of Variance 0.0002 0.0002 0.00019 0.00019 0.00019 0.00018 0.00018
## Cumulative Proportion  0.9927 0.9929 0.99305 0.99324 0.99343 0.99361 0.99380
##                          PC190   PC191   PC192   PC193   PC194   PC195   PC196
## Standard deviation     0.51663 0.51228 0.50635 0.50376 0.49755 0.49705 0.49496
## Proportion of Variance 0.00018 0.00018 0.00017 0.00017 0.00017 0.00017 0.00017
## Cumulative Proportion  0.99398 0.99415 0.99433 0.99450 0.99467 0.99483 0.99500
##                          PC197   PC198   PC199   PC200   PC201   PC202   PC203
## Standard deviation     0.48958 0.48522 0.48007 0.47901 0.47490 0.47040 0.46737
## Proportion of Variance 0.00016 0.00016 0.00016 0.00016 0.00015 0.00015 0.00015
## Cumulative Proportion  0.99516 0.99532 0.99547 0.99563 0.99578 0.99593 0.99608
##                          PC204   PC205   PC206   PC207   PC208   PC209   PC210
## Standard deviation     0.46213 0.46063 0.45533 0.45011 0.44806 0.44477 0.44147
## Proportion of Variance 0.00014 0.00014 0.00014 0.00014 0.00014 0.00013 0.00013
## Cumulative Proportion  0.99622 0.99637 0.99651 0.99664 0.99678 0.99691 0.99704
##                          PC211   PC212   PC213   PC214   PC215   PC216   PC217
## Standard deviation     0.44125 0.43295 0.43249 0.42971 0.42664 0.42398 0.41954
## Proportion of Variance 0.00013 0.00013 0.00013 0.00012 0.00012 0.00012 0.00012
## Cumulative Proportion  0.99718 0.99730 0.99743 0.99755 0.99768 0.99780 0.99792
##                          PC218   PC219   PC220   PC221   PC222   PC223  PC224
## Standard deviation     0.41708 0.41416 0.40623 0.40573 0.40359 0.39570 0.3882
## Proportion of Variance 0.00012 0.00012 0.00011 0.00011 0.00011 0.00011 0.0001
## Cumulative Proportion  0.99803 0.99815 0.99826 0.99837 0.99848 0.99859 0.9987
##                         PC225  PC226  PC227  PC228   PC229   PC230   PC231
## Standard deviation     0.3858 0.3834 0.3817 0.3756 0.36407 0.36243 0.35816
## Proportion of Variance 0.0001 0.0001 0.0001 0.0001 0.00009 0.00009 0.00009
## Cumulative Proportion  0.9988 0.9989 0.9990 0.9991 0.99917 0.99926 0.99935
##                          PC232   PC233   PC234   PC235   PC236   PC237   PC238
## Standard deviation     0.34993 0.34789 0.33923 0.33563 0.32923 0.32161 0.31592
## Proportion of Variance 0.00008 0.00008 0.00008 0.00008 0.00007 0.00007 0.00007
## Cumulative Proportion  0.99943 0.99951 0.99959 0.99967 0.99974 0.99981 0.99988
##                          PC239   PC240
## Standard deviation     0.30991 0.28882
## Proportion of Variance 0.00006 0.00006
## Cumulative Proportion  0.99994 1.00000

Exploitation de l’acp garder les 10 premieres composante principales. Pertes d’information mais gain de temps. Sur des gros datasets? Exploitation de l’acp garder les 40 premieres composante principales. Pertes d’information mais gain de temps. Sur des gros datasets? test a 30 non concluant.

5 Pré-traitement

La récupération dataSET basé sur l’acp a 40 dimensions. Cela permet une reduction du nombre de variable, passant de 240 à 40 avec une perte d’information acceptable:87,6% de l’information est résumée

On transforme notre dataset Test grace aux 40 composantes principales on passe de 375241 Ă  40241

## 
## Attaching package: 'reshape'
## The following object is masked from 'package:data.table':
## 
##     melt

on tente la préduction avec les fameuses méthodes :

6 prédiction

Arbre de décision /Tree CART

utilisation de la librairie CARET

## Loading required package: lattice
## Time difference of 5.151615 secs

exploitataion des Résultats du CART

Voici le resultat de l’apprentissage :

## CART 
## 
## 1125 samples
##   40 predictor
##   10 classes: '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' 
## 
## No pre-processing
## Resampling: Bootstrapped (25 reps) 
## Summary of sample sizes: 1125, 1125, 1125, 1125, 1125, 1125, ... 
## Resampling results across tuning parameters:
## 
##   maxdepth  Accuracy   Kappa    
##    1        0.2354981  0.1593970
##    2        0.3657610  0.3010154
##    3        0.3950741  0.3327888
##    4        0.4213976  0.3614760
##    5        0.4884847  0.4341967
##    6        0.5576086  0.5095610
##    7        0.6114697  0.5688294
##    8        0.6596813  0.6219046
##    9        0.6993625  0.6657589
##   10        0.7223685  0.6913621
##   11        0.7351236  0.7055100
##   12        0.7469353  0.7185980
##   13        0.7527365  0.7250121
##   14        0.7544709  0.7269815
##   15        0.7553395  0.7279727
##   16        0.7559220  0.7286162
##   17        0.7559220  0.7286162
##   18        0.7559220  0.7286162
##   19        0.7559220  0.7286162
##   20        0.7559220  0.7286162
##   21        0.7559220  0.7286162
##   22        0.7559220  0.7286162
##   23        0.7559220  0.7286162
##   24        0.7559220  0.7286162
##   25        0.7559220  0.7286162
##   26        0.7559220  0.7286162
##   27        0.7559220  0.7286162
##   28        0.7559220  0.7286162
##   29        0.7559220  0.7286162
##   30        0.7559220  0.7286162
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was maxdepth = 16.

Nous avons une faible erreur d’apprentissage.

Voici les paramètres choisis :

## Best parameter pour maxdepth est : 16

## Warning: package 'rattle' was built under R version 3.6.3
## Loading required package: tibble
## Warning: package 'tibble' was built under R version 3.6.3
## Loading required package: bitops
## Rattle: A free graphical interface for data science with R.
## Version 5.4.0 Copyright (c) 2006-2020 Togaware Pty Ltd.
## Entrez 'rattle()' pour secouer, faire vibrer, et faire défiler vos données.

Voici le resultat de la validation:

##  Accuracy     Kappa 
## 0.7520000 0.7242407
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction  0  1  2  3  4  5  6  7  8  9
##          0 34  1  0  1  1  4  0  0  1  0
##          1  1 27  2  8  3  5  0  0  2  0
##          2  0  4 28  0  0  0  0  3  0  1
##          3  0  2  0 26  0  1  1  1  6  0
##          4  1  3  0  1 21  1  2  0  0  0
##          5  1  0  0  0  0 26  2  0  2  0
##          6  1  0  0  0  8  0 31  0  0  0
##          7  0  0  2  0  0  0  0 27  0  0
##          8  6  0  0  0  0  1  1  0 25  0
##          9  0  0  7  2  0  2  0  2  0 37
## 
## Overall Statistics
##                                           
##                Accuracy : 0.752           
##                  95% CI : (0.7051, 0.7949)
##     No Information Rate : 0.1173          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.7242          
##                                           
##  Mcnemar's Test P-Value : NA              
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2 Class: 3 Class: 4 Class: 5
## Sensitivity           0.77273  0.72973  0.71795  0.68421  0.63636  0.65000
## Specificity           0.97583  0.93787  0.97619  0.96736  0.97661  0.98507
## Pos Pred Value        0.80952  0.56250  0.77778  0.70270  0.72414  0.83871
## Neg Pred Value        0.96997  0.96942  0.96755  0.96450  0.96532  0.95930
## Prevalence            0.11733  0.09867  0.10400  0.10133  0.08800  0.10667
## Detection Rate        0.09067  0.07200  0.07467  0.06933  0.05600  0.06933
## Detection Prevalence  0.11200  0.12800  0.09600  0.09867  0.07733  0.08267
## Balanced Accuracy     0.87428  0.83380  0.84707  0.82578  0.80649  0.81754
##                      Class: 6 Class: 7 Class: 8 Class: 9
## Sensitivity           0.83784  0.81818  0.69444  0.97368
## Specificity           0.97337  0.99415  0.97640  0.96142
## Pos Pred Value        0.77500  0.93103  0.75758  0.74000
## Neg Pred Value        0.98209  0.98266  0.96784  0.99692
## Prevalence            0.09867  0.08800  0.09600  0.10133
## Detection Rate        0.08267  0.07200  0.06667  0.09867
## Detection Prevalence  0.10667  0.07733  0.08800  0.13333
## Balanced Accuracy     0.90561  0.90617  0.83542  0.96755

Confusion Table

Resultats Classification Tree CART
Durée Accuracy Taux.Erreur
CART 5.151615 secs 0.752 0.248

Random Forest

## Time difference of 8.021825 secs

Voici le resultat de l’apprentissage :

## Random Forest 
## 
## 1125 samples
##   40 predictor
##   10 classes: '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' 
## 
## No pre-processing
## Resampling: Cross-Validated (2 fold) 
## Summary of sample sizes: 562, 563 
## Resampling results across tuning parameters:
## 
##   mtry  Accuracy   Kappa    
##    8    0.9439960  0.9377693
##   12    0.9351024  0.9278872
##   16    0.9306603  0.9229501
##   20    0.9244341  0.9160343
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was mtry = 8.
## Best parameter pour mtry est : 8

Apply model to the test set

##  Accuracy     Kappa 
## 0.9546667 0.9495956

Nous avons une faible taux d’erreur de validation et elle est équivalant à l’erreur d’apprentissage.

Le kappa est faible donc accord faible sur la prédiction par rapport à une prédiction au hasard.

Confusion Table

La matrice de confusion suivante se lit alors comme suit :

Resultat de la prédiction

##                         Durée  Accuracy Taux.Erreur
## Random Forest   8.021825 secs 0.9546667  0.04533333
Resultats Random Forest
Durée Accuracy Taux.Erreur
Random Forest 8.021825 secs 0.9546667 0.0453333

Nous avons une bonne accuracy pour la prédiction mais le temps d’excution est long.

Neural Networks/reseau de neurones

  • size (#Hidden Units)

    • decay (Weight Decay)
## Neural Network 
## 
## 1125 samples
##  240 predictor
##   10 classes: '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' 
## 
## No pre-processing
## Resampling: Cross-Validated (5 fold) 
## Summary of sample sizes: 899, 900, 900, 902, 899 
## Resampling results across tuning parameters:
## 
##   size  decay  Accuracy   Kappa    
##   1      0.2   0.1982072  0.1085044
##   1      0.5   0.2044136  0.1135094
##   1      0.8   0.2061953  0.1180197
##   1      1.0   0.2177711  0.1285361
##   1      1.5   0.2079969  0.1162543
##   1      2.0   0.2044216  0.1131601
##   1      3.0   0.2062232  0.1148697
##   1      4.0   0.2070923  0.1161503
##   1      5.0   0.1999851  0.1086338
##   1      6.0   0.2026676  0.1108840
##   1      7.0   0.1963777  0.1042397
##   1      8.0   0.1991198  0.1072330
##   1      9.0   0.2062152  0.1149637
##   1     10.0   0.2071160  0.1159913
##   2      0.2   0.3117654  0.2344433
##   2      0.5   0.3324372  0.2574485
##   2      0.8   0.3706043  0.3004798
##   2      1.0   0.3475567  0.2736767
##   2      1.5   0.3565281  0.2836019
##   2      2.0   0.3029884  0.2238356
##   2      3.0   0.3608654  0.2891083
##   2      4.0   0.3467543  0.2731350
##   2      5.0   0.3724253  0.3013228
##   2      6.0   0.3635408  0.2914259
##   2      7.0   0.3733223  0.3023708
##   2      8.0   0.3635331  0.2914859
##   2      9.0   0.3812275  0.3116442
##   2     10.0   0.3866917  0.3172668
##   3      0.2   0.4630706  0.4032565
##   3      0.5   0.4907383  0.4335734
##   3      0.8   0.5163024  0.4622074
##   3      1.0   0.4472515  0.3843496
##   3      1.5   0.4936711  0.4366590
##   3      2.0   0.5128003  0.4588307
##   3      3.0   0.5982488  0.5533686
##   3      4.0   0.5510805  0.5005550
##   3      5.0   0.5875774  0.5408950
##   3      6.0   0.5548598  0.5048778
##   3      7.0   0.5598879  0.5103469
##   3      8.0   0.5725146  0.5247476
##   3      9.0   0.5786932  0.5313794
##   3     10.0   0.5547268  0.5050427
##   4      0.2         NaN        NaN
##   4      0.5         NaN        NaN
##   4      0.8         NaN        NaN
##   4      1.0         NaN        NaN
##   4      1.5         NaN        NaN
##   4      2.0         NaN        NaN
##   4      3.0         NaN        NaN
##   4      4.0         NaN        NaN
##   4      5.0         NaN        NaN
##   4      6.0         NaN        NaN
##   4      7.0         NaN        NaN
##   4      8.0         NaN        NaN
##   4      9.0         NaN        NaN
##   4     10.0         NaN        NaN
##   5      0.2         NaN        NaN
##   5      0.5         NaN        NaN
##   5      0.8         NaN        NaN
##   5      1.0         NaN        NaN
##   5      1.5         NaN        NaN
##   5      2.0         NaN        NaN
##   5      3.0         NaN        NaN
##   5      4.0         NaN        NaN
##   5      5.0         NaN        NaN
##   5      6.0         NaN        NaN
##   5      7.0         NaN        NaN
##   5      8.0         NaN        NaN
##   5      9.0         NaN        NaN
##   5     10.0         NaN        NaN
## 
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were size = 3 and decay = 3.
## Best parameter pour size est : 3
## Best parameter pour decay  est : 3

#### Apply model to the test set

##  Accuracy     Kappa 
## 0.6026667 0.5597759
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction  0  1  2  3  4  5  6  7  8  9
##          0  0  0  0  1  0  0  1  0  0  0
##          1  0 30  4  0  1  1  0  1  0  1
##          2  1  1 30  0  0  0  0  0  0  0
##          3  1  1  1 34  0 31 22  3  0  0
##          4  1  2  0  0 32  1  5  0  2  0
##          5  1  0  0  1  0  0  3  0  0  0
##          6  0  0  0  0  0  2  4  0  0  0
##          7  0  1  3  2  0  4  0 28  0  0
##          8 39  0  0  0  0  1  2  0 33  2
##          9  1  2  1  0  0  0  0  1  1 35
## 
## Overall Statistics
##                                           
##                Accuracy : 0.6027          
##                  95% CI : (0.5512, 0.6525)
##     No Information Rate : 0.1173          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.5598          
##                                           
##  Mcnemar's Test P-Value : NA              
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2 Class: 3 Class: 4 Class: 5
## Sensitivity          0.000000  0.81081  0.76923  0.89474  0.96970  0.00000
## Specificity          0.993958  0.97633  0.99405  0.82493  0.96784  0.98507
## Pos Pred Value       0.000000  0.78947  0.93750  0.36559  0.74419  0.00000
## Neg Pred Value       0.882038  0.97923  0.97376  0.98582  0.99699  0.89189
## Prevalence           0.117333  0.09867  0.10400  0.10133  0.08800  0.10667
## Detection Rate       0.000000  0.08000  0.08000  0.09067  0.08533  0.00000
## Detection Prevalence 0.005333  0.10133  0.08533  0.24800  0.11467  0.01333
## Balanced Accuracy    0.496979  0.89357  0.88164  0.85983  0.96877  0.49254
##                      Class: 6 Class: 7 Class: 8 Class: 9
## Sensitivity           0.10811  0.84848   0.9167  0.92105
## Specificity           0.99408  0.97076   0.8702  0.98220
## Pos Pred Value        0.66667  0.73684   0.4286  0.85366
## Neg Pred Value        0.91057  0.98516   0.9899  0.99102
## Prevalence            0.09867  0.08800   0.0960  0.10133
## Detection Rate        0.01067  0.07467   0.0880  0.09333
## Detection Prevalence  0.01600  0.10133   0.2053  0.10933
## Balanced Accuracy     0.55110  0.90962   0.8934  0.95162

Plus proche voisins KNN

## Time difference of 1.249782 secs
## k-Nearest Neighbors 
## 
## 1125 samples
##   40 predictor
##   10 classes: '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' 
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 1012, 1012, 1013, 1012, 1013, 1014, ... 
## Resampling results across tuning parameters:
## 
##   k   Accuracy   Kappa    
##    1  0.9733399  0.9703721
##    4  0.9733716  0.9704072
##    7  0.9688910  0.9654280
##   10  0.9617796  0.9575240
##   13  0.9591325  0.9545800
## 
## Accuracy was used to select the optimal model using the largest value.
## The final value used for the model was k = 4.
## Best parameter pour k est : 4

#### Apply model to the test set

##  Accuracy     Kappa 
## 0.9733333 0.9703452
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction  0  1  2  3  4  5  6  7  8  9
##          0 43  0  0  0  0  0  0  0  1  0
##          1  0 36  0  0  0  1  0  0  0  0
##          2  0  0 39  0  0  0  0  1  0  0
##          3  1  0  0 38  0  1  0  0  1  0
##          4  0  0  0  0 33  0  0  0  0  0
##          5  0  1  0  0  0 38  2  0  0  0
##          6  0  0  0  0  0  0 34  0  0  0
##          7  0  0  0  0  0  0  0 32  0  0
##          8  0  0  0  0  0  0  1  0 34  0
##          9  0  0  0  0  0  0  0  0  0 38
## 
## Overall Statistics
##                                           
##                Accuracy : 0.9733          
##                  95% CI : (0.9515, 0.9871)
##     No Information Rate : 0.1173          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9703          
##                                           
##  Mcnemar's Test P-Value : NA              
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2 Class: 3 Class: 4 Class: 5
## Sensitivity            0.9773  0.97297   1.0000   1.0000    1.000   0.9500
## Specificity            0.9970  0.99704   0.9970   0.9911    1.000   0.9910
## Pos Pred Value         0.9773  0.97297   0.9750   0.9268    1.000   0.9268
## Neg Pred Value         0.9970  0.99704   1.0000   1.0000    1.000   0.9940
## Prevalence             0.1173  0.09867   0.1040   0.1013    0.088   0.1067
## Detection Rate         0.1147  0.09600   0.1040   0.1013    0.088   0.1013
## Detection Prevalence   0.1173  0.09867   0.1067   0.1093    0.088   0.1093
## Balanced Accuracy      0.9871  0.98501   0.9985   0.9955    1.000   0.9705
##                      Class: 6 Class: 7 Class: 8 Class: 9
## Sensitivity           0.91892  0.96970  0.94444   1.0000
## Specificity           1.00000  1.00000  0.99705   1.0000
## Pos Pred Value        1.00000  1.00000  0.97143   1.0000
## Neg Pred Value        0.99120  0.99708  0.99412   1.0000
## Prevalence            0.09867  0.08800  0.09600   0.1013
## Detection Rate        0.09067  0.08533  0.09067   0.1013
## Detection Prevalence  0.09067  0.08533  0.09333   0.1013
## Balanced Accuracy     0.95946  0.98485  0.97075   1.0000

Confusion Table

Resultats KNN
Durée Accuracy Taux.Erreur
KNN 1.249782 secs 0.9733333 0.0266667

Perceptron multicouche

## Multi-Layer Perceptron, with multiple layers 
## 
## 1125 samples
##  240 predictor
##   10 classes: '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' 
## 
## No pre-processing
## Resampling: Cross-Validated (5 fold) 
## Summary of sample sizes: 899, 900, 900, 902, 899 
## Resampling results:
## 
##   Accuracy   Kappa    
##   0.9715311  0.9683643
## 
## Tuning parameter 'layer1' was held constant at a value of 240
## Tuning
##  parameter 'layer2' was held constant at a value of 10
## Tuning
##  parameter 'layer3' was held constant at a value of 0

Apply model to the test set

##  Accuracy     Kappa 
## 0.9680000 0.9644198
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction  0  1  2  3  4  5  6  7  8  9
##          0 43  0  0  0  0  0  0  0  0  0
##          1  1 35  0  1  0  2  0  0  1  0
##          2  0  0 38  0  0  0  0  0  0  0
##          3  0  0  0 37  0  1  0  0  0  0
##          4  0  0  0  0 33  0  0  0  0  0
##          5  0  1  0  0  0 37  2  0  0  0
##          6  0  1  0  0  0  0 35  0  0  0
##          7  0  0  1  0  0  0  0 32  0  0
##          8  0  0  0  0  0  0  0  0 35  0
##          9  0  0  0  0  0  0  0  1  0 38
## 
## Overall Statistics
##                                           
##                Accuracy : 0.968           
##                  95% CI : (0.9448, 0.9834)
##     No Information Rate : 0.1173          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.9644          
##                                           
##  Mcnemar's Test P-Value : NA              
## 
## Statistics by Class:
## 
##                      Class: 0 Class: 1 Class: 2 Class: 3 Class: 4 Class: 5
## Sensitivity            0.9773  0.94595   0.9744  0.97368    1.000  0.92500
## Specificity            1.0000  0.98521   1.0000  0.99703    1.000  0.99104
## Pos Pred Value         1.0000  0.87500   1.0000  0.97368    1.000  0.92500
## Neg Pred Value         0.9970  0.99403   0.9970  0.99703    1.000  0.99104
## Prevalence             0.1173  0.09867   0.1040  0.10133    0.088  0.10667
## Detection Rate         0.1147  0.09333   0.1013  0.09867    0.088  0.09867
## Detection Prevalence   0.1147  0.10667   0.1013  0.10133    0.088  0.10667
## Balanced Accuracy      0.9886  0.96558   0.9872  0.98536    1.000  0.95802
##                      Class: 6 Class: 7 Class: 8 Class: 9
## Sensitivity           0.94595  0.96970  0.97222   1.0000
## Specificity           0.99704  0.99708  1.00000   0.9970
## Pos Pred Value        0.97222  0.96970  1.00000   0.9744
## Neg Pred Value        0.99410  0.99708  0.99706   1.0000
## Prevalence            0.09867  0.08800  0.09600   0.1013
## Detection Rate        0.09333  0.08533  0.09333   0.1013
## Detection Prevalence  0.09600  0.08800  0.09333   0.1040
## Balanced Accuracy     0.97149  0.98339  0.98611   0.9985