Script Python permettant de visualiser une PCA

README.md MàJ README.md 7 years ago
graphics.py v 1.0.0 7 years ago
resources.default.json v 1.0.0 7 years ago
README.md

graphical-pca

Script Python permettant de visualiser une PCA

Command Line

Arguments

Short Long Description Required
-h, --help show this help message and exit Optionnal
-r RESOURCES --resources RESOURCES path of resources JSON file Required
-comp COMPONENTS --components COMPONENTS number of components Optionnal, default=3
-f2d --figure2d show all 2D representation of PCA (GUI) Optionnal, default=false
-f3d --figure3d show a 3D representation of PCA (GUI) Optionnal, default=false
-o OUTPUT --output OUTPUT path of output file (record of 3D) Optionnal, default=''

Exemples

Pour une visualisation 3D avec enregistrement

python graphics.py --resources ./resources.default.json -f3d --output ./output.mp4
python graphics.py -r ./resources.default.json -f3d -o ./output.mp4

Pour une visualisation 2D

python graphics.py --resources ./resources.default.json -f2d
python graphics.py -r ./resources.default.json -f2d

Resources

Structure du fichier

{
  "colors": "rgb",
  "classes_names": ["A", "B", "C"],
  "matrix": [
    [0, 0, 0, 0],
    [1, 1, 1, 1],
    [2, 2, 2, 2]
  ],
  "targets": [0, 1, 2],
  "video": {
    "dpi": 600,
    "frames": 360,
    "fps": 30,
    "interval": 20,
    "writer": "mencoder"
  }
}
Key Type Description
colors String Liste des couleurs utilisées (pour la légende)
classes_names Array Étiquette de chaque classe (pour la légende)
matrix Array Matrice (Liste de tous les vecteurs)
targets Array Liste de la classe associée à chaque vecteurs
video Object Options pour la vidéo